Documentation ¶
Index ¶
- func Format(format string, context Context) (string, error)
- func Formatf(format string, data func(string) string) string
- func Formatg(format string, data interface{}) string
- func Formatm(format string, data Values) string
- func Formatp(format string, a ...interface{}) string
- type Context
- type ContextBuilder
- func (c *ContextBuilder) Add(name string, value interface{}) *ContextBuilder
- func (c *ContextBuilder) AddFloat32(name string, value float32) *ContextBuilder
- func (c *ContextBuilder) AddFloat64(name string, value float64) *ContextBuilder
- func (c *ContextBuilder) AddFormatter(name string, formatter Formatter) *ContextBuilder
- func (c *ContextBuilder) AddInt(name string, value int) *ContextBuilder
- func (c *ContextBuilder) AddInt16(name string, value int16) *ContextBuilder
- func (c *ContextBuilder) AddInt32(name string, value int32) *ContextBuilder
- func (c *ContextBuilder) AddInt64(name string, value int64) *ContextBuilder
- func (c *ContextBuilder) AddInt8(name string, value int8) *ContextBuilder
- func (c *ContextBuilder) AddString(name, value string) *ContextBuilder
- func (c *ContextBuilder) AddTime(name string, datetime time.Time) *ContextBuilder
- func (c *ContextBuilder) AddUint(name string, value uint) *ContextBuilder
- func (c *ContextBuilder) AddUint16(name string, value uint16) *ContextBuilder
- func (c *ContextBuilder) AddUint32(name string, value uint32) *ContextBuilder
- func (c *ContextBuilder) AddUint64(name string, value uint64) *ContextBuilder
- func (c *ContextBuilder) AddUint8(name string, value uint8) *ContextBuilder
- func (c *ContextBuilder) AddValue(name string, value interface{}) *ContextBuilder
- func (c *ContextBuilder) Build() (Context, error)
- type Formatter
- type Splitter
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Formatf ¶
Formatf is a formatting where values are taken form given func(string) string function
Types ¶
type ContextBuilder ¶
type ContextBuilder struct {
// contains filtered or unexported fields
}
ContextBuilder formatting context builder
func (*ContextBuilder) Add ¶
func (c *ContextBuilder) Add(name string, value interface{}) *ContextBuilder
Add adds formatter with type guessing
func (*ContextBuilder) AddFloat32 ¶
func (c *ContextBuilder) AddFloat32(name string, value float32) *ContextBuilder
AddFloat adds floating point number formatter
func (*ContextBuilder) AddFloat64 ¶
func (c *ContextBuilder) AddFloat64(name string, value float64) *ContextBuilder
AddFloat adds floating point number formatter
func (*ContextBuilder) AddFormatter ¶
func (c *ContextBuilder) AddFormatter(name string, formatter Formatter) *ContextBuilder
AddFormatter ...
func (*ContextBuilder) AddInt ¶
func (c *ContextBuilder) AddInt(name string, value int) *ContextBuilder
AddInt adds int formatter
func (*ContextBuilder) AddInt16 ¶
func (c *ContextBuilder) AddInt16(name string, value int16) *ContextBuilder
AddInt16 adds int16 formatter
func (*ContextBuilder) AddInt32 ¶
func (c *ContextBuilder) AddInt32(name string, value int32) *ContextBuilder
AddInt32 adds int32 formatter
func (*ContextBuilder) AddInt64 ¶
func (c *ContextBuilder) AddInt64(name string, value int64) *ContextBuilder
AddInt64 adds int64 formatter
func (*ContextBuilder) AddInt8 ¶
func (c *ContextBuilder) AddInt8(name string, value int8) *ContextBuilder
AddInt8 adds int8 formatter
func (*ContextBuilder) AddString ¶
func (c *ContextBuilder) AddString(name, value string) *ContextBuilder
AddString adds string formatter
func (*ContextBuilder) AddTime ¶
func (c *ContextBuilder) AddTime(name string, datetime time.Time) *ContextBuilder
AddTime adds time formatter
func (*ContextBuilder) AddUint ¶
func (c *ContextBuilder) AddUint(name string, value uint) *ContextBuilder
AddUint adds uint formatter
func (*ContextBuilder) AddUint16 ¶
func (c *ContextBuilder) AddUint16(name string, value uint16) *ContextBuilder
AddUint16 adds uint16 formatter
func (*ContextBuilder) AddUint32 ¶
func (c *ContextBuilder) AddUint32(name string, value uint32) *ContextBuilder
AddUint32 adds uint32 formatter
func (*ContextBuilder) AddUint64 ¶
func (c *ContextBuilder) AddUint64(name string, value uint64) *ContextBuilder
AddUint64 adds uint64 formatter
func (*ContextBuilder) AddUint8 ¶
func (c *ContextBuilder) AddUint8(name string, value uint8) *ContextBuilder
AddUint8 adds uint8 formatter
func (*ContextBuilder) AddValue ¶
func (c *ContextBuilder) AddValue(name string, value interface{}) *ContextBuilder
AddValue adds formatter to format it as %...v
func (*ContextBuilder) Build ¶
func (c *ContextBuilder) Build() (Context, error)
Build retrieves context object from the builder