Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("generator not found")
ErrNotFound for generator.
View Source
var Module = fx.Options(fx.Provide(NewGenerators))
Module for fx.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { Name string `yaml:"name,omitempty" json:"name,omitempty" toml:"name,omitempty"` Kind string `yaml:"kind,omitempty" json:"kind,omitempty" toml:"kind,omitempty"` Prefix string `yaml:"prefix,omitempty" json:"prefix,omitempty" toml:"prefix,omitempty"` Suffix string `yaml:"suffix,omitempty" json:"suffix,omitempty" toml:"suffix,omitempty"` Separator string `yaml:"separator,omitempty" json:"separator,omitempty" toml:"separator,omitempty"` }
Application fto generate identifiers.
type Config ¶
type Config struct {
Applications []*Application `yaml:"applications,omitempty" json:"applications,omitempty" toml:"applications,omitempty"`
}
Config for generator.
func (*Config) Application ¶
func (c *Config) Application(name string) *Application
Application by name.
type Generator ¶
type Generator interface { // Generate an identifier. Generate(ctx context.Context, app *Application) (string, error) }
Generator to generate an identifier.
type Generators ¶ added in v1.10.0
Generators of identifiers.
func NewGenerators ¶ added in v1.10.0
func NewGenerators(db *mssqlx.DBs, client redis.Client) Generators
NewGenerators of identifiers.
type PG ¶ added in v1.5.0
type PG struct {
// contains filtered or unexported fields
}
PG generator.
type Redis ¶ added in v1.6.0
type Redis struct {
// contains filtered or unexported fields
}
Redis generator.
type Snowflake ¶ added in v1.7.0
type Snowflake struct {
// contains filtered or unexported fields
}
Snowflake generator.
Click to show internal directories.
Click to hide internal directories.