Documentation
¶
Index ¶
- func HTTP1FastMatchWriter() cmux.MatchWriter
- func HTTP2MatchWithHeaderExclude(name, value string) cmux.MatchWriter
- func HTTP2MatchWriter() cmux.MatchWriter
- func HttpPrefixMatcher(prefix string) cmux.Matcher
- 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 WithDaemonNameWorker(name 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 HTTP1FastMatchWriter ¶ added in v1.1.31
func HTTP1FastMatchWriter() cmux.MatchWriter
func HTTP2MatchWithHeaderExclude ¶ added in v1.1.31
func HTTP2MatchWithHeaderExclude(name, value string) cmux.MatchWriter
func HTTP2MatchWriter ¶ added in v1.1.31
func HTTP2MatchWriter() cmux.MatchWriter
func HttpPrefixMatcher ¶ added in v1.0.18
HttpPrefixMatcher returns a cmux.MatcherFunc that matches based on HTTP path prefix.
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 WaitPprof chan struct{} GrpcListener listenerGetter HttpListener listenerGetter HttpMux *http.ServeMux HttpHandler http.Handler // 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 WithDaemonNameWorker ¶ added in v1.0.14
func WithDaemonNameWorker(name string, fn WorkerFunc) ServiceOption
func WithDaemonWorker ¶
func WithDaemonWorker(fn WorkerFunc) ServiceOption
func WithNameWorker ¶
func WithNameWorker(name string, fn WorkerFunc) ServiceOption
func WithService ¶
func WithService(name string) ServiceOption
func WithTag ¶
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.