config

package
v0.0.0-...-9b50a1c Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (

	//AccessLog is the access log file name
	AccessLog = "access.log"
	//AppLog is the application log file name
	AppLog = "authenvoy.log"
	//EventLog is the event log file name
	EventLog = "event.log"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port     int
	LogPath  string
	Loggers  Loggers
	KRB5Conf *config.Config
}

Config holds the application's configuration values and loggers.

func New

func New(port int, krbconf, lp string) (*Config, error)

New returns a new Config instance.

func (Config) AccessLog

func (c Config) AccessLog(v interface{})

AccessLog write the value provided to the access log.

func (Config) ApplicationLogf

func (c Config) ApplicationLogf(format string, v ...interface{})

ApplicationLogf formats according to a format specifier and writes the value to the application log.

func (*Config) EventLog

func (c *Config) EventLog(v interface{})

EventLog write the value provided to the access log.

func (*Config) SetAccessLog

func (c *Config) SetAccessLog(p string) error

SetAccessLog sets the access log to the file path specified. The following values special values can be used:

stdout

stderr

null - discard log lines

func (*Config) SetAccessLogWriter

func (c *Config) SetAccessLogWriter(e *json.Encoder) *Config

SetAccessLogWriter sets the access log lines to be written to the JSON encoder provided.

func (*Config) SetApplicationLog

func (c *Config) SetApplicationLog(p string) error

SetApplicationLog sets the application log to the file path specified. The following values special values can be used:

stdout

stderr

null - discard log lines

func (*Config) SetApplicationLogWriter

func (c *Config) SetApplicationLogWriter(l *log.Logger) *Config

SetApplicationLogWriter sets the application log lines to be written to the Logger provided.

func (*Config) SetEventLog

func (c *Config) SetEventLog(p string) error

SetEventLog sets the access log to the file path specified. The following values special values can be used:

stdout

stderr

null - discard log lines

func (*Config) SetEventLogWriter

func (c *Config) SetEventLogWriter(e *json.Encoder) *Config

SetEventLogWriter sets the event log lines to be written to the JSON encoder provided.

type Loggers

type Loggers struct {
	Event             string        `json:"Event"`
	EventWriter       *json.Encoder `json:"-"`
	Application       string        `json:"Application"`
	ApplicationWriter *log.Logger   `json:"-"`
	Access            string        `json:"Access"`
	AccessWriter      *json.Encoder `json:"-"`
}

Loggers holds the logging configuration for the application.

Jump to

Keyboard shortcuts

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