model

package
v0.0.3-dev Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Err_PrefixNotFound = errors.New("prefix_not_found")
	Err_PrefixExist    = errors.New("prefix_exist")
)

Functions

func FileExists

func FileExists(filename string) bool

func GetFromEnv

func GetFromEnv(obj any) error

Types

type Config

type Config struct {
	PersistanceFile string `env:"PERSISTANCE_FILE"`

	Log log.Logger
	// contains filtered or unexported fields
}

func GetModelCfgFromEnv

func GetModelCfgFromEnv() (*Config, error)

func (*Config) Close

func (c *Config) Close() error

func (*Config) Copy

func (c *Config) Copy() cfg.ModelCfg

func (*Config) Init

func (c *Config) Init(uuid string, di di.DI) error

func (*Config) NewSerial

func (c *Config) NewSerial() SerialMgr

type ModelDI

type ModelDI interface {
	di.DI
	log.LoggerDI
}

type SerialMgr

type SerialMgr interface {
	CreateSerial(prefix string, startNumber int64) error
	UpdateSerial(prefix string, startNumber int64) error
	GetSerial(prefix string) (int64, error)
	ClearSerial(prefix string) error
	Persistance() error
}

func NewSerial

func NewSerial(cfg *Config) SerialMgr

Jump to

Keyboard shortcuts

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