Documentation ¶
Index ¶
- type Builder
- func (b *Builder) Absolute() bool
- func (b *Builder) Append(p []byte)
- func (b *Builder) AppendString(path string)
- func (b *Builder) Bytes() []byte
- func (b *Builder) Cap() int
- func (b *Builder) Clean(path string) string
- func (b *Builder) Guarantee(size int)
- func (b *Builder) Join(base string, paths ...string) string
- func (b *Builder) Len() int
- func (b *Builder) Reset()
- func (b *Builder) SetAbsolute(val bool)
- func (b *Builder) String() string
- func (b *Builder) StringPtr() string
- func (b *Builder) Truncate(size int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct { B []byte // B is the underlying byte buffer // contains filtered or unexported fields }
func NewBuilder ¶
NewBuilder returns a new Builder object using the supplied byte slice as the underlying buffer
func (*Builder) Append ¶
Append adds and cleans the supplied path bytes to the builder's internal buffer, growing the buffer if necessary to accomodate the extra path length
func (*Builder) AppendString ¶
AppendString adds and cleans the supplied path string to the builder's internal buffer, growing the buffer if necessary to accomodate the extra path length
func (*Builder) Clean ¶
Clean creates the shortest possible functional equivalent to the supplied path, resetting the builder before performing this operation. The builder object is NOT reset after return
func (*Builder) Guarantee ¶
Guarantee ensures there is at least the requested size free bytes available in the buffer, reallocating if necessary
func (*Builder) Join ¶
Join connects and cleans multiple paths, resetting the builder before performing this operation and returning the shortest possible combination of all the supplied paths. The builder object is NOT reset after return
func (*Builder) SetAbsolute ¶
SetAbsolute converts the current path to / from absolute