Documentation
¶
Index ¶
- func Close(db *bun.DB)
- func Connect(dsn string) *bun.DB
- func NewCommand(migrator *migrate.Migrator) *cli.Command
- type App
- type Client
- type ClientToGroup
- type DbCatalogStore
- func (store *DbCatalogStore) FetchReleases(filter catalog.Filter, limit int) ([]*catalog.Release, error)
- func (store *DbCatalogStore) FindApp(vendor string, product string) (*catalog.App, error)
- func (store *DbCatalogStore) LatestReleases(limit int) ([]*catalog.Release, error)
- func (store *DbCatalogStore) ListApps(limit int) ([]*catalog.App, error)
- func (store *DbCatalogStore) ListGroups(filter catalog.GroupFilter, limit int) ([]*catalog.Group, error)
- func (store *DbCatalogStore) ListVariants(filter catalog.VariantFilter, limit int) ([]*catalog.Variant, error)
- func (store *DbCatalogStore) RegisterClient(app *catalog.App, variant string, groups []string) (*catalog.Client, error)
- func (store *DbCatalogStore) SetAppDefaultGroups(app *catalog.App) (*catalog.App, error)
- func (store *DbCatalogStore) SetCriticality(filter catalog.Filter, criticality catalog.Criticality) ([]*catalog.Release, error)
- func (store *DbCatalogStore) SetStability(filter catalog.Filter, stability bool) ([]*catalog.Release, error)
- func (store *DbCatalogStore) SetUpgradeTarget(filter catalog.Filter, target catalog.UpgradeTarget) ([]*catalog.Release, error)
- func (store *DbCatalogStore) StoreApp(app *catalog.App, allowUpdate bool) (*catalog.App, error)
- func (store *DbCatalogStore) StoreGroup(group *catalog.Group, allowUpdate bool) (*catalog.Group, error)
- func (store *DbCatalogStore) StoreRelease(release *catalog.Release, allowUpdate bool) (*catalog.Release, error)
- func (store *DbCatalogStore) StoreVariant(variant *catalog.Variant, allowUpdate bool) (*catalog.Variant, error)
- type Group
- type Release
- type ReleaseToGroup
- type Variant
- type VariantToDefaultGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct { bun.BaseModel `bun:"table:apps"` Id int64 `bun:"id,pk,autoincrement"` Vendor string `bun:"vendor"` Product string `bun:"product"` Name string `bun:"name"` Active bool `bun:"active,default:true"` Locked bool `bun:"locked,default:false"` AllowRegister bool `bun:"allow_register,default:true"` UpgradeTarget string `bun:"upgrade_target"` // If empty, the default upgrade target will be used CreatedAt time.Time `bun:"created_at"` UpdatedAt time.Time `bun:"updated_at"` Groups []Group `bun:"rel:has-many,join:id=app_id"` Variants []Variant `bun:"rel:has-many,join:id=app_id"` }
func FromCatalogApp ¶
func (*App) GetDefaultGroups ¶
func (*App) ToCatalogApp ¶
type Client ¶
type Client struct { bun.BaseModel `bun:"table:clients"` Id int64 `bun:"id,pk,autoincrement"` AppId int64 `bun:"app_id"` App *App `bun:"rel:belongs-to,join:app_id=id"` Variant string `bun:"variant"` // will be enforced when fetching releases Uuid string `bun:"uuid"` Name string `bun:"name"` Active bool `bun:"active,default:true"` Locked bool `bun:"locked,default:false"` CreatedAt time.Time `bun:"created_at"` UpdatedAt time.Time `bun:"updated_at"` Groups []Group `bun:"m2m:clients_groups,join:Client=Group"` }
func (*Client) ToCatalogClient ¶
type ClientToGroup ¶
type ClientToGroup struct { bun.BaseModel `bun:"table:clients_groups"` Id int64 `bun:"id,pk,autoincrement"` ClientId int64 `bun:"client_id"` Client *Client `bun:"rel:belongs-to,join:client_id=id"` GroupId int64 `bun:"group_id"` Group *Group `bun:"rel:belongs-to,join:group_id=id"` CreatedAt time.Time `bun:"created_at"` UpdatedAt time.Time `bun:"updated_at"` }
type DbCatalogStore ¶
type DbCatalogStore struct {
// contains filtered or unexported fields
}
func NewDbCatalogStore ¶
func NewDbCatalogStore(db *bun.DB, ctx context.Context) *DbCatalogStore
func (*DbCatalogStore) FetchReleases ¶
func (*DbCatalogStore) LatestReleases ¶
func (store *DbCatalogStore) LatestReleases(limit int) ([]*catalog.Release, error)
func (*DbCatalogStore) ListApps ¶
func (store *DbCatalogStore) ListApps(limit int) ([]*catalog.App, error)
func (*DbCatalogStore) ListGroups ¶
func (store *DbCatalogStore) ListGroups(filter catalog.GroupFilter, limit int) ([]*catalog.Group, error)
func (*DbCatalogStore) ListVariants ¶
func (store *DbCatalogStore) ListVariants(filter catalog.VariantFilter, limit int) ([]*catalog.Variant, error)
func (*DbCatalogStore) RegisterClient ¶
func (*DbCatalogStore) SetAppDefaultGroups ¶
func (*DbCatalogStore) SetCriticality ¶
func (store *DbCatalogStore) SetCriticality(filter catalog.Filter, criticality catalog.Criticality) ([]*catalog.Release, error)
func (*DbCatalogStore) SetStability ¶
func (*DbCatalogStore) SetUpgradeTarget ¶
func (store *DbCatalogStore) SetUpgradeTarget(filter catalog.Filter, target catalog.UpgradeTarget) ([]*catalog.Release, error)
func (*DbCatalogStore) StoreGroup ¶
func (*DbCatalogStore) StoreRelease ¶
func (*DbCatalogStore) StoreVariant ¶
type Group ¶
type Group struct { bun.BaseModel `bun:"table:groups"` Id int64 `bun:"id,pk,autoincrement"` AppId int64 `bun:"app_id"` App *App `bun:"rel:belongs-to,join:app_id=id"` Name string `bun:"name"` Default bool `bun:"default"` CreatedAt time.Time `bun:"created_at"` UpdatedAt time.Time `bun:"updated_at"` }
func FromCatalogGroup ¶
func (*Group) ToCatalogGroup ¶
type Release ¶
type Release struct { bun.BaseModel `bun:"table:releases"` Id int64 `bun:"id,pk,autoincrement"` AppId int64 `bun:"app_id"` App *App `bun:"rel:belongs-to,join:app_id=id"` Variant string `bun:"variant"` Description string `bun:"description"` OS string `bun:"os"` Arch string `bun:"arch"` ReleasedAt time.Time `bun:"released_at"` Version string `bun:"version"` Unstable bool `bun:"unstable"` Alias string `bun:"alias"` Link string `bun:"link"` Format string `bun:"format"` Signature string `bun:"signature"` // a cryptographical representation (hash etc) Tags []string `bun:"tags,array"` UpgradeTarget string `bun:"upgrade_target"` // If empty, the default upgrade target will be used ShouldUpgrade int `bun:"should_upgrade"` UpdatedAt time.Time `bun:"updated_at"` Groups []Group `bun:"m2m:releases_groups,join:Release=Group"` }
func FromCatalogRelease ¶
func (*Release) ToCatalogRelease ¶
type ReleaseToGroup ¶
type ReleaseToGroup struct { bun.BaseModel `bun:"table:releases_groups"` Id int64 `bun:"id,pk,autoincrement"` ReleaseId int64 `bun:"release_id"` Release *Release `bun:"rel:belongs-to,join:release_id=id"` GroupId int64 `bun:"group_id"` Group *Group `bun:"rel:belongs-to,join:group_id=id"` CreatedAt time.Time `bun:"created_at"` UpdatedAt time.Time `bun:"updated_at"` }
type Variant ¶
type Variant struct { bun.BaseModel `bun:"table:variants"` Id int64 `bun:"id,pk,autoincrement"` AppId int64 `bun:"app_id"` App *App `bun:"rel:belongs-to,join:app_id=id"` Name string `bun:"name"` Active bool `bun:"active,default:true"` Locked bool `bun:"locked,default:false"` AllowRegister bool `bun:"allow_register,default:true"` UpgradeTarget string `bun:"upgrade_target"` // If empty, the default upgrade target will be used CreatedAt time.Time `bun:"created_at"` UpdatedAt time.Time `bun:"updated_at"` Groups []Group `bun:"m2m:variants_default_groups,join:Variant=Group"` }
func FromCatalogVariant ¶
func (*Variant) ToCatalogVariant ¶
type VariantToDefaultGroup ¶
type VariantToDefaultGroup struct { bun.BaseModel `bun:"table:variants_default_groups"` Id int64 `bun:"id,pk,autoincrement"` VariantId int64 `bun:"variant_id"` Variant *Variant `bun:"rel:belongs-to,join:variant_id=id"` GroupId int64 `bun:"group_id"` Group *Group `bun:"rel:belongs-to,join:group_id=id"` CreatedAt time.Time `bun:"created_at"` UpdatedAt time.Time `bun:"updated_at"` }
Click to show internal directories.
Click to hide internal directories.