systemapi

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package systemapi provides components for the System API service.

Index

Constants

This section is empty.

Variables

View Source
var DefaultLogMaxEntries = common.GetEnvInt("MAX_EVENTS", 1000)

Functions

func BasicAuth added in v0.6.0

func BasicAuth(realm, salt string, getHashedCredentials func() map[string]string) func(next http.Handler) http.Handler

BasicAuth implements a simple middleware handler for adding basic http auth to a route.

Types

type Event

type Event struct {
	ReceivedAt time.Time `json:"received_at"`
	Message    string    `json:"message"`
}

type Server

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

func NewServer

func NewServer(log *httplog.Logger, cfg *SystemAPIConfig) (server *Server, err error)

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

func (*Server) Start

func (s *Server) Start() (err error)

type SystemAPIConfig added in v0.5.0

type SystemAPIConfig struct {
	General systemAPIConfigGeneral

	Actions     map[string]string
	FileUploads map[string]string `toml:"file_uploads"`
}

func NewConfig added in v0.7.0

func NewConfig() *SystemAPIConfig

func NewConfigFromFile added in v0.7.0

func NewConfigFromFile(path string) (*SystemAPIConfig, error)

func NewConfigFromTOML added in v0.7.0

func NewConfigFromTOML(content []byte) (*SystemAPIConfig, error)

Jump to

Keyboard shortcuts

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