pool

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Question represents a '?' placeholder parameter.
	Question = iota
	// Dollar represents a '$1', '$2'... placeholder parameters.
	Dollar
	// AtMark represents a '@1', '@2'... placeholder parameters.
	AtMark
)

These variables are the same as defined variables at sqb.go.

Variables

This section is empty.

Functions

func Put

func Put(b *Builder)

Put saves used Builder; avoids an allocation per invocation.

Types

type Buffer

type Buffer interface {
	Reset()
	Cap() int
	WriteString(string) (int, error)
	String() string
}

Buffer is the interface that wraps the basic Reset, Cap and WriteString method.

type Builder

type Builder struct {
	Placeholder int
	// contains filtered or unexported fields
}

Builder is the interface that wraps the basic Reset, Cap and WriteString method.

func Get

func Get() *Builder

Get allocates a new strings.Builder or grabs a cached one.

func (*Builder) AppendArgs

func (b *Builder) AppendArgs(args ...interface{})

AppendArgs appends the args.

func (*Builder) Args

func (b *Builder) Args() []interface{}

Args return appended args.

func (*Builder) Reset

func (b *Builder) Reset()

Reset resets Builder.

func (*Builder) String

func (b *Builder) String() string

String returns appended the contents.

func (*Builder) WritePlaceholder added in v0.0.2

func (b *Builder) WritePlaceholder()

WritePlaceholder writes placeholder.

func (*Builder) WriteString

func (b *Builder) WriteString(s string)

WriteString appends the contents of s to Buffer. Builder.buf.WriteString doesn't have the potential to return an error. But have the potential to panic.

strings.Builder https://golang.org/src/strings/builder.go?s=3425:3477#L110

bytes.Buffer https://golang.org/pkg/bytes/#Buffer.WriteString

Jump to

Keyboard shortcuts

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