Documentation ¶
Index ¶
- func Run(srv *CoreService) error
- func Start[T listenEntry](srv *CoreService, addr T) error
- func StructName(i any) string
- type CoreService
- type Options
- type Puzzle
- type ServiceOption
- func WithCronWorker(cron string, fn WorkerFunc) ServiceOption
- func WithDaemonWorker(fn WorkerFunc) ServiceOption
- func WithNameWorker(name string, fn WorkerFunc) ServiceOption
- func WithService(name string) ServiceOption
- func WithTag(tag string) ServiceOption
- func WithWorker(fn WorkerFunc) ServiceOption
- type Worker
- type WorkerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(srv *CoreService) error
func Start ¶
func Start[T listenEntry](srv *CoreService, addr T) error
func StructName ¶
Types ¶
type CoreService ¶
type CoreService struct {
// contains filtered or unexported fields
}
func NewPuzzleCore ¶
func NewPuzzleCore(opts ...ServiceOption) *CoreService
func (*CoreService) GracefulStopPuzzle ¶
func (c *CoreService) GracefulStopPuzzle()
type Options ¶
type Options struct { Ctx context.Context ListenerAddr string ServiceName string Tags []string Cmux cmux.CMux // contains filtered or unexported fields }
func (*Options) RegisterPuzzle ¶
RegisterPuzzle will put Puzzle into cores service It replaces the previously registered Puzzle with the same name
type ServiceOption ¶
type ServiceOption func(*Options)
func WithCronWorker ¶
func WithCronWorker(cron string, fn WorkerFunc) ServiceOption
func WithDaemonWorker ¶
func WithDaemonWorker(fn WorkerFunc) ServiceOption
func WithNameWorker ¶
func WithNameWorker(name string, fn WorkerFunc) ServiceOption
func WithService ¶ added in v1.0.5
func WithService(name string) ServiceOption
func WithTag ¶ added in v1.0.5
func WithTag(tag string) ServiceOption
func WithWorker ¶
func WithWorker(fn WorkerFunc) ServiceOption
type WorkerFunc ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.