models

package
v0.0.0-...-c4b491b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2021 License: GPL-3.0, GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	gorm.Model
	// AccountId is the same as publisher-id and developer-id
	AccountId   string `gorm:"unique"`
	DisplayName string `gorm:"unique"`
	Username    string `gorm:"unique"`
	Keys        []Key
	SnapEntries []SnapEntry
	SSHKeys     []SSHKey
	Email       string
}

type AuthRequest

type AuthRequest struct {
	gorm.Model
}

type Key

type Key struct {
	gorm.Model
	Name             string
	SHA3384          string `gorm:"unique"`
	EncodedPublicKey string
	AccountID        uint
	Account          Account
}

type SSHKey

type SSHKey struct {
	gorm.Model
	PublicKeyString string `gorm:"unique"`
	AccountID       uint
	Account         Account
}

type Serial

type Serial struct {
	gorm.Model
	SerialUUID string
}

type SnapBranch

type SnapBranch struct {
	gorm.Model
	Name        string
	SnapRiskID  uint
	SnapEntryID uint
	SnapEntry   SnapEntry

	RevisionID uint
	Revision   SnapRevision
}

type SnapEntry

type SnapEntry struct {
	gorm.Model
	Name        string `json:"name"`
	SnapStoreID string `json:"snap-id"`
	Revisions   []SnapRevision
	Type        string
	Confinement string
	Base        string
	Uploads     []SnapUpload

	AccountID uint
	Account   Account
}

func (*SnapEntry) ToStoreSnap

func (se *SnapEntry) ToStoreSnap(snapRevision *SnapRevision) (*responses.StoreSnap, error)

type SnapRevision

type SnapRevision struct {
	gorm.Model
	SnapFilename   string
	SnapEntryID    uint
	SHA3_384       string
	SHA3384Encoded string `gorm:"column:sha3_384_encoded"`
	Size           int64
}

type SnapRisk

type SnapRisk struct {
	gorm.Model
	Name        string
	SnapTrackID uint
	SnapEntryID uint
	SnapEntry   SnapEntry

	// TODO: fix this -- currently this is monotonically incrementing across ALL revisions, it should just be a given snap
	RevisionID uint
	Revision   SnapRevision

	Branches []SnapBranch
}

type SnapTrack

type SnapTrack struct {
	gorm.Model
	Name string

	SnapEntryID uint
	SnapEntry   SnapEntry

	Risks []SnapRisk
}

type SnapUpload

type SnapUpload struct {
	gorm.Model
	Name     string
	UpDownID string
	Filesize uint
	// Channels is a comma-separated string of channels
	Channels    string
	SnapEntryID uint
	SnapEntry   SnapEntry
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL