basic

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: MIT Imports: 18 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultAllowedMethods = []string{"OPTIONS", "HEAD", "GET", "PUT", "POST", "DELETE", "PATCH"}
	ShutDownGrace         = 1 * time.Second
)

Functions

This section is empty.

Types

type Service

type Service struct {
	ListenAddress      string
	AllowedMethods     []string
	AllowedOriginsFunc func(origin string) bool
	Router             *mux.Router
	Server             *http.Server
	SecLayer           *secure.Secure
	Cors               *cors.Cors
	Debug              bool
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, opts ...options.Option) (*Service, error)

func (*Service) ALL

func (s *Service) ALL(def *service.RouteDefinition)

func (*Service) AssetHandler

func (s *Service) AssetHandler(def *service.HeadlessAssetsDefinition, ctx service.Context) (interface{}, error)

func (*Service) Context

func (s *Service) Context() context.Context

func (*Service) DELETE

func (s *Service) DELETE(def *service.RouteDefinition)

func (*Service) Error

func (s *Service) Error() error

func (*Service) GET

func (s *Service) GET(def *service.RouteDefinition)

func (*Service) GetListenAddress

func (s *Service) GetListenAddress() (*url.URL, error)

func (*Service) Kill

func (s *Service) Kill()

func (*Service) LowLevel

func (s *Service) LowLevel(def *service.LowLevelDefinition) *mux.Route

func (*Service) LowLevelAssetHandler

func (s *Service) LowLevelAssetHandler(def *service.HeadlessAssetsDefinition, w http.ResponseWriter, r *http.Request) error

func (*Service) PATCH

func (s *Service) PATCH(def *service.RouteDefinition)

func (*Service) POST

func (s *Service) POST(def *service.RouteDefinition)

func (*Service) PUT

func (s *Service) PUT(def *service.RouteDefinition)

func (*Service) Raw

func (s *Service) Raw(def *service.RawRouteDefinition) *mux.Route

func (*Service) ServeAssets

func (s *Service) ServeAssets(def *service.AssetsDefinition)

func (*Service) SetOption

func (s *Service) SetOption(optIface interface{}) error

func (*Service) Start

func (s *Service) Start()

func (*Service) Stop

func (s *Service) Stop()

func (*Service) Wait

func (s *Service) Wait() error

func (*Service) WebSocket

func (s *Service) WebSocket(def *service.WebSocketDefinition)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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