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 ¶
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 ¶
func NewAPIConfig(name string, cors CORSConfigInterface, monitor monitoring.MonitorInterface, logger *zap.SugaredLogger) APIConfigInterface
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
Click to show internal directories.
Click to hide internal directories.