restapi

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CorrelationMiddlewareAdapter added in v0.0.19

func CorrelationMiddlewareAdapter() controllers.Adapter

func JsonContentMiddlewareAdapter added in v0.0.19

func JsonContentMiddlewareAdapter() controllers.Adapter

func LoggerMiddlewareAdapter added in v0.0.19

func LoggerMiddlewareAdapter() controllers.Adapter

Types

type DefaultHomepage

type DefaultHomepage struct {
	CorrelationID string `json:"id" bson:"_id" yaml:"id"`
	Timestamp     string `json:"timestamp" bson:"timestamp" yaml:"timestamp"`
	Message       string `json:"message" bson:"message" yaml:"message"`
}

type HttpListener

type HttpListener struct {
	Router          *mux.Router
	Context         *execution_context.Context
	Logger          *logger.Logger
	Options         *HttpListenerOptions
	Controllers     []controllers.Controller
	DefaultAdapters []controllers.Adapter
	Servers         []*http.Server
	// contains filtered or unexported fields
}

HttpListener HttpListener structure

func GetHttpListener

func GetHttpListener() *HttpListener

func NewHttpListener

func NewHttpListener() *HttpListener

NewHttpListener Creates a new controller

func (*HttpListener) AddAuthorizedController added in v0.0.14

func (l *HttpListener) AddAuthorizedController(c controllers.Controller, path string, methods ...string)

func (*HttpListener) AddAuthorizedControllerWithClaims added in v0.0.19

func (l *HttpListener) AddAuthorizedControllerWithClaims(c controllers.Controller, path string, claims []string, methods ...string)

func (*HttpListener) AddAuthorizedControllerWithRoles added in v0.0.19

func (l *HttpListener) AddAuthorizedControllerWithRoles(c controllers.Controller, path string, roles []string, methods ...string)

func (*HttpListener) AddAuthorizedControllerWithRolesAndClaims added in v0.0.19

func (l *HttpListener) AddAuthorizedControllerWithRolesAndClaims(c controllers.Controller, path string, roles []string, claims []string, methods ...string)

func (*HttpListener) AddController

func (l *HttpListener) AddController(c controllers.Controller, path string, methods ...string)

func (*HttpListener) AddDefaultHomepage

func (l *HttpListener) AddDefaultHomepage() *HttpListener

func (*HttpListener) AddHealthCheck

func (l *HttpListener) AddHealthCheck() *HttpListener

func (*HttpListener) AddJsonContent

func (l *HttpListener) AddJsonContent() *HttpListener

func (*HttpListener) AddLogger

func (l *HttpListener) AddLogger() *HttpListener

func (*HttpListener) Probe

func (c *HttpListener) Probe() controllers.Controller

Login Generate a token for a valid user

func (*HttpListener) ShutdownHandler added in v0.0.16

func (s *HttpListener) ShutdownHandler(w http.ResponseWriter, r *http.Request)

func (*HttpListener) Start

func (l *HttpListener) Start()

func (*HttpListener) WaitAndShutdown added in v0.0.16

func (l *HttpListener) WaitAndShutdown()

func (*HttpListener) WithAuthentication added in v0.0.14

func (l *HttpListener) WithAuthentication(context interfaces.UserContextAdapter) *HttpListener

func (*HttpListener) WithDefaultAuthentication added in v0.0.14

func (l *HttpListener) WithDefaultAuthentication() *HttpListener

type HttpListenerOptions

type HttpListenerOptions struct {
	ApiPrefix               string
	HttpPort                string
	EnableTLS               bool
	TLSPort                 string
	TLSCertificate          string
	TLSPrivateKey           string
	UseAuthBackend          bool
	MongoDbConnectionString string
	DatabaseName            string
	EnableAuthentication    bool
}

Jump to

Keyboard shortcuts

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