loader

package
v0.0.0-...-42df0dd Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewConfigLoader

func NewConfigLoader(cc *conf.ConsulConfig) core.ConfigLoader

func NewConsulCli

func NewConsulCli(cc *conf.ConsulConfig) *consulAPI.Client

func NewDB

func NewDB(cfg *conf.DBConfig) *gorm.DB

NewDB new db instance.

func NewStatusLoader

func NewStatusLoader(cfg *conf.DBConfig) core.StatusLoader

Types

type ConfigLoader

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

func (*ConfigLoader) AllConfigs

func (l *ConfigLoader) AllConfigs() ([]*core.Config, error)

实现 ConfigLoader 接口

func (*ConfigLoader) Config

func (l *ConfigLoader) Config(name string) (*core.Config, error)

func (*ConfigLoader) SaveConfig

func (l *ConfigLoader) SaveConfig(name string, s *core.Config) error

type Status

type Status struct {
	ID     int32  `gorm:"primaryKey"`
	Name   string `gorm:"column:name"`
	LastID int64  `gorm:"column:last_id"`
}

func (*Status) TableName

func (s *Status) TableName() string

type StatusLoader

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

func (*StatusLoader) AllStatus

func (l *StatusLoader) AllStatus() ([]*core.Status, error)

func (*StatusLoader) SaveStatus

func (l *StatusLoader) SaveStatus(name string, s *core.Status) error

func (*StatusLoader) Status

func (l *StatusLoader) Status(name string) (*core.Status, error)

Jump to

Keyboard shortcuts

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