httpapi

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CronHttpServer

type CronHttpServer struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *CronHttpServer

func (*CronHttpServer) Do

func (e *CronHttpServer) Do(key string, fn func() (any, error)) (v any, err error, shared bool)

func (*CronHttpServer) Name

func (h *CronHttpServer) Name() string

func (*CronHttpServer) Start

func (e *CronHttpServer) Start(ctx context.Context) error

func (*CronHttpServer) Stop

func (e *CronHttpServer) Stop(ctx context.Context) error

type Handler

type Handler interface {
	Prefix() string
	Middlewares() []gin.HandlerFunc
	Routers() []Router
}

type Option

type Option func(opt *option)

func WithDELETE

func WithDELETE(path string, hs ...gin.HandlerFunc) Option

func WithGET

func WithGET(path string, hs ...gin.HandlerFunc) Option

func WithHandlers

func WithHandlers(handles ...Handler) Option

func WithPOST

func WithPOST(path string, hs ...gin.HandlerFunc) Option

func WithPUT

func WithPUT(path string, hs ...gin.HandlerFunc) Option

func WithPort

func WithPort(port string) Option

func WithTLS

func WithTLS(cert, key string) Option

type Router

type Router struct {
	Method string
	Path   string
	Handle []gin.HandlerFunc
}

func NewRouter

func NewRouter(method, path string, handles ...gin.HandlerFunc) Router

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL