models

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package models defines all models used within the application. It knows nothing about databases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken added in v0.9.1

type AccessToken struct {
	ID     uint   `json:"id"`
	UserID uint   `json:"user_id"`
	Token  string `json:"token"`
	Name   string `json:"name"`
}

AccessToken allows API access

type AddBuildToRepositoryInput added in v0.17.0

type AddBuildToRepositoryInput struct {
	RepositoryName string
	Distribution   string
}

AddBuildToRepositoryInput is the json input for the AddBuildToRepository job type

type ArchiveUpgrade added in v0.11.0

type ArchiveUpgrade struct {
	ID           uint `json:"id"`
	UserID       uint `json:"user_id"`
	PackageCount int  `json:"package_count"`
}

ArchiveUpgrade is an upgrade of all source packages in the archive to a newer upstream version

func (*ArchiveUpgrade) RepositoryName added in v0.13.0

func (archiveUpgrade *ArchiveUpgrade) RepositoryName() string

RepositoryName is the ArchiveUpgrade's Aptly repository name

type Artifact added in v0.10.1

type Artifact struct {
	ID       uint   `json:"id"`
	JobID    uint   `json:"job_id"`
	Filename string `json:"filename"`
}

Artifact is part of the result of a job

type FileUpload added in v0.4.0

type FileUpload struct {
	ID         uint      `json:"id"`
	Filename   string    `json:"filename"`
	SHA256Sum  string    `json:"sha256sum"`
	UploadedAt time.Time `json:"uploaded_at"`
	Completed  bool      `json:"completed"`
	UploadID   uint      `json:"upload_id"`
}

FileUpload is an individual file that was uploaded

type Job

type Job struct {
	ID     uint      `json:"id"`
	Type   JobType   `json:"type"`
	Status JobStatus `json:"status"`

	// Jobs can be created in the context of:
	//  - An Upload
	//  - An Archive Rebuild
	// The id of the job's ultimate parent is propagated
	// to all child jobs.
	ParentID   uint          `json:"parent_id"`
	ParentType JobParentType `json:"parent_type"`

	// Some jobs are associated to a build job. For example, an Autopkgtest job
	// will test the result of a build job
	BuildJobID uint `json:"build_job_id"`

	// Some jobs take an input.
	// For example, the input of an Autopkgtest job is an artifact id
	// that points to the .deb to test.
	Input string `json:"input_string"`
}

Job is a builds a test, etc.

type JobParentType added in v0.11.0

type JobParentType int

JobParentType represents the parent of the job

const (
	JobParentTypeUnknown JobParentType = iota
	JobParentTypeUpload
	JobParentTypeArchiveUpgrade
)

JobParentType enum

func (JobParentType) String added in v0.11.0

func (parentType JobParentType) String() string

type JobStatus

type JobStatus int

JobStatus is the status of the job

const (
	JobStatusUnknown JobStatus = iota
	JobStatusQueued
	JobStatusAssigned
	JobStatusSuccess
	JobStatusFailed
)

Job Status enum

func (JobStatus) String

func (js JobStatus) String() string

type JobType

type JobType int

JobType is the type of job

const (
	JobTypeUnknown JobType = iota
	JobTypeBuildUpload
	JobTypeAutopkgtest
	JobTypeForwardUpload
	JobTypeSetupArchiveUpgrade
	JobTypePackageUpgrade
	JobTypeAddBuildToRepository
)

Job Type enum

func (JobType) String

func (jt JobType) String() string

type PGPKey added in v0.9.1

type PGPKey struct {
	ID          uint
	UserID      uint
	Fingerprint string
	PublicKey   string
}

PGPKey represents the pgp key of a user

type Upload

type Upload struct {
	ID         uint
	UserID     uint
	Source     string
	Version    string
	Maintainer string
	ChangedBy  string

	// Parameters
	Autopkgtest bool // whether or not to run autopkgtest
	Forward     bool // whether or not to forward the upload
}

Upload is a package upload

type User added in v0.9.1

type User struct {
	ID                uint   `json:"id"`
	Username          string `json:"username"`
	AuthBackendUserID uint   `json:"auth_backend_user_id"`
}

User is a user of the service

Jump to

Keyboard shortcuts

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