loader

package
v1.2.13 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: Zlib Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoModified = errors.New("file not modified")

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Loader
	// contains filtered or unexported fields
}

func (*Cache) WithCacheLoadFunc added in v1.1.23

func (ca *Cache) WithCacheLoadFunc(fn CacheLoadFunc) *Cache

type CacheLoadFunc added in v1.1.23

type CacheLoadFunc func(dao *dao.Dao, opt *CacheOption) error

type CacheOption added in v1.1.23

type CacheOption struct {
	Key  string
	Data Data
}

type Data

type Data interface{}

func LoadFile

func LoadFile(path string, lastModifyTime int64, decoder DecodeFunc) (int64, Data, error)

type DecodeFunc

type DecodeFunc func(v []byte) (Data, error)

type Filer

type Filer struct {
	Loader
	// contains filtered or unexported fields
}

type Http added in v0.4.6

type Http struct {
	Loader
	// contains filtered or unexported fields
}

type LoadFunc

type LoadFunc func() (Data, error)

type Loader

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

func New

func New() *Loader

func NewCache

func NewCache(key string, dao *dao.Dao, data Data) *Loader

func NewFiler

func NewFiler(path string, format string, data Data) *Loader

func NewHttp added in v0.4.6

func NewHttp(url string, data Data, headFunc commonhttp.HeaderFunc) *Loader

func (*Loader) Get

func (load *Loader) Get() Data

func (*Loader) JSON

func (load *Loader) JSON() (string, error)

func (*Loader) Read

func (load *Loader) Read() (error, bool)

func (*Loader) Reset added in v0.5.1

func (load *Loader) Reset()

func (*Loader) Stop

func (load *Loader) Stop()

func (*Loader) Update added in v0.5.1

func (load *Loader) Update(async bool)

func (*Loader) Watch

func (load *Loader) Watch()

func (*Loader) WithCmd added in v0.4.2

func (load *Loader) WithCmd(cmd string) *Loader

func (*Loader) WithFormat added in v1.0.56

func (load *Loader) WithFormat(format string) *Loader

func (*Loader) WithLoadFunc

func (load *Loader) WithLoadFunc(l LoadFunc) *Loader

func (*Loader) WithPublisher

func (load *Loader) WithPublisher(p bus.Publisher) *Loader

func (*Loader) WithSecond

func (load *Loader) WithSecond(second time.Duration) *Loader

func (*Loader) WithTopic added in v0.4.2

func (load *Loader) WithTopic(topic string) *Loader

func (*Loader) WithUnmarshal added in v1.0.56

func (load *Loader) WithUnmarshal(l coder.Unmarshal) *Loader

Jump to

Keyboard shortcuts

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