options

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Expire    time.Duration
	Serialize Serialize
}

func NewOptions

func NewOptions() *Options

func (*Options) Merge

func (o *Options) Merge(options ...*Options) *Options

func (*Options) SetExpire

func (o *Options) SetExpire(exp time.Duration) *Options

func (*Options) SetSerialize

func (o *Options) SetSerialize(serialize Serialize) *Options

type Serialize

type Serialize int
const (
	SerializeJSON Serialize = iota
	SerializeMessagePack
)

func (Serialize) Marshal

func (r Serialize) Marshal(v any) ([]byte, error)

func (Serialize) Unmarshal

func (r Serialize) Unmarshal(data []byte, v any) error

func (Serialize) Valid

func (r Serialize) Valid() bool

Jump to

Keyboard shortcuts

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