config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2021 License: MIT Imports: 3 Imported by: 0

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 (*APIConfig) GetCORSConfig

func (c *APIConfig) GetCORSConfig() CORSConfigInterface

GetCORSConfig returns the CORS config

func (*APIConfig) GetLogger

func (c *APIConfig) GetLogger() *zap.SugaredLogger

GetLogger returns the logger

func (*APIConfig) GetMonitor

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

GetMonitor returns the monitor object

func (*APIConfig) GetServiceName

func (c *APIConfig) GetServiceName() string

GetServiceName returns the a friendly name for the service

type APIConfigInterface

type APIConfigInterface interface {
	GetServiceName() string
	GetMonitor() monitoring.MonitorInterface
	GetCORSConfig() CORSConfigInterface
	GetLogger() *zap.SugaredLogger
}

func NewAPIConfig

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

type CORSConfig

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

CORSConfig holds the origins to be CORS-allowed

func (*CORSConfig) GetOrigins

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

GetOrigins returns a list of allowed origins

type CORSConfigInterface

type CORSConfigInterface interface {
	GetOrigins() []string
}

func NewCORSConfig

func NewCORSConfig(origins ...string) CORSConfigInterface

NewCORSConfig is the builder method to get a new CORSConfig

Jump to

Keyboard shortcuts

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