Documentation ¶
Index ¶
- func AsyncResult(in *proto.CommandReq) (res *proto.CommandRes, err error)
- func GetStatus() proto.Status
- func GetStatusResponse() *proto.StatusRes
- func NotFoundResult(in *proto.CommandReq) (*proto.CommandRes, error)
- func SendResult(uuid string, cmd string, result proto.Result, data any) (err error)
- func SetError(e error)
- func SetReady() bool
- func Shutdown(delay *string) *proto.ShutdownRes
- func Start(opts StartOptions)
- func SuccessResult(in *proto.CommandReq, data any) (res *proto.CommandRes, err error)
- func UnmarshalData[T any](in *proto.CommandReq) (res T, err error)
- type Config
- type StartOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsyncResult ¶
func AsyncResult(in *proto.CommandReq) (res *proto.CommandRes, err error)
func GetStatusResponse ¶
func NotFoundResult ¶
func NotFoundResult(in *proto.CommandReq) (*proto.CommandRes, error)
func SendResult ¶
func Shutdown ¶
func Shutdown(delay *string) *proto.ShutdownRes
func Start ¶
func Start(opts StartOptions)
func SuccessResult ¶
func SuccessResult(in *proto.CommandReq, data any) (res *proto.CommandRes, err error)
func UnmarshalData ¶
func UnmarshalData[T any](in *proto.CommandReq) (res T, err error)
Types ¶
type Config ¶
type Config struct { AppPort string `env:"APP_PORT" validate:"required"` ID string `env:"PLUGIN_ID" validate:"required"` Port string `env:"PLUGIN_PORT" validate:"required"` ConnRetry int `env:"CONN_RETRY" envDefault:"3" validate:"omitempty"` ConnDelay string `env:"CONN_DELAY" envDefault:"1s" validate:"omitempty"` Marshal string `env:"MARSHAL" envDefault:"msgpack" validate:"required,oneof=json msgpack gob"` }
type StartOptions ¶
type StartOptions struct { Service proto.PluginServiceServer Callback func() error }
Click to show internal directories.
Click to hide internal directories.