Documentation
¶
Index ¶
- func DeleteTestDB(ctx context.Context, log *logrus.Logger, cfg *config.Config, store Store, ...)
- func ImageBuildAPIVersion() string
- func ImageBuildsToDomain(imageBuilds []ImageBuild, cont *string, numRemaining *int64) (domain.ImageBuildList, error)
- func ImageBuildsToDomainWithOptions(imageBuilds []ImageBuild, cont *string, numRemaining *int64, ...) (domain.ImageBuildList, error)
- func ImageExportAPIVersion() string
- func ImageExportsToDomain(imageExports []ImageExport, cont *string, numRemaining *int64) (domain.ImageExportList, error)
- func TxFromContext(ctx context.Context) *gorm.DB
- func WithTx(ctx context.Context, tx *gorm.DB) context.Context
- type GetOption
- type GetOptions
- type ImageBuild
- func (i *ImageBuild) GetKind() string
- func (i *ImageBuild) GetStatusAsJson() ([]byte, error)
- func (i *ImageBuild) HasNilSpec() bool
- func (i *ImageBuild) HasSameSpecAs(otherResource any) bool
- func (i *ImageBuild) ListSelectors() selector.SelectorNameSet
- func (i *ImageBuild) ResolveSelector(name selector.SelectorName) (*selector.SelectorField, error)
- func (i ImageBuild) String() string
- func (i *ImageBuild) ToDomain(opts ...ImageBuildDomainOption) (*domain.ImageBuild, error)
- type ImageBuildDomainOption
- type ImageBuildStore
- type ImageExport
- func (i *ImageExport) GetKind() string
- func (i *ImageExport) GetStatusAsJson() ([]byte, error)
- func (i *ImageExport) HasNilSpec() bool
- func (i *ImageExport) HasSameSpecAs(otherResource any) bool
- func (i *ImageExport) ListSelectors() selector.SelectorNameSet
- func (i *ImageExport) ResolveSelector(name selector.SelectorName) (*selector.SelectorField, error)
- func (i ImageExport) String() string
- func (i *ImageExport) ToDomain() (*domain.ImageExport, error)
- type ImageExportStore
- type ListOption
- type ListOptions
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteTestDB ¶
func DeleteTestDB(ctx context.Context, log *logrus.Logger, cfg *config.Config, store Store, dbName string)
DeleteTestDB drops the test database
func ImageBuildAPIVersion ¶
func ImageBuildAPIVersion() string
func ImageBuildsToDomain ¶
func ImageBuildsToDomain(imageBuilds []ImageBuild, cont *string, numRemaining *int64) (domain.ImageBuildList, error)
func ImageBuildsToDomainWithOptions ¶
func ImageBuildsToDomainWithOptions(imageBuilds []ImageBuild, cont *string, numRemaining *int64, imageExportsMap map[string][]domain.ImageExport) (domain.ImageBuildList, error)
func ImageExportAPIVersion ¶
func ImageExportAPIVersion() string
func ImageExportsToDomain ¶
func ImageExportsToDomain(imageExports []ImageExport, cont *string, numRemaining *int64) (domain.ImageExportList, error)
func TxFromContext ¶
TxFromContext retrieves a transaction from context, or nil if none exists
Types ¶
type GetOptions ¶
type GetOptions struct {
WithExports bool
}
type ImageBuild ¶
type ImageBuild struct {
model.Resource
// The desired state, stored as opaque JSON object.
Spec *model.JSONField[domain.ImageBuildSpec] `gorm:"type:jsonb"`
// The last reported state, stored as opaque JSON object.
Status *model.JSONField[domain.ImageBuildStatus] `gorm:"type:jsonb"`
// Logs contains the last 500 lines of build logs for completed builds.
// This is separate from Status to keep the ImageBuild resource lightweight.
// Logs are only accessible via the /log endpoint.
Logs *string `gorm:"type:text"`
}
func NewImageBuildFromDomain ¶
func NewImageBuildFromDomain(resource *domain.ImageBuild) (*ImageBuild, error)
func (*ImageBuild) GetKind ¶
func (i *ImageBuild) GetKind() string
func (*ImageBuild) GetStatusAsJson ¶
func (i *ImageBuild) GetStatusAsJson() ([]byte, error)
func (*ImageBuild) HasNilSpec ¶
func (i *ImageBuild) HasNilSpec() bool
func (*ImageBuild) HasSameSpecAs ¶
func (i *ImageBuild) HasSameSpecAs(otherResource any) bool
func (*ImageBuild) ListSelectors ¶
func (i *ImageBuild) ListSelectors() selector.SelectorNameSet
ListSelectors returns all available field selectors for ImageBuild
func (*ImageBuild) ResolveSelector ¶
func (i *ImageBuild) ResolveSelector(name selector.SelectorName) (*selector.SelectorField, error)
ResolveSelector resolves a field selector name to a SelectorField for ImageBuild
func (ImageBuild) String ¶
func (i ImageBuild) String() string
func (*ImageBuild) ToDomain ¶
func (i *ImageBuild) ToDomain(opts ...ImageBuildDomainOption) (*domain.ImageBuild, error)
type ImageBuildDomainOption ¶
type ImageBuildDomainOption func(*imageBuildDomainOptions)
func WithImageExports ¶
func WithImageExports(imageExports []domain.ImageExport) ImageBuildDomainOption
type ImageBuildStore ¶
type ImageBuildStore interface {
Create(ctx context.Context, orgId uuid.UUID, imageBuild *domain.ImageBuild) (*domain.ImageBuild, error)
Get(ctx context.Context, orgId uuid.UUID, name string, opts ...GetOption) (*domain.ImageBuild, error)
List(ctx context.Context, orgId uuid.UUID, listParams flightctlstore.ListParams, opts ...ListOption) (*domain.ImageBuildList, error)
Delete(ctx context.Context, orgId uuid.UUID, name string) (*domain.ImageBuild, error)
UpdateStatus(ctx context.Context, orgId uuid.UUID, imageBuild *domain.ImageBuild) (*domain.ImageBuild, error)
UpdateLastSeen(ctx context.Context, orgId uuid.UUID, name string, timestamp time.Time) error
UpdateLogs(ctx context.Context, orgId uuid.UUID, name string, logs string) error
GetLogs(ctx context.Context, orgId uuid.UUID, name string) (string, error)
InitialMigration(ctx context.Context) error
}
ImageBuildStore is the store interface for ImageBuild resources
func NewImageBuildStore ¶
func NewImageBuildStore(db *gorm.DB, log logrus.FieldLogger) ImageBuildStore
NewImageBuildStore creates a new ImageBuild store
type ImageExport ¶
type ImageExport struct {
model.Resource
// The desired state, stored as opaque JSON object.
Spec *model.JSONField[domain.ImageExportSpec] `gorm:"type:jsonb"`
// The last reported state, stored as opaque JSON object.
Status *model.JSONField[domain.ImageExportStatus] `gorm:"type:jsonb"`
// Logs contains the last 500 lines of export logs for completed exports.
// This is separate from Status to keep the ImageExport resource lightweight.
// Logs are only accessible via the /log endpoint.
Logs *string `gorm:"type:text"`
}
ImageExport model
func NewImageExportFromDomain ¶
func NewImageExportFromDomain(resource *domain.ImageExport) (*ImageExport, error)
func (*ImageExport) GetKind ¶
func (i *ImageExport) GetKind() string
func (*ImageExport) GetStatusAsJson ¶
func (i *ImageExport) GetStatusAsJson() ([]byte, error)
func (*ImageExport) HasNilSpec ¶
func (i *ImageExport) HasNilSpec() bool
func (*ImageExport) HasSameSpecAs ¶
func (i *ImageExport) HasSameSpecAs(otherResource any) bool
func (*ImageExport) ListSelectors ¶
func (i *ImageExport) ListSelectors() selector.SelectorNameSet
ListSelectors returns all available field selectors for ImageExport
func (*ImageExport) ResolveSelector ¶
func (i *ImageExport) ResolveSelector(name selector.SelectorName) (*selector.SelectorField, error)
ResolveSelector resolves a field selector name to a SelectorField for ImageExport
func (ImageExport) String ¶
func (i ImageExport) String() string
func (*ImageExport) ToDomain ¶
func (i *ImageExport) ToDomain() (*domain.ImageExport, error)
type ImageExportStore ¶
type ImageExportStore interface {
Create(ctx context.Context, orgId uuid.UUID, imageExport *domain.ImageExport) (*domain.ImageExport, error)
Get(ctx context.Context, orgId uuid.UUID, name string) (*domain.ImageExport, error)
List(ctx context.Context, orgId uuid.UUID, listParams flightctlstore.ListParams) (*domain.ImageExportList, error)
Delete(ctx context.Context, orgId uuid.UUID, name string) (*domain.ImageExport, error)
UpdateStatus(ctx context.Context, orgId uuid.UUID, imageExport *domain.ImageExport) (*domain.ImageExport, error)
UpdateLastSeen(ctx context.Context, orgId uuid.UUID, name string, timestamp time.Time) error
UpdateLogs(ctx context.Context, orgId uuid.UUID, name string, logs string) error
GetLogs(ctx context.Context, orgId uuid.UUID, name string) (string, error)
InitialMigration(ctx context.Context) error
}
ImageExportStore is the store interface for ImageExport resources
func NewImageExportStore ¶
func NewImageExportStore(db *gorm.DB, log logrus.FieldLogger) ImageExportStore
NewImageExportStore creates a new ImageExport store
type ListOption ¶
type ListOption func(*ListOptions)
func ListWithExports ¶
func ListWithExports(val bool) ListOption
type ListOptions ¶
type ListOptions struct {
WithExports bool
}
type Store ¶
type Store interface {
ImageBuild() ImageBuildStore
ImageExport() ImageExportStore
RunMigrations(ctx context.Context) error
Ping() error
Close() error
}
Store is the imagebuilder-specific store interface