api

package
v0.0.0-...-e528a46 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SSL_DIR       = "/etc/ssl"
	JWT_SECRET    = "There is a mouse in my house"
	HOST          = "localhost"
	PORT          = "8081"
	USEHTTPS      = false
	TLSMINVERSION = "1.2"
	STRICTCIPHERS = false
	ENABLECORS    = false
)

Variables

This section is empty.

Functions

func MyAuthenticator

func MyAuthenticator(next http.Handler) http.Handler

func NewBaseHandler

func NewBaseHandler(logger *log.Logger, m *chi.Mux) models.HandlerIFace

func String

func String() string

Types

type BaseHandler

type BaseHandler struct {
	models.Handler
	// contains filtered or unexported fields
}

func (BaseHandler) GetPrefix

func (bh BaseHandler) GetPrefix() string

func (BaseHandler) GetRoutes

func (bh BaseHandler) GetRoutes() []models.Route

func (BaseHandler) GetService

func (bh BaseHandler) GetService() models.Service

type Server

type Server struct {
	Config   *ServerConfig
	Logger   *log.Logger
	Context  context.Context
	Router   *chi.Mux
	Handlers []models.HandlerIFace
}

func NewServer

func NewServer(ctx context.Context) (s *Server, err error)

func (*Server) ServeAPI

func (s *Server) ServeAPI()

type ServerConfig

type ServerConfig struct {
	Hostname             string
	Port                 string
	UseHttps             bool
	TLSMinVersion        string
	HttpTLSStrictCiphers bool
	TLSCert              string
	TLSKey               string
	EnableCORS           bool
	JWTSecret            string
	LoggingConfig        *httplogging.HttpLoggingConfig //api/logging/config
}

func InitServerConfig

func InitServerConfig() (config *ServerConfig, err error)

Directories

Path Synopsis
geo

Jump to

Keyboard shortcuts

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