Help us shape the future of Go! Take the 2026 Go Developer Survey

model

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventPush   = "push"
	EventPull   = "pull_request"
	EventTag    = "tag"
	EventDeploy = "deployment"
)
View Source
const (
	StatusSkipped = "skipped"
	StatusPending = "pending"
	StatusRunning = "running"
	StatusSuccess = "success"
	StatusFailure = "failure"
	StatusKilled  = "killed"
	StatusError   = "error"
)
View Source
const (
	RepoGit      = "git"
	RepoHg       = "hg"
	RepoFossil   = "fossil"
	RepoPerforce = "perforce"
)
View Source
const (
	Freebsd_386 uint = iota
	Freebsd_amd64
	Freebsd_arm
	Linux_386
	Linux_amd64
	Linux_arm
	Linux_arm64
	Solaris_amd64
	Windows_386
	Windows_amd64
)

Variables

View Source
var Archs = map[string]uint{
	"freebsd_386":   Freebsd_386,
	"freebsd_amd64": Freebsd_amd64,
	"freebsd_arm":   Freebsd_arm,
	"linux_386":     Linux_386,
	"linux_amd64":   Linux_amd64,
	"linux_arm":     Linux_arm,
	"linux_arm64":   Linux_arm64,
	"solaris_amd64": Solaris_amd64,
	"windows_386":   Windows_386,
	"windows_amd64": Windows_amd64,
}

Functions

This section is empty.

Types

type Build

type Build struct {
	ID        int64  `json:"id"            meddler:"build_id,pk"`
	RepoID    int64  `json:"-"             meddler:"build_repo_id"`
	Number    int    `json:"number"        meddler:"build_number"`
	Event     string `json:"event"         meddler:"build_event"`
	Status    string `json:"status"        meddler:"build_status"`
	Enqueued  int64  `json:"enqueued_at"   meddler:"build_enqueued"`
	Created   int64  `json:"created_at"    meddler:"build_created"`
	Started   int64  `json:"started_at"    meddler:"build_started"`
	Finished  int64  `json:"finished_at"   meddler:"build_finished"`
	Deploy    string `json:"deploy_to"     meddler:"build_deploy"`
	Commit    string `json:"commit"        meddler:"build_commit"`
	Branch    string `json:"branch"        meddler:"build_branch"`
	Ref       string `json:"ref"           meddler:"build_ref"`
	Refspec   string `json:"refspec"       meddler:"build_refspec"`
	Remote    string `json:"remote"        meddler:"build_remote"`
	Title     string `json:"title"         meddler:"build_title"`
	Message   string `json:"message"       meddler:"build_message"`
	Timestamp int64  `json:"timestamp"     meddler:"build_timestamp"`
	Author    string `json:"author"        meddler:"build_author"`
	Avatar    string `json:"author_avatar" meddler:"build_avatar"`
	Email     string `json:"author_email"  meddler:"build_email"`
	Link      string `json:"link_url"      meddler:"build_link"`
}

swagger:model build

type BuildGroup

type BuildGroup struct {
	Date   string
	Builds []*Build
}

type CCProject

type CCProject struct {
	XMLName         xml.Name `xml:"Project"`
	Name            string   `xml:"name,attr"`
	Activity        string   `xml:"activity,attr"`
	LastBuildStatus string   `xml:"lastBuildStatus,attr"`
	LastBuildLabel  string   `xml:"lastBuildLabel,attr"`
	LastBuildTime   string   `xml:"lastBuildTime,attr"`
	WebURL          string   `xml:"webUrl,attr"`
}

type CCProjects

type CCProjects struct {
	XMLName xml.Name   `xml:"Projects"`
	Project *CCProject `xml:"Project"`
}

func NewCC

func NewCC(r *Repo, b *Build, link string) *CCProjects

type Feed

type Feed struct {
	Owner    string `json:"owner"         meddler:"repo_owner"`
	Name     string `json:"name"          meddler:"repo_name"`
	FullName string `json:"full_name"     meddler:"repo_full_name"`

	Number   int    `json:"number"        meddler:"build_number"`
	Event    string `json:"event"         meddler:"build_event"`
	Status   string `json:"status"        meddler:"build_status"`
	Created  int64  `json:"created_at"    meddler:"build_created"`
	Started  int64  `json:"started_at"    meddler:"build_started"`
	Finished int64  `json:"finished_at"   meddler:"build_finished"`
	Commit   string `json:"commit"        meddler:"build_commit"`
	Branch   string `json:"branch"        meddler:"build_branch"`
	Ref      string `json:"ref"           meddler:"build_ref"`
	Refspec  string `json:"refspec"       meddler:"build_refspec"`
	Remote   string `json:"remote"        meddler:"build_remote"`
	Title    string `json:"title"         meddler:"build_title"`
	Message  string `json:"message"       meddler:"build_message"`
	Author   string `json:"author"        meddler:"build_author"`
	Avatar   string `json:"author_avatar" meddler:"build_avatar"`
	Email    string `json:"author_email"  meddler:"build_email"`
}

Feed represents an item in the user's feed or timeline.

swagger:model feed

type Job

type Job struct {
	ID       int64  `json:"id"           meddler:"job_id,pk"`
	BuildID  int64  `json:"-"            meddler:"job_build_id"`
	NodeID   int64  `json:"-"            meddler:"job_node_id"`
	Number   int    `json:"number"       meddler:"job_number"`
	Error    string `json:"error"        meddler:"-"`
	Status   string `json:"status"       meddler:"job_status"`
	ExitCode int    `json:"exit_code"    meddler:"job_exit_code"`
	Enqueued int64  `json:"enqueued_at"  meddler:"job_enqueued"`
	Started  int64  `json:"started_at"   meddler:"job_started"`
	Finished int64  `json:"finished_at"  meddler:"job_finished"`

	Environment map[string]string `json:"environment" meddler:"job_environment,json"`
}

swagger:model job

type Key

type Key struct {
	ID      int64  `json:"-"       meddler:"key_id,pk"`
	RepoID  int64  `json:"-"       meddler:"key_repo_id"`
	Public  string `json:"public"  meddler:"key_public"`
	Private string `json:"private" meddler:"key_private"`
}

type Log

type Log struct {
	ID    int64  `meddler:"log_id,pk"`
	JobID int64  `meddler:"log_job_id"`
	Data  []byte `meddler:"log_data"`
}

type Netrc

type Netrc struct {
	Machine  string `json:"machine"`
	Login    string `json:"login"`
	Password string `json:"user"`
}

type Node

type Node struct {
	ID   int64  `meddler:"node_id,pk" json:"id"`
	Addr string `meddler:"node_addr"  json:"address"`
	Arch string `meddler:"node_arch"  json:"architecture"`
	Cert string `meddler:"node_cert"  json:"-"`
	Key  string `meddler:"node_key"   json:"-"`
	CA   string `meddler:"node_ca"    json:"-"`
}

type Perm

type Perm struct {
	Pull  bool `json:"pull"`
	Push  bool `json:"push"`
	Admin bool `json:"admin"`
}

type Registry added in v0.4.2

type Registry struct {
	ID       int64  `json:"id"       meddler:"registry_id,pk"`
	RepoID   int64  `json:"-"        meddler:"registry_repo_id"`
	Addr     string `json:"addr"     meddler:"registry_addr"`
	Username string `json:"username" meddler:"registry_username"`
	Password string `json:"password" meddler:"registry_password"`
	Email    string `json:"email"    meddler:"registry_email"`
	Token    string `json:"token"    meddler:"registry_token"`
}

func (*Registry) Validate added in v0.4.2

func (r *Registry) Validate() error

type Repo

type Repo struct {
	ID          int64  `json:"id"                meddler:"repo_id,pk"`
	UserID      int64  `json:"-"                 meddler:"repo_user_id"`
	Owner       string `json:"owner"             meddler:"repo_owner"`
	Name        string `json:"name"              meddler:"repo_name"`
	FullName    string `json:"full_name"         meddler:"repo_full_name"`
	Avatar      string `json:"avatar_url"        meddler:"repo_avatar"`
	Link        string `json:"link_url"          meddler:"repo_link"`
	Kind        string `json:"scm"               meddler:"repo_scm"`
	Clone       string `json:"clone_url"         meddler:"repo_clone"`
	Branch      string `json:"default_branch"    meddler:"repo_branch"`
	Timeout     int64  `json:"timeout"           meddler:"repo_timeout"`
	IsPrivate   bool   `json:"private"           meddler:"repo_private"`
	IsTrusted   bool   `json:"trusted"           meddler:"repo_trusted"`
	IsStarred   bool   `json:"starred,omitempty" meddler:"-"`
	AllowPull   bool   `json:"allow_pr"          meddler:"repo_allow_pr"`
	AllowPush   bool   `json:"allow_push"        meddler:"repo_allow_push"`
	AllowDeploy bool   `json:"allow_deploys"     meddler:"repo_allow_deploys"`
	AllowTag    bool   `json:"allow_tags"        meddler:"repo_allow_tags"`
	Hash        string `json:"-"                 meddler:"repo_hash"`
}

Repo represents a repository.

swagger:model repo

type RepoLite

type RepoLite struct {
	Owner    string `json:"owner"`
	Name     string `json:"name"`
	FullName string `json:"full_name"`
	Avatar   string `json:"avatar_url"`
}

type Secret added in v0.4.2

type Secret struct {
	// the id for this secret.
	ID int64 `json:"id" meddler:"secret_id,pk"`

	// the foreign key for this secret.
	RepoID int64 `json:"-" meddler:"secret_repo_id"`

	// the name of the secret which will be used as the environment variable
	// name at runtime.
	Name string `json:"name" meddler:"secret_name"`

	// the value of the secret which will be provided to the runtime environment
	// as a named environment variable.
	Value string `json:"value" meddler:"secret_value"`

	// the secret is restricted to this list of images.
	Images []string `json:"image,omitempty" meddler:"secret_images,json"`

	// the secret is restricted to this list of events.
	Events []string `json:"event,omitempty" meddler:"secret_events,json"`
}

func (*Secret) Match added in v0.4.2

func (s *Secret) Match(image, event string) bool

Match returns true if an image and event match the restricted list.

func (*Secret) MatchEvent added in v0.4.2

func (s *Secret) MatchEvent(event string) bool

MatchEvent returns true if an event matches the restricted list.

func (*Secret) MatchImage added in v0.4.2

func (s *Secret) MatchImage(image string) bool

MatchImage returns true if an image matches the restricted list.

func (*Secret) Validate added in v0.4.2

func (s *Secret) Validate() error

Validate validates the required fields and formats.

type System

type System struct {
	Version   string   `json:"version"`
	Link      string   `json:"link_url"`
	Plugins   []string `json:"plugins"`
	Globals   []string `json:"globals"`
	Escalates []string `json:"privileged_plugins"`
}

type User

type User struct {
	// the id for this user.
	//
	// required: true
	ID int64 `json:"id" meddler:"user_id,pk"`

	// Login is the username for this user.
	//
	// required: true
	Login string `json:"login"  meddler:"user_login"`

	// Token is the oauth2 token.
	Token string `json:"-"  meddler:"user_token"`

	// Secret is the oauth2 token secret.
	Secret string `json:"-" meddler:"user_secret"`

	// Expiry is the token and secret expriation timestamp.
	Expiry int64 `json:"-" meddler:"user_expiry"`

	// Email is the email address for this user.
	//
	// required: true
	Email string `json:"email" meddler:"user_email"`

	// the avatar url for this user.
	Avatar string `json:"avatar_url" meddler:"user_avatar"`

	// Activate indicates the user is active in the system.
	Active bool `json:"active," meddler:"user_active"`

	// Admin indicates the user is a system administrator.
	Admin bool `json:"admin," meddler:"user_admin"`

	// Hash is a unique token used to sign tokens.
	Hash string `json:"-" meddler:"user_hash"`
}

User represents a registered user.

swagger:model user

Jump to

Keyboard shortcuts

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