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 ¶
GetServiceName returns the a friendly name for the service
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
}
Click to show internal directories.
Click to hide internal directories.