config

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConfig

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

APIConfig is the main configurable object for the core.API object has attributes for CORS, the monitor object (see moniotring.MonitorInterface) adn the logger

func NewAPIConfig

func NewAPIConfig(name string, cors CORSConfigInterface, tracer trace.Tracer, monitor core.MonitorInterface, logger logging.LoggerInterface) *APIConfig

NewAPIConfig returns a config object for the API object, if the logger arg is empty a new one with error level is created

func (*APIConfig) GetCORSConfig

func (c *APIConfig) GetCORSConfig() CORSConfigInterface

GetCORSConfig returns the CORS config

func (*APIConfig) GetLogger

func (c *APIConfig) GetLogger() logging.LoggerInterface

GetLogger returns the logger

func (*APIConfig) GetMonitor

func (c *APIConfig) GetMonitor() core.MonitorInterface

GetMonitor returns the monitor object

func (*APIConfig) GetServiceName

func (c *APIConfig) GetServiceName() string

GetServiceName returns the a friendly name for the service

func (*APIConfig) GetTracer added in v2.1.0

func (c *APIConfig) GetTracer() trace.Tracer

GetTracer returns the tracer object

type CORSConfig

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

CORSConfig holds the origins to be CORS-allowed

func NewCORSConfig

func NewCORSConfig(origins ...string) *CORSConfig

NewCORSConfig is the builder method to get a new CORSConfig

func (*CORSConfig) GetOrigins

func (c *CORSConfig) GetOrigins() []string

GetOrigins returns a list of allowed origins

type CORSConfigInterface

type CORSConfigInterface interface {
	GetOrigins() []string
}

Jump to

Keyboard shortcuts

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