Documentation ¶
Index ¶
- Constants
- Variables
- func JSON(filename string, data interface{}) error
- func XML(filename string, data interface{}) error
- func YAML(filename string, data interface{}) error
- type Cache
- type CacheLoadFunc
- type CacheOption
- type Filer
- type Http
- type LoadFunc
- type Loader
- func (load *Loader) Data() interface{}
- func (load *Loader) Get() interface{}deprecated
- func (load *Loader) JSON() (string, error)
- func (load *Loader) Read() (error, bool)
- func (load *Loader) Reset()
- func (load *Loader) Stop()
- func (load *Loader) Update(async bool)
- func (load *Loader) Watch()
- func (load *Loader) WatchChan() <-chan bool
- func (load *Loader) WithCmd(cmd string) *Loader
- func (load *Loader) WithFormat(format string) *Loader
- func (load *Loader) WithLoadFunc(l LoadFunc) *Loader
- func (load *Loader) WithPublisher(p bus.Publisher) *Loader
- func (load *Loader) WithSecond(second time.Duration) *Loader
- func (load *Loader) WithTopic(topic string) *Loader
- func (load *Loader) WithUnmarshal(l coder.Unmarshal) *Loader
- func (load *Loader) XML() (string, error)
- func (load *Loader) YAML() (string, error)
Constants ¶
View Source
const ( JsonFormat = "json" XmlFormat = "xml" YamlFormat = "yaml" )
Variables ¶
View Source
var ErrNotDefined = errors.New("not defined")
Functions ¶
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 interface{} }
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
func CreateLoader ¶ added in v1.3.23
func CreateLoader() Loader
func NewHttp ¶ added in v0.4.6
func NewHttp(url string, data interface{}, headFunc commonhttp.HeaderFunc) *Loader
func (*Loader) WithFormat ¶ added in v1.0.56
func (*Loader) WithLoadFunc ¶
func (*Loader) WithUnmarshal ¶ added in v1.0.56
Click to show internal directories.
Click to hide internal directories.