servers

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2022 License: MIT Imports: 32 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAuth

func CreateAuth(server *Server) (models.Auth, error)

func CreateStripeService

func CreateStripeService(server *Server, auth models.Auth) (*stripeService, error)

func RegisterAuthService

func RegisterAuthService(server *Server, auth models.Auth, adminRoles string) error

func RegisterStripeService

func RegisterStripeService(server *Server, auth models.Auth) error

func ServeStaticFiles

func ServeStaticFiles(port int, mappings []string)

func SetupRouter

func SetupRouter() *chi.Mux

Types

type PhoneCode added in v0.0.26

type PhoneCode struct {
	models.SMSMessage
	Code string `json:"code,omitempty"`
}

type Server

type Server struct {
	Router *chi.Mux

	Name        string `json:"name"`
	Seed        string `json:"seed"`
	Port        int    `json:"port"`
	Public      string `json:"public"`
	Secret      string `json:"secret"`
	CorsOrigins string `json:"cors_origins"`
	// contains filtered or unexported fields
}

func NewServer

func NewServer(cors ...bool) *Server

func (*Server) AddSetup

func (self *Server) AddSetup(f func(ctx context.Context) error)

func (*Server) AddTeardown

func (self *Server) AddTeardown(f func() error)

func (*Server) GetCache

func (self *Server) GetCache() *models.TenureCache

func (*Server) GetDb

func (self *Server) GetDb() models.DbConn

func (*Server) GetPublicURL added in v0.0.8

func (self *Server) GetPublicURL() string

func (*Server) GetSecret

func (self *Server) GetSecret() []byte

func (*Server) GetSubConfig

func (self *Server) GetSubConfig(key string) map[string]any

func (*Server) HasSubConfig

func (self *Server) HasSubConfig(key string) bool

func (*Server) LoadConfig

func (self *Server) LoadConfig(configPaths *[]string)

func (*Server) Serve

func (self *Server) Serve()

func (*Server) UseCORS added in v0.0.7

func (self *Server) UseCORS()

Jump to

Keyboard shortcuts

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