stdlib

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCache

func NewCache() cache.Cache

NewCache will create a new instance of the built-in cache

func NewLogger

func NewLogger() logger.Logger

newBuiltinLogger will create a new instance of the mojito builtin logger implementation

Types

type BuiltinCache

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

func (*BuiltinCache) Contains

func (m *BuiltinCache) Contains(key string) (bool, error)

Contains returns whether a key is present in the cache

func (*BuiltinCache) Delete

func (m *BuiltinCache) Delete(key string) error

Delete removes a cache entry by its key, will do nothing if the key was not present in the cache It will also cancel any existing expirations for the given key

func (*BuiltinCache) ExpireAfter

func (m *BuiltinCache) ExpireAfter(key string, duration time.Duration) error

ExpireAfter will mark a cache key for expiration after a certain duration

func (*BuiltinCache) Get

func (m *BuiltinCache) Get(key string, out interface{}) error

Get will attempt to read a stored cache value into the given out interface pointer or error if not present

func (*BuiltinCache) GetOrDefault

func (m *BuiltinCache) GetOrDefault(key string, out interface{}, def interface{}) error

Get will attempt to read a stored cache value into the given out interface pointer or return default if not found

func (*BuiltinCache) Set

func (m *BuiltinCache) Set(key string, val interface{}) error

Set will attempt to store a value in the cache with a given key It will also reset any expirations set for the given key

type BuiltinLogger

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

func (*BuiltinLogger) Debug

func (z *BuiltinLogger) Debug(msg interface{})

Debug will write a debug log

func (*BuiltinLogger) Debugf

func (z *BuiltinLogger) Debugf(msg string, values ...interface{})

Debugf will write a debug log sprintf-style

func (*BuiltinLogger) Error

func (z *BuiltinLogger) Error(msg interface{})

Error will write a error log

func (*BuiltinLogger) Errorf

func (z *BuiltinLogger) Errorf(msg string, values ...interface{})

Errorf will write a error log sprintf-style

func (*BuiltinLogger) Fatal

func (z *BuiltinLogger) Fatal(msg interface{})

Fatal will write a fatal log

func (*BuiltinLogger) Fatalf

func (z *BuiltinLogger) Fatalf(msg string, values ...interface{})

Fatalf will write a fatal log sprintf-style

func (*BuiltinLogger) Field

func (z *BuiltinLogger) Field(name string, val interface{}) logger.Logger

Field will add a field to a new logger and return it

func (*BuiltinLogger) Fields

func (z *BuiltinLogger) Fields(fields logger.Fields) logger.Logger

Fields will add multiple fields to a new logger and return it

func (*BuiltinLogger) Info

func (z *BuiltinLogger) Info(msg interface{})

Info will write a info log

func (*BuiltinLogger) Infof

func (z *BuiltinLogger) Infof(msg string, values ...interface{})

Infof will write a info log sprintf-style

func (*BuiltinLogger) Trace

func (z *BuiltinLogger) Trace(msg interface{})

Trace will write a trace log

func (*BuiltinLogger) Tracef

func (z *BuiltinLogger) Tracef(msg string, values ...interface{})

Tracef will write a trace log sprintf-style

func (*BuiltinLogger) Warn

func (z *BuiltinLogger) Warn(msg interface{})

Warn will write a warn log

func (*BuiltinLogger) Warnf

func (z *BuiltinLogger) Warnf(msg string, values ...interface{})

Warnf will write a warn log sprintf-style

type BuiltinRenderer

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

func NewRenderer

func NewRenderer() *BuiltinRenderer

func (BuiltinRenderer) Render

func (b BuiltinRenderer) Render(view string, bag renderer.ViewBag) (string, error)

Render will load a template file and render the template within using the viewbag as a context

func (BuiltinRenderer) SetTemplateDir

func (b BuiltinRenderer) SetTemplateDir(path string) error

SetTemplateDir will set the base directory where views are located

func (BuiltinRenderer) TemplateDir

func (b BuiltinRenderer) TemplateDir() string

TemplateDir will return the absolute path of the configured templates directory

Jump to

Keyboard shortcuts

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