Documentation
¶
Index ¶
- Constants
- type Entries
- type HSet
- type SeedComponent
- func (r *SeedComponent) AttachEnvironment(_ context.Context, _ *envite.Environment, writer *envite.Writer) error
- func (r *SeedComponent) Cleanup(context.Context) error
- func (r *SeedComponent) Config() any
- func (r *SeedComponent) Prepare(context.Context) error
- func (r *SeedComponent) Start(ctx context.Context) error
- func (r *SeedComponent) Status(context.Context) (envite.ComponentStatus, error)
- func (r *SeedComponent) Stop(context.Context) error
- func (r *SeedComponent) Type() string
- type SeedConfig
- type Set
Constants ¶
View Source
const ComponentType = "redis seed"
ComponentType represents the type of the redis seed component.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HSet ¶
type HSet struct {
Key string `json:"key"`
Values map[string]string `json:"values"`
TTL time.Duration `json:"ttl"`
}
HSet Represents a key-value pair to set in a redis hash.
type SeedComponent ¶
type SeedComponent struct {
// contains filtered or unexported fields
}
SeedComponent is a component for seeding redis with data.
func NewSeedComponent ¶
func NewSeedComponent(config SeedConfig) *SeedComponent
NewSeedComponent creates a new SeedComponent instance.
func (*SeedComponent) AttachEnvironment ¶
func (r *SeedComponent) AttachEnvironment(_ context.Context, _ *envite.Environment, writer *envite.Writer) error
func (*SeedComponent) Config ¶
func (r *SeedComponent) Config() any
func (*SeedComponent) Status ¶
func (r *SeedComponent) Status(context.Context) (envite.ComponentStatus, error)
func (*SeedComponent) Type ¶
func (r *SeedComponent) Type() string
type SeedConfig ¶
type SeedConfig struct {
// Address - a valid redis server address to connect to
Address string `json:"address,omitempty"`
// ClientProvider - can be used as an alternative to Address, provides a redis client to use.
// available only via code, not available in config files.
// if both ClientProvider and Address are provided, ClientProvider is used.
ClientProvider func() (*redis.Client, error) `json:"-"`
// Entries - a list of entries to set in redis
Entries *Entries `json:"entries"`
}
SeedConfig represents the configuration for the redis seed component.
Click to show internal directories.
Click to hide internal directories.