ttl

package
v0.0.0-...-e27f3f3 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//stored unit types
	Empty byte = iota
	Minute
	Hour
	Day
	Week
	Month
	Year
)

Variables

View Source
var EMPTY_TTL = &TTL{}

Functions

This section is empty.

Types

type TTL

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

func LoadFromBytes

func LoadFromBytes(input []byte) (t *TTL)

read stored bytes to a ttl

func LoadFromUint32

func LoadFromUint32(ttl uint32) (t *TTL)

read stored bytes to a ttl

func ReadTTL

func ReadTTL(ttlString string) (*TTL, error)

translate a readable ttl to internal ttl Supports format example: 3m: 3 minutes 4h: 4 hours 5d: 5 days 6w: 6 weeks 7M: 7 months 8y: 8 years

func (*TTL) Minutes

func (t *TTL) Minutes() uint32

func (*TTL) String

func (t *TTL) String() string

func (*TTL) ToBytes

func (t *TTL) ToBytes(output []byte)

save stored bytes to an output with 2 bytes

func (*TTL) ToUint32

func (t *TTL) ToUint32() (output uint32)

Jump to

Keyboard shortcuts

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