Documentation ¶
Index ¶
- func Run(server Server, deallocFunc func() error, opts ...Option) error
- func RunServer(server Server, opts ...Option) error
- type Config
- type EmptyServer
- type GrpcServer
- type HttpServer
- type Option
- type Server
- type TaskServer
- func (s *TaskServer) AddCronFunc(spec string, fn func()) error
- func (s *TaskServer) AddOnceTimeAfterFunc(d time.Duration, fn func(ctx context.Context)) error
- func (s *TaskServer) AddTickerTimeAfterFunc(d time.Duration, fn func(ctx context.Context)) error
- func (s *TaskServer) AddTimeAfterFunc(d time.Duration, fn func(ctx context.Context)) error
- func (s *TaskServer) Run(c *Config) error
- func (s *TaskServer) Shutdown(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { ListenAddr string ReadTimeout time.Duration WriteTimeout time.Duration Context context.Context }
func (*Config) WithOptions ¶
type EmptyServer ¶ added in v0.1.1
type EmptyServer struct { }
func (*EmptyServer) Run ¶ added in v0.1.1
func (s *EmptyServer) Run(cfg *Config) error
type GrpcServer ¶
type GrpcServer struct {
// contains filtered or unexported fields
}
func NewGrpcServer ¶
func NewGrpcServer() *GrpcServer
func (*GrpcServer) Run ¶
func (s *GrpcServer) Run(c *Config) error
func (*GrpcServer) Server ¶
func (s *GrpcServer) Server() *grpc.Server
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewHttpServer ¶
func NewHttpServer(handler http.Handler) *HttpServer
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithContext ¶
func WithListenAddr ¶
func WithReadTimeout ¶
func WithWriteTimeout ¶
type TaskServer ¶
type TaskServer struct {
// contains filtered or unexported fields
}
func NewTaskServer ¶
func NewTaskServer() *TaskServer
func (*TaskServer) AddCronFunc ¶
func (s *TaskServer) AddCronFunc(spec string, fn func()) error
func (*TaskServer) AddOnceTimeAfterFunc ¶ added in v0.2.7
AddOnceTimeAfterFunc after d, once exec
func (*TaskServer) AddTickerTimeAfterFunc ¶ added in v0.2.7
AddTickerTimeAfterFunc ticker d, loop exec
func (*TaskServer) AddTimeAfterFunc ¶
you can use AddTickerTimeAfterFunc replace this Deprecated
func (*TaskServer) Run ¶
func (s *TaskServer) Run(c *Config) error
Click to show internal directories.
Click to hide internal directories.