Documentation ¶
Index ¶
- Variables
- type Instances
- func (instances *Instances) All(ctx context.Context) ([]*wisski.WissKI, error)
- func (instances *Instances) Create(slug string, system models.System) (wissKI *wisski.WissKI, err error)
- func (instances *Instances) Has(ctx context.Context, slug string) (ok bool, err error)
- func (instances *Instances) Instance(ctx context.Context, instance models.Instance) *wisski.WissKI
- func (instances *Instances) IsValidSlug(slug string) (string, error)
- func (instances *Instances) Load(ctx context.Context, slugs ...string) ([]*wisski.WissKI, error)
- func (instances *Instances) Path() string
- func (instances *Instances) Update(ctx context.Context, progress io.Writer) error
- func (instances *Instances) WissKI(ctx context.Context, slug string) (wissKI *wisski.WissKI, err error)
- func (instances *Instances) WissKIs(ctx context.Context, slugs ...string) ([]*wisski.WissKI, error)
Constants ¶
This section is empty.
Variables ¶
var ErrWissKINotFound = errors.New("WissKI not found")
ErrWissKINotFound is returned when a WissKI is not found
Functions ¶
This section is empty.
Types ¶
type Instances ¶
Instances manages multiple WissKI Instances.
func (*Instances) All ¶
All returns all instances of the WissKI Distillery in consistent order.
There is no guarantee that this order remains identical between different api releases; however subsequent invocations are guaranteed to return the same order.
func (*Instances) Create ¶
func (instances *Instances) Create(slug string, system models.System) (wissKI *wisski.WissKI, err error)
Create fills the struct for a new WissKI instance. It validates that slug is a valid name for an instance.
It does not perform any checks if the instance already exists, or does the creation in the database.
func (*Instances) Has ¶
Has checks if a WissKI with the provided slug exists inside the database. It does not perform any checks on the WissKI itself.
func (*Instances) Instance ¶
Instance is a convenience function to return an instance based on a model slug. When the instance does not exist, returns nil.
func (*Instances) IsValidSlug ¶
IsValidSlug checks if slug represents a valid slug for an instance.