Skip to content

Import path: gitlab.soludian.com/soludian/fountain/libs/ftasker/fjob

fjob

go
import "gitlab.soludian.com/soludian/fountain/libs/ftasker/fjob"

Index

Constants

go
const KPackageName = "fjob"

func GetJobList

go
func GetJobList(ctx fiber.Ctx) error

HandleJobList job list

func Handle

go
func Handle(ctx fiber.Ctx) error

Handle...

func NewFErrorResponse

go
func NewFErrorResponse(err *froto.RpcError) (string, *froto.RpcError)

func WriteError

go
func WriteError(c fiber.Ctx, err *froto.RpcError) error

*

  • Returns an error response

func WriteErrorWithExtend

go
func WriteErrorWithExtend(c fiber.Ctx, err *froto.RpcError, extend map[froto.Constructor]froto.ObjectInf) error

*

  • Returns a success response

func WriteNotImplementedError

go
func WriteNotImplementedError(c fiber.Ctx) error

*

  • Returns an error response

func WriteSuccess

go
func WriteSuccess(c fiber.Ctx, v any) error

*

  • Returns a success response

func WriteSuccessEmptyContent

go
func WriteSuccessEmptyContent(c fiber.Ctx) error

*

  • Returns a success response without content

func WriteSuccessWithExtend

go
func WriteSuccessWithExtend(c fiber.Ctx, data any, extend map[froto.Constructor]froto.ObjectInf) error

*

  • Returns a success response

func WriteSuccessWithStatus

go
func WriteSuccessWithStatus(c fiber.Ctx, code int, v any) error

*

  • Returns a success response

type Context

Context Job Context

go
type Context struct {
    Ctx     context.Context
    Writer  http.ResponseWriter
    Request *http.Request
}

type FJob

Runnable...

go
type FJob struct {
    // contains filtered or unexported fields
}

func Job

go
func Job(name string, startFunc func(Context) error) FJob

Job method

func (FJob) GetName

go
func (c FJob) GetName() string

func (FJob) Start

go
func (c FJob) Start() error

Start start

func (FJob) StartHTTP

go
func (c FJob) StartHTTP(w http.ResponseWriter, r *http.Request)

StartHTTP ...

func (FJob) Stop

go
func (c FJob) Stop() error

Stop...

type Response

*

  • Defines a response object
go
type Response[T any] struct {
    Message     string                                `json:"message,omitempty"`
    Data        T                                     `json:"data,omitempty"`
    DataExtend  map[froto.Constructor]froto.ObjectInf `json:"data_extend,omitempty"`
    Description string                                `json:"description,omitempty"`
    Status      int                                   `json:"status,omitempty"`
}

Generated by gomarkdoc