Documentation ¶
Index ¶
- type Logger
- func (l *Logger) Debug(format string, v ...interface{})
- func (l *Logger) Error(format string, v ...interface{})
- func (l *Logger) Fatal(format string, v ...interface{})
- func (l *Logger) Info(format string, v ...interface{})
- func (l *Logger) Log(level ambient.LogLevel, format string, v ...interface{})
- func (l *Logger) Name() string
- func (l *Logger) Named(name string) ambient.AppLogger
- func (l *Logger) SetLogLevel(level ambient.LogLevel)
- func (l *Logger) Warn(format string, v ...interface{})
- type LoggerPlugin
- func (p *LoggerPlugin) Logger(appName string, appVersion string, optionalWriter io.Writer) (ambient.AppLogger, error)
- func (p *LoggerPlugin) NewLogger(appName string, appVersion string, optionalWriter io.Writer) *Logger
- func (p *LoggerPlugin) PluginName() string
- func (p *LoggerPlugin) PluginVersion() string
- type MemoryStore
- type Plugin
- type StoragePlugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger represents a logger.
func (*Logger) Debug ¶
Debug is equivalent to log.Printf() + "\n" if format is not empty. It's equivalent to Println() if format is empty.
func (*Logger) Error ¶
Error is equivalent to log.Printf() + "\n" if format is not empty. It's equivalent to Println() if format is empty.
func (*Logger) Fatal ¶
Fatal is equivalent to log.Printf() + "\n" if format is not empty. It's equivalent to Println() if format is empty. It's followed by a call to os.Exit(1).
func (*Logger) Info ¶
Info is equivalent to log.Printf() + "\n" if format is not empty. It's equivalent to Println() if format is empty.
func (*Logger) Log ¶
Log is equivalent to log.Printf() + "\n" if format is not empty. It's equivalent to Println() if format is empty.
func (*Logger) Named ¶
Named returns a new logger with the appended name, linked to the existing logger.
func (*Logger) SetLogLevel ¶
SetLogLevel will set the logger output level.
type LoggerPlugin ¶
type LoggerPlugin struct {
// contains filtered or unexported fields
}
LoggerPlugin represents an Ambient plugin.
func NewLoggerPlugin ¶
func NewLoggerPlugin(optionalWriter io.Writer) *LoggerPlugin
NewLoggerPlugin returns an Ambient plugin that provides logging using the standard logger.
func (*LoggerPlugin) Logger ¶
func (p *LoggerPlugin) Logger(appName string, appVersion string, optionalWriter io.Writer) (ambient.AppLogger, error)
Logger returns a logger.
func (*LoggerPlugin) NewLogger ¶
func (p *LoggerPlugin) NewLogger(appName string, appVersion string, optionalWriter io.Writer) *Logger
NewLogger returns a new logger with a default log level of error.
func (*LoggerPlugin) PluginName ¶
func (p *LoggerPlugin) PluginName() string
PluginName returns the plugin name.
func (*LoggerPlugin) PluginVersion ¶
func (p *LoggerPlugin) PluginVersion() string
PluginVersion returns the plugin version.
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
MemoryStore represents a file in memory.
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
NewMemoryStore returns a local filesystem object with a file path.
func (*MemoryStore) Load ¶
func (s *MemoryStore) Load() ([]byte, error)
Load returns a file contents from the filesystem.
func (*MemoryStore) Save ¶
func (s *MemoryStore) Save(b []byte) error
Save writes a file to the filesystem and returns an error if one occurs.
type Plugin ¶
type Plugin struct { *ambient.PluginBase MockGrants []ambient.GrantRequest MockRoutes func(p *ambient.PluginBase) // contains filtered or unexported fields }
Plugin represents an Ambient plugin.
func (*Plugin) GrantRequests ¶
func (p *Plugin) GrantRequests() []ambient.GrantRequest
GrantRequests returns a list of grants requested by the plugin.
func (*Plugin) PluginName ¶
PluginName returns the plugin name.
func (*Plugin) PluginVersion ¶
PluginVersion returns the plugin version.
type StoragePlugin ¶
type StoragePlugin struct{}
StoragePlugin represents an Ambient plugin.
func NewStoragePlugin ¶
func NewStoragePlugin() *StoragePlugin
NewStoragePlugin returns an Ambient plugin that provides memory storage.
func (*StoragePlugin) PluginName ¶
func (p *StoragePlugin) PluginName() string
PluginName returns the plugin name.
func (*StoragePlugin) PluginVersion ¶
func (p *StoragePlugin) PluginVersion() string
PluginVersion returns the plugin version.
func (*StoragePlugin) Storage ¶
func (p *StoragePlugin) Storage(logger ambient.Logger) (ambient.DataStorer, ambient.SessionStorer, error)
Storage returns data and session storage.