format

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package format converts key-values into query strings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

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

Format provides methods which convert the types defined in keyval into strings. The methods with an input parameter format their input into a string and append the string to an internal buffer, which can be retrieved or cleared via the String and Reset methods.

func New

func New(opts ...Option) Format

func (*Format) Bool

func (x *Format) Bool(in keyval.Bool)

Bool formats the given keyval.Bool and appends it to the internal buffer.

func (*Format) Bytes

func (x *Format) Bytes(in keyval.Bytes)

Bytes formats the given keyval.Bytes and appends it to the internal buffer.

func (*Format) Clear

func (x *Format) Clear(_ keyval.Clear)

Clear formats the given keyval.Clear and appends it to the internal buffer.

func (*Format) Directory

func (x *Format) Directory(in keyval.Directory)

Directory formats the given keyval.Directory and appends it to the internal buffer.

func (*Format) Float

func (x *Format) Float(in keyval.Float)

Float formats the given keyval.Float and appends it to the internal buffer.

func (*Format) Int

func (x *Format) Int(in keyval.Int)

Int formats the given keyval.Int and appends it to the internal buffer.

func (*Format) Key

func (x *Format) Key(in keyval.Key)

Key formats the given keyval.Key and appends it to the internal buffer.

func (*Format) KeyValue

func (x *Format) KeyValue(in keyval.KeyValue)

KeyValue formats the given keyval.KeyValue and appends it to the internal buffer.

func (*Format) MaybeMore

func (x *Format) MaybeMore(_ keyval.MaybeMore)

MaybeMore formats the given keyval.MaybeMore and appends it to the internal buffer.

func (*Format) Nil

func (x *Format) Nil(_ keyval.Nil)

Nil formats the given keyval.Nil and appends it to the internal buffer.

func (*Format) Query

func (x *Format) Query(in keyval.Query)

Query formats the given keyval.Query and appends it to the internal buffer.

func (*Format) Reset

func (x *Format) Reset()

Reset clears the contents of the internal buffer.

func (*Format) Str

func (x *Format) Str(in keyval.String)

Str formats the given keyval.String and appends it to the internal buffer.

func (*Format) String

func (x *Format) String() string

String returns the contents of the internal buffer.

func (*Format) Tuple

func (x *Format) Tuple(in keyval.Tuple)

Tuple formats the given keyval.Tuple and appends it to the internal buffer.

func (*Format) UUID

func (x *Format) UUID(in keyval.UUID)

UUID formats the given keyval.UUID and appends it to the internal buffer.

func (*Format) Uint

func (x *Format) Uint(in keyval.Uint)

Uint formats the given keyval.Uint and appends it to the internal buffer.

func (*Format) Value

func (x *Format) Value(in keyval.Value)

Value formats the given keyval.Value and appends it to the internal buffer.

func (*Format) Variable

func (x *Format) Variable(in keyval.Variable)

Variable formats the given keyval.Variable and appends it to the internal buffer.

type Option added in v0.3.0

type Option func(*Format)

func WithPrintBytes added in v0.3.0

func WithPrintBytes() Option

Jump to

Keyboard shortcuts

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