Documentation ¶
Index ¶
- Variables
- func Migrate()
- func OpenDatabase()
- type ACIv1
- func (i *ACIv1) Get(appcv1 int64, version, name string) error
- func (i *ACIv1) PutACI(appcv1, size int64, version, name, aci string) error
- func (i *ACIv1) PutManifest(appcv1 int64, version, name, manifest string) error
- func (i *ACIv1) PutSign(appcv1 int64, version, name, sign string) error
- func (i *ACIv1) TableName() string
- func (i *ACIv1) Unlocked(appcv1 int64, version, name string) error
- type AppV1
- type AppcV1
- type ArtifactV1
- type DockerImageV1
- func (i *DockerImageV1) Get(imageID string) (DockerImageV1, error)
- func (i *DockerImageV1) PutChecksum(imageID, checksum, payload string) error
- func (i *DockerImageV1) PutJSON(imageID, json string) error
- func (i *DockerImageV1) PutLayer(imageID, path string, size int64) error
- func (i *DockerImageV1) TableName() string
- type DockerImageV2
- type DockerTagV1
- type DockerTagV2
- type DockerV1
- func (r *DockerV1) Get(namespace, repository string) (DockerV1, error)
- func (r *DockerV1) GetTags(namespace, repository string) (map[string]string, error)
- func (r *DockerV1) Put(namespace, repository, json, agent string) error
- func (r *DockerV1) TableName() string
- func (r *DockerV1) Unlocked(namespace, repository string) error
- type DockerV2
- func (r *DockerV2) Get(namespace, repository string) error
- func (r *DockerV2) GetTags(namespace, repository string) ([]string, error)
- func (r *DockerV2) Put(namespace, repository string) error
- func (r *DockerV2) PutAgent(namespace, repository, agent, version string) error
- func (r *DockerV2) TableName() string
- type ImageV1
- type VirtualV1
Constants ¶
This section is empty.
Variables ¶
var (
DB *gorm.DB
)
Functions ¶
Types ¶
type ACIv1 ¶
type ACIv1 struct { ID int64 `json:"id" gorm:"primary_key"` AppcV1 int64 `json:"appc_v1" sql:"not null;default:0" gorm:"unique_index:aciv1"` Name string `json:"name" sql:"not null;type:varchar(255)" gorm:"unique_index:aciv1"` OS string `json:"os" sql:"null;type:varchar(255)"` Arch string `json:"arch" sql:"null;type:varchar(255)"` Version string `json:"version" sql:"null;type:varchar(255)"` Manifest string `json:"manifest" sql:"null;type:text"` OSS string `json:"name" sql:"null;type:text"` Path string `json:"pach" sql:"null;type:text"` Sign string `json:"sign" sql:"null;type:text"` Size int64 `json:"size" sql:"default:0"` Locked bool `json:"locked" sql:"default:false"` CreatedAt time.Time `json:"create_at" sql:""` UpdatedAt time.Time `json:"update_at" sql:""` DeletedAt *time.Time `json:"delete_at" sql:"index"` }
ACIv1 is
func (*ACIv1) PutManifest ¶
PutManifest is
type AppV1 ¶
type AppV1 struct { ID int64 `json:"id" gorm:"primary_key"` Namespace string `json:"namespace" sql:"not null;type:varchar(255)"` Repository string `json:"repository" sql:"not null;type:varchar(255)"` Short string `json:"short" sql:"null;type:text"` Description string `json:"description" sql:"null;type:text"` Manifests string `json:"manifests" sql:"null;type:text"` Keys string `json:"keys" sql:"null;type:text"` Size int64 `json:"size" sql:"default:0"` Locked bool `json:"locked" sql:"default:false"` CreatedAt time.Time `json:"create_at" sql:""` UpdatedAt time.Time `json:"update_at" sql:""` DeletedAt *time.Time `json:"delete_at" sql:"index"` }
AppV1 is the App V1 repository
func NewAppV1 ¶
NewAppV1 returns the namespace/repository, it will create the repository if it is not exist
func (*AppV1) Delete ¶
func (app *AppV1) Delete(artifact ArtifactV1) error
Delete removes an artifact from a repository
func (*AppV1) Put ¶
func (app *AppV1) Put(artifact ArtifactV1) error
Put adds an artifact to a repository
type AppcV1 ¶
type AppcV1 struct { ID int64 `json:"id" gorm:"primary_key"` Namespace string `json:"namespace" sql:"not null;type:varchar(255)" gorm:"unique_index:appcv1_repository"` Repository string `json:"repository" sql:"not null;type:varchar(255)" gorm:"unique_index:appcv1_repository"` Short string `json:"short" sql:"null;type:text"` Description string `json:"description" sql:"null;type:text"` Keys string `json:"keys" sql:"null;type:text"` Size int64 `json:"size" sql:"default:0"` CreatedAt time.Time `json:"create_at" sql:""` UpdatedAt time.Time `json:"update_at" sql:""` DeletedAt *time.Time `json:"delete_at" sql:"index"` }
AppcV1 is
type ArtifactV1 ¶
type ArtifactV1 struct { ID int64 `json:"id" gorm:"primary_key"` AppV1ID int64 `json:"app_v1_id" sql:"not null;default:0"` OS string `json:"os" sql:"null;type:varchar(255)"` Arch string `json:"arch" sql:"null;type:varchar(255)"` Type string `json:"type" sql:"null;type:varchar(255)"` App string `json:"app" sql:"not null;varchar(255)" gorm:"unique_index:app_tag"` Tag string `json:"tag" sql:"null;varchar(255)" gorm:"unique_index:app_tag"` Manifests string `json:"manifests" sql:"null;type:text"` OSS string `json:"oss" sql:"null;type:text"` EncryptMethod string `json:"encrypt" sql:"null;type:text"` // FIXME: Path is both the `URL` of the local storage and the `KEY` of the object storage Path string `json:"path" sql:"null;type:text"` Size int64 `json:"size" sql:"default:0"` Locked bool `json:"locked" sql:"default:false"` CreatedAt time.Time `json:"create_at" sql:""` UpdatedAt time.Time `json:"update_at" sql:""` DeletedAt *time.Time `json:"delete_at" sql:"index"` }
ArtifactV1 is the Artifcat V1 object
func (*ArtifactV1) Get ¶
func (a *ArtifactV1) Get() (ArtifactV1, error)
Get gets full info by os/arch/app/tag
func (*ArtifactV1) GetName ¶
func (a *ArtifactV1) GetName() string
func (*ArtifactV1) TableName ¶
func (*ArtifactV1) TableName() string
TableName returns the name of ArtifactV1 table in mysql
type DockerImageV1 ¶
type DockerImageV1 struct { ID int64 `json:"id" gorm:"primary_key"` ImageID string `json:"image_id" sql:"not null;unique;varchar(255)"` JSON string `json:"json" sql:"null;type:text"` Ancestry string `json:"ancestry" sql:"null;type:text"` Checksum string `json:"checksum" sql:"null;type:varchar(255)"` Payload string `json:"payload" sql:"null;type:varchar(255)"` Path string `json:"path" sql:"null;type:text"` OSS string `json:"oss" sql:"null;type:text"` Size int64 `json:"size" sql:"default:0"` Uploaded bool `json:"uploaded" sql:"default:false"` Checksumed bool `json:"checksumed" sql:"default:false"` Locked bool `json:"locked" sql:"default:false"` CreatedAt time.Time `json:"create_at" sql:""` UpdatedAt time.Time `json:"update_at" sql:""` DeletedAt *time.Time `json:"delete_at" sql:"index"` }
DockerImageV1 is
func (*DockerImageV1) Get ¶
func (i *DockerImageV1) Get(imageID string) (DockerImageV1, error)
Get is search image by ImageID.
func (*DockerImageV1) PutChecksum ¶
func (i *DockerImageV1) PutChecksum(imageID, checksum, payload string) error
PutChecksum is put image's checksum, payload and ancestry.
func (*DockerImageV1) PutJSON ¶
func (i *DockerImageV1) PutJSON(imageID, json string) error
PutJSON is put image json by ImageID.
func (*DockerImageV1) PutLayer ¶
func (i *DockerImageV1) PutLayer(imageID, path string, size int64) error
PutLayer is put image layer, path, uploaded and size.
func (*DockerImageV1) TableName ¶
func (i *DockerImageV1) TableName() string
TableName in mysql is "docker_image_v1".
type DockerImageV2 ¶
type DockerImageV2 struct { ID int64 `json:"id" gorm:"primary_key"` ImageID string `json:"image_id" sql:"null;type:varchar(255)"` BlobSum string `json:"blob_sum" sql:"null;type:varchar(255)"` V1Compatibility string `json:"v1_compatibility" sql:"null;type:text"` Path string `json:"path" sql:"null;type:text"` OSS string `json:"oss" sql:"null;type:text"` Size int64 `json:"size" sql:"default:0"` Locked bool `json:"locked" sql:"default:false"` CreatedAt time.Time `json:"create_at" sql:""` UpdatedAt time.Time `json:"update_at" sql:""` DeletedAt *time.Time `json:"delete_at" sql:"index"` }
DockerImageV2 is
type DockerTagV1 ¶
type DockerTagV1 struct { ID int64 `json:"id" gorm:"primary_key"` DockerV1 int64 `json:"docker_v1" sql:"not null;default:0"` Tag string `json:"tag" sql:"not null;varchar(255)"` ImageID string `json:"image_id" sql:"not null;varchar(255)"` CreatedAt time.Time `json:"create_at" sql:""` UpdatedAt time.Time `json:"update_at" sql:""` DeletedAt *time.Time `json:"delete_at" sql:"index"` }
DockerTagV1 is
func (*DockerTagV1) Put ¶
func (t *DockerTagV1) Put(imageID, tag, namespace, repository string) error
Put is set tag in the database.
func (*DockerTagV1) TableName ¶
func (t *DockerTagV1) TableName() string
TableName in mysql is "docker_tag_v1".
type DockerTagV2 ¶
type DockerTagV2 struct { ID int64 `json:"id" gorm:"primary_key"` DockerV2 int64 `json:"docker_v2" sql:"not null;default:0"` Tag string `json:"tag" sql:"not null;type:varchar(255)"` ImageID string `json:"image_id" sql:"not null;type:varchar(255)"` Manifest string `json:"manifest" sql:"null;type:text"` SchemaVersion string `json:"schema_version" sql:"not null;type:varchar(255)"` CreatedAt time.Time `json:"create_at" sql:""` UpdatedAt time.Time `json:"update_at" sql:""` DeletedAt *time.Time `json:"delete_at" sql:"index"` }
DockerTagV2 is
func (*DockerTagV2) Get ¶
func (t *DockerTagV2) Get(namespace, repository, tag string) (*DockerTagV2, error)
Get is get DockerTagV2 data
func (*DockerTagV2) Put ¶
func (t *DockerTagV2) Put(namespace, repository, tag, imageID, manifest, schema string) error
Put is
type DockerV1 ¶
type DockerV1 struct { ID int64 `json:"id" gorm:"primary_key"` Namespace string `json:"namespace" sql:"not null;type:varchar(255)" gorm:"unique_index:dockerv1_repository"` Repository string `json:"repository" sql:"not null;type:varchar(255)" gorm:"unique_index:dockerv1_repository"` JSON string `json:"json" sql:"null;type:text"` Manifests string `json:"manifests" sql:"null;type:text"` Agent string `json:"agent" sql:"null;type:text"` Short string `json:"short" sql:"null;type:text"` Description string `json:"description" sql:"null;type:text"` Size int64 `json:"size" sql:"default:0"` Locked bool `json:"locked" sql:"default:false"` //When create/update the repository, the locked will be true. CreatedAt time.Time `json:"create_at" sql:""` UpdatedAt time.Time `json:"update_at" sql:""` DeletedAt *time.Time `json:"delete_at" sql:"index"` }
DockerV1 is Docker Repository V1 repository.
type DockerV2 ¶
type DockerV2 struct { ID int64 `json:"id" gorm:"primary_key"` Namespace string `json:"namespace" sql:"not null;type:varchar(255)" gorm:"unique_index:dockerv2_repository"` Repository string `json:"repository" sql:"not null;type:varchar(255)" gorm:"unique_index:dockerv2_repository"` SchemaVersion string `json:"schema_version" sql:"not null;type:varchar(255)"` Manifests string `json:"manifests" sql:"null;type:text"` Agent string `json:"agent" sql:"null;type:text"` Short string `json:"short" sql:"null;type:text"` Description string `json:"description" sql:"null;type:text"` Size int64 `json:"size" sql:"default:0"` Locked bool `json:"locked" sql:"default:false"` CreatedAt time.Time `json:"create_at" sql:""` UpdatedAt time.Time `json:"update_at" sql:""` DeletedAt *time.Time `json:"delete_at" sql:"index"` }
DockerV2
type ImageV1 ¶
type ImageV1 struct { ID int64 `json:"id" gorm:"primary_key"` Namespace string `json:"namespace" sql:"not null;type:varchar(255)"` Repository string `json:"repository" sql:"not null;type:varchar(255)"` Short string `json:"short" sql:"null;type:text"` Description string `json:"description" sql:"null;type:text"` Manifests string `json:"manifests" sql:"null;type:text"` Type string `json:"type" sql:"not null;type:varchar(255)"` Keys string `json:"keys" sql:"null;type:text"` Size int64 `json:"size" sql:"default:0"` Locked bool `json:"locked" sql:"default:false"` CreatedAt time.Time `json:"create_at" sql:""` UpdatedAt time.Time `json:"update_at" sql:""` DeletedAt *time.Time `json:"delete_at" sql:"index"` }
type VirtualV1 ¶
type VirtualV1 struct { ID int64 `json:"id" gorm:"primary_key"` ImageV1 int64 `json:"image_v1" sql:"not null"` OS string `json:"os" sql:"null;type:varchar(255)"` Arch string `json:"arch" sql:"null;type:varchar(255)"` Image string `json:"image" sql:"not null;varchar(255)" gorm:"unique_index:image_tag"` Tag string `json:"tag" sql:"null;varchar(255)" gorm:"unique_index:image_tag"` Manifests string `json:"manifests" sql:"null;type:text"` OSS string `json:"oss" sql:"null;type:text"` Path string `json:"arch" sql:"null;type:text"` Size int64 `json:"size" sql:"default:0"` Locked bool `json:"locked" sql:"default:false"` CreatedAt time.Time `json:"create_at" sql:""` UpdatedAt time.Time `json:"update_at" sql:""` DeletedAt *time.Time `json:"delete_at" sql:"index"` }