server

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CommitHash string
	BuildDate  string
)

Version information, assigned by ldflags

Functions

This section is empty.

Types

type AmazonS3Settings

type AmazonS3Settings struct {
	AccessKeyID     string
	SecretAccessKey string
	Bucket          string
	Region          string
	Endpoint        string
	Scheme          string
}

AmazonS3Settings is the configuration related to the Amazon S3.

type Config

type Config struct {
	ServiceSettings ServiceSettings
	S3Settings      AmazonS3Settings
	LogSettings     LogSettings
}

Config is the configuration for a bifrost server.

func ParseConfig

func ParseConfig(path string) (Config, error)

ParseConfig reads the config file and returns a new *Config, This method overrides values in the file if there is any environment variables corresponding to a specific setting.

type LogSettings

type LogSettings struct {
	EnableConsole bool
	ConsoleLevel  string
	ConsoleJSON   bool `json:"ConsoleJson"`
	EnableFile    bool
	FileLevel     string
	FileJSON      bool `json:"FileJson"`
	FileLocation  string
}

LogSettings is the configuration for the logger.

type Server

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

Server contains all the necessary information to run Bifrost

func New

func New(cfg Config) *Server

New creates a new Bifrost server

func (*Server) Start

func (s *Server) Start() error

Start starts the server

func (*Server) Stop

func (s *Server) Stop() error

Stop stops the server

type ServiceSettings

type ServiceSettings struct {
	Host                      string
	ServiceHost               string
	TLSCertFile               string
	TLSKeyFile                string
	MaxConnsPerHost           int
	ResponseHeaderTimeoutSecs int
	ReadTimeoutSecs           int
	WriteTimeoutSecs          int
	IdleTimeoutSecs           int
}

ServiceSettings is the configuration related to the web server.

Jump to

Keyboard shortcuts

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