Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyPagination[T any](d *ListOptions, slice []T) []T
- func IsThereRunningStage(workflows []*Workflow) bool
- func ParseRepo(str string) (user, repo string, err error)
- func ValidateWebhookEvent(s WebhookEvent) error
- type Agent
- type Config
- type ConfigStore
- type Cron
- type EncryptionBuilder
- type EncryptionClient
- type EncryptionService
- type EncryptionServiceBuilder
- type Environ
- type EnvironService
- type EnvironStore
- type Event
- type EventType
- type Feed
- type ForgeRemoteID
- type ListOptions
- type LogEntry
- type LogEntryType
- type Netrc
- type Org
- type OrgPerm
- type Perm
- type PermStore
- type Pipeline
- type PipelineConfig
- type PipelineOptions
- type PullRequest
- type ReadOnlyRegistryService
- type Redirection
- type Registry
- type RegistryService
- type RegistryStore
- type Repo
- type RepoPatch
- type RepoVisibility
- type ResourceLimit
- type SCMKind
- type Secret
- type SecretService
- type SecretStore
- type ServerConfig
- type ServerConfigStore
- type Settings
- type StatusValue
- type Step
- type StepStore
- type StepType
- type Task
- type TaskStore
- type Team
- type UpdatePipelineStore
- type UpdateStepStore
- type UpdateWorkflowStore
- type User
- type WebhookEvent
- type WebhookEventList
- type Workflow
Constants ¶
const ( FailureIgnore = "ignore" FailureFail = "fail" )
Different ways to handle failure states
Variables ¶
var ( ErrSecretNameInvalid = errors.New("Invalid Secret Name") ErrSecretImageInvalid = errors.New("Invalid Secret Image") ErrSecretValueInvalid = errors.New("Invalid Secret Value") ErrSecretEventInvalid = errors.New("Invalid Secret Event") )
var ErrInvalidWebhookEvent = errors.New("invalid webhook event")
Functions ¶
func ApplyPagination ¶
func ApplyPagination[T any](d *ListOptions, slice []T) []T
func IsThereRunningStage ¶
IsThereRunningStage determine if it contains workflows running or pending to run TODO: return false based on depends_on (https://github.com/woodpecker-ci/woodpecker/pull/730#discussion_r795681697)
func ValidateWebhookEvent ¶
func ValidateWebhookEvent(s WebhookEvent) error
Types ¶
type Agent ¶
type Agent struct { ID int64 `json:"id" xorm:"pk autoincr 'id'"` Created int64 `json:"created" xorm:"created"` Updated int64 `json:"updated" xorm:"updated"` Name string `json:"name"` OwnerID int64 `json:"owner_id" xorm:"'owner_id'"` Token string `json:"token"` LastContact int64 `json:"last_contact"` Platform string `json:"platform" xorm:"VARCHAR(100)"` Backend string `json:"backend" xorm:"VARCHAR(100)"` Capacity int32 `json:"capacity"` Version string `json:"version"` NoSchedule bool `json:"no_schedule"` } // @name Agent
func (*Agent) IsSystemAgent ¶
type Config ¶
type Config struct { ID int64 `json:"-" xorm:"pk autoincr 'config_id'"` RepoID int64 `json:"-" xorm:"UNIQUE(s) 'config_repo_id'"` Hash string `json:"hash" xorm:"UNIQUE(s) 'config_hash'"` Name string `json:"name" xorm:"config_name"` Data []byte `json:"data" xorm:"config_data"` } // @name Config
Config represents a pipeline configuration.
type ConfigStore ¶
type ConfigStore interface { ConfigsForPipeline(pipelineID int64) ([]*Config, error) ConfigFindIdentical(repoID int64, hash string) (*Config, error) ConfigFindApproved(*Config) (bool, error) ConfigCreate(*Config) error PipelineConfigCreate(*PipelineConfig) error }
ConfigStore persists pipeline configuration to storage.
type Cron ¶
type Cron struct { ID int64 `json:"id" xorm:"pk autoincr"` Name string `json:"name" xorm:"UNIQUE(s) INDEX"` RepoID int64 `json:"repo_id" xorm:"repo_id UNIQUE(s) INDEX"` CreatorID int64 `json:"creator_id" xorm:"creator_id INDEX"` NextExec int64 `json:"next_exec"` Schedule string `json:"schedule" xorm:"NOT NULL"` // @weekly, 3min, ... Created int64 `json:"created_at" xorm:"created NOT NULL DEFAULT 0"` Branch string `json:"branch"` } // @name Cron
type EncryptionBuilder ¶
type EncryptionBuilder interface { WithClient(client EncryptionClient) EncryptionBuilder Build() error }
EncryptionBuilder is user API to obtain correctly configured encryption
type EncryptionClient ¶
type EncryptionClient interface { // SetEncryptionService should be used only by EncryptionServiceBuilder SetEncryptionService(encryption EncryptionService) error // EnableEncryption should encrypt all service data EnableEncryption() error // MigrateEncryption should decrypt all existing data and encrypt it with new encryption service MigrateEncryption(newEncryption EncryptionService) error }
type EncryptionService ¶
type EncryptionServiceBuilder ¶
type EncryptionServiceBuilder interface { WithClients(clients []EncryptionClient) EncryptionServiceBuilder Build() (EncryptionService, error) }
type Environ ¶
type Environ struct { ID int64 `json:"id"` Name string `json:"name"` Value string `json:"value,omitempty"` }
Environ represents an environment variable.
type EnvironService ¶
EnvironService defines a service for managing environment variables.
type EnvironStore ¶
EnvironStore persists environment information to storage.
type Feed ¶
type Feed struct { RepoID int64 `json:"repo_id" xorm:"feed_repo_id"` ID int64 `json:"id,omitempty" xorm:"feed_pipeline_id"` Number int64 `json:"number,omitempty" xorm:"feed_pipeline_number"` Event string `json:"event,omitempty" xorm:"feed_pipeline_event"` Status string `json:"status,omitempty" xorm:"feed_pipeline_status"` Created int64 `json:"created_at,omitempty" xorm:"feed_pipeline_created"` Started int64 `json:"started_at,omitempty" xorm:"feed_pipeline_started"` Finished int64 `json:"finished_at,omitempty" xorm:"feed_pipeline_finished"` Commit string `json:"commit,omitempty" xorm:"feed_pipeline_commit"` Branch string `json:"branch,omitempty" xorm:"feed_pipeline_branch"` Ref string `json:"ref,omitempty" xorm:"feed_pipeline_ref"` Refspec string `json:"refspec,omitempty" xorm:"feed_pipeline_refspec"` Remote string `json:"remote,omitempty" xorm:"feed_pipeline_clone_url"` Title string `json:"title,omitempty" xorm:"feed_pipeline_title"` Message string `json:"message,omitempty" xorm:"feed_pipeline_message"` Author string `json:"author,omitempty" xorm:"feed_pipeline_author"` Avatar string `json:"author_avatar,omitempty" xorm:"feed_pipeline_avatar"` Email string `json:"author_email,omitempty" xorm:"feed_pipeline_email"` } // @name Feed
Feed represents an item in the user's feed or timeline.
type ForgeRemoteID ¶
type ForgeRemoteID string
func (ForgeRemoteID) IsValid ¶
func (r ForgeRemoteID) IsValid() bool
type ListOptions ¶
type LogEntry ¶
type LogEntry struct { ID int64 `json:"id" xorm:"pk autoincr 'id'"` StepID int64 `json:"step_id" xorm:"INDEX 'step_id'"` Time int64 `json:"time"` Line int `json:"line"` Data []byte `json:"data" xorm:"LONGBLOB"` Created int64 `json:"-" xorm:"created"` Type LogEntryType `json:"type"` } // @name LogEntry
type LogEntryType ¶
type LogEntryType int // @name LogEntryType
LogEntryType identifies the type of line in the logs.
const ( LogEntryStdout LogEntryType = iota LogEntryStderr LogEntryExitCode LogEntryMetadata LogEntryProgress )
type Org ¶
type Org struct { ID int64 `json:"id,omitempty" xorm:"pk autoincr 'id'"` Name string `json:"name" xorm:"UNIQUE 'name'"` IsUser bool `json:"is_user" xorm:"is_user"` // if name lookup has to check for membership or not Private bool `json:"-" xorm:"private"` } // @name Org
Org represents an organization.
type Perm ¶
type Perm struct { UserID int64 `json:"-" xorm:"UNIQUE(s) INDEX NOT NULL 'perm_user_id'"` RepoID int64 `json:"-" xorm:"UNIQUE(s) INDEX NOT NULL 'perm_repo_id'"` Repo *Repo `json:"-" xorm:"-"` Pull bool `json:"pull" xorm:"perm_pull"` Push bool `json:"push" xorm:"perm_push"` Admin bool `json:"admin" xorm:"perm_admin"` Synced int64 `json:"synced" xorm:"perm_synced"` Created int64 `json:"created" xorm:"created"` Updated int64 `json:"updated" xorm:"updated"` } // @name Perm
Perm defines a repository permission for an individual user.
type PermStore ¶
type PermStore interface { PermFind(user *User, repo *Repo) (*Perm, error) PermUpsert(perm *Perm) error PermDelete(perm *Perm) error PermFlush(user *User, before int64) error }
PermStore persists repository permissions information to storage.
type Pipeline ¶
type Pipeline struct { ID int64 `json:"id" xorm:"pk autoincr 'pipeline_id'"` RepoID int64 `json:"-" xorm:"UNIQUE(s) INDEX 'pipeline_repo_id'"` Number int64 `json:"number" xorm:"UNIQUE(s) 'pipeline_number'"` Author string `json:"author" xorm:"INDEX 'pipeline_author'"` ConfigID int64 `json:"-" xorm:"pipeline_config_id"` Parent int64 `json:"parent" xorm:"pipeline_parent"` Event WebhookEvent `json:"event" xorm:"pipeline_event"` Status StatusValue `json:"status" xorm:"INDEX 'pipeline_status'"` Error string `json:"error" xorm:"LONGTEXT 'pipeline_error'"` Enqueued int64 `json:"enqueued_at" xorm:"pipeline_enqueued"` Created int64 `json:"created_at" xorm:"pipeline_created"` Updated int64 `json:"updated_at" xorm:"updated NOT NULL DEFAULT 0 'updated'"` Started int64 `json:"started_at" xorm:"pipeline_started"` Finished int64 `json:"finished_at" xorm:"pipeline_finished"` Deploy string `json:"deploy_to" xorm:"pipeline_deploy"` Commit string `json:"commit" xorm:"pipeline_commit"` Branch string `json:"branch" xorm:"pipeline_branch"` Ref string `json:"ref" xorm:"pipeline_ref"` Refspec string `json:"refspec" xorm:"pipeline_refspec"` CloneURL string `json:"clone_url" xorm:"pipeline_clone_url"` Title string `json:"title" xorm:"pipeline_title"` Message string `json:"message" xorm:"TEXT 'pipeline_message'"` Timestamp int64 `json:"timestamp" xorm:"pipeline_timestamp"` Sender string `json:"sender" xorm:"pipeline_sender"` // uses reported user for webhooks and name of cron for cron pipelines Avatar string `json:"author_avatar" xorm:"pipeline_avatar"` Email string `json:"author_email" xorm:"pipeline_email"` Link string `json:"link_url" xorm:"pipeline_link"` Reviewer string `json:"reviewed_by" xorm:"pipeline_reviewer"` Reviewed int64 `json:"reviewed_at" xorm:"pipeline_reviewed"` Workflows []*Workflow `json:"workflows,omitempty" xorm:"-"` ChangedFiles []string `json:"changed_files,omitempty" xorm:"LONGTEXT 'changed_files'"` AdditionalVariables map[string]string `json:"variables,omitempty" xorm:"json 'additional_variables'"` PullRequestLabels []string `json:"pr_labels,omitempty" xorm:"json 'pr_labels'"` } // @name Pipeline
func (Pipeline) IsMultiPipeline ¶
IsMultiPipeline checks if step list contain more than one parent step
type PipelineConfig ¶
type PipelineConfig struct { ConfigID int64 `json:"-" xorm:"UNIQUE(s) NOT NULL 'config_id'"` PipelineID int64 `json:"-" xorm:"UNIQUE(s) NOT NULL 'pipeline_id'"` }
PipelineConfig is the n:n relation between Pipeline and Config
type PipelineOptions ¶
type PullRequest ¶
type ReadOnlyRegistryService ¶
type ReadOnlyRegistryService interface { RegistryFind(*Repo, string) (*Registry, error) RegistryList(*Repo, *ListOptions) ([]*Registry, error) }
ReadOnlyRegistryService defines a service for managing registries.
type Redirection ¶
type Redirection struct { ID int64 `xorm:"pk autoincr 'redirection_id'"` RepoID int64 `xorm:"'repo_id'"` FullName string `xorm:"UNIQUE INDEX 'repo_full_name'"` }
func (Redirection) TableName ¶
func (r Redirection) TableName() string
type Registry ¶
type Registry struct { ID int64 `json:"id" xorm:"pk autoincr 'registry_id'"` RepoID int64 `json:"-" xorm:"UNIQUE(s) INDEX 'registry_repo_id'"` Address string `json:"address" xorm:"UNIQUE(s) INDEX 'registry_addr'"` Username string `json:"username" xorm:"varchar(2000) 'registry_username'"` Password string `json:"password" xorm:"TEXT 'registry_password'"` Token string `json:"token" xorm:"TEXT 'registry_token'"` Email string `json:"email" xorm:"varchar(500) 'registry_email'"` } // @name Registry
Registry represents a docker registry with credentials.
type RegistryService ¶
type RegistryService interface { RegistryFind(*Repo, string) (*Registry, error) RegistryList(*Repo, *ListOptions) ([]*Registry, error) RegistryCreate(*Repo, *Registry) error RegistryUpdate(*Repo, *Registry) error RegistryDelete(*Repo, string) error }
RegistryService defines a service for managing registries.
type RegistryStore ¶
type RegistryStore interface { RegistryFind(*Repo, string) (*Registry, error) RegistryList(*Repo, *ListOptions) ([]*Registry, error) RegistryCreate(*Registry) error RegistryUpdate(*Registry) error RegistryDelete(repo *Repo, addr string) error }
RegistryStore persists registry information to storage.
type Repo ¶
type Repo struct { ID int64 `json:"id,omitempty" xorm:"pk autoincr 'repo_id'"` UserID int64 `json:"-" xorm:"repo_user_id"` // ForgeRemoteID is the unique identifier for the repository on the forge. ForgeRemoteID ForgeRemoteID `json:"forge_remote_id" xorm:"forge_remote_id"` OrgID int64 `json:"org_id" xorm:"repo_org_id"` Owner string `json:"owner" xorm:"UNIQUE(name) 'repo_owner'"` Name string `json:"name" xorm:"UNIQUE(name) 'repo_name'"` FullName string `json:"full_name" xorm:"UNIQUE 'repo_full_name'"` Avatar string `json:"avatar_url,omitempty" xorm:"varchar(500) 'repo_avatar'"` Link string `json:"link_url,omitempty" xorm:"varchar(1000) 'repo_link'"` Clone string `json:"clone_url,omitempty" xorm:"varchar(1000) 'repo_clone'"` Branch string `json:"default_branch,omitempty" xorm:"varchar(500) 'repo_branch'"` SCMKind SCMKind `json:"scm,omitempty" xorm:"varchar(50) 'repo_scm'"` Timeout int64 `json:"timeout,omitempty" xorm:"repo_timeout"` Visibility RepoVisibility `json:"visibility" xorm:"varchar(10) 'repo_visibility'"` IsSCMPrivate bool `json:"private" xorm:"repo_private"` IsTrusted bool `json:"trusted" xorm:"repo_trusted"` IsGated bool `json:"gated" xorm:"repo_gated"` IsActive bool `json:"active" xorm:"repo_active"` AllowPull bool `json:"allow_pr" xorm:"repo_allow_pr"` Config string `json:"config_file" xorm:"varchar(500) 'repo_config_path'"` Hash string `json:"-" xorm:"varchar(500) 'repo_hash'"` Perm *Perm `json:"-" xorm:"-"` CancelPreviousPipelineEvents []WebhookEvent `json:"cancel_previous_pipeline_events" xorm:"json 'cancel_previous_pipeline_events'"` NetrcOnlyTrusted bool `json:"netrc_only_trusted" xorm:"NOT NULL DEFAULT true 'netrc_only_trusted'"` } // @name Repo
Repo represents a repository.
func (*Repo) ResetVisibility ¶
func (r *Repo) ResetVisibility()
type RepoPatch ¶
type RepoPatch struct { Config *string `json:"config_file,omitempty"` IsTrusted *bool `json:"trusted,omitempty"` IsGated *bool `json:"gated,omitempty"` Timeout *int64 `json:"timeout,omitempty"` Visibility *string `json:"visibility,omitempty"` AllowPull *bool `json:"allow_pr,omitempty"` CancelPreviousPipelineEvents *[]WebhookEvent `json:"cancel_previous_pipeline_events"` NetrcOnlyTrusted *bool `json:"netrc_only_trusted"` } // @name RepoPatch
RepoPatch represents a repository patch object.
type RepoVisibility ¶
type RepoVisibility string // @name RepoVisibility
RepoVisibility represent to wat state a repo in woodpecker is visible to others
const ( VisibilityPublic RepoVisibility = "public" VisibilityPrivate RepoVisibility = "private" VisibilityInternal RepoVisibility = "internal" )
type ResourceLimit ¶
type ResourceLimit struct { MemSwapLimit int64 MemLimit int64 ShmSize int64 CPUQuota int64 CPUSet string }
ResourceLimit is the resource limit to set on pipeline steps
type SCMKind ¶
type SCMKind string // @name SCMKind
SCMKind represent different version control systems
type Secret ¶
type Secret struct { ID int64 `json:"id" xorm:"pk autoincr 'secret_id'"` OrgID int64 `json:"-" xorm:"NOT NULL DEFAULT 0 UNIQUE(s) INDEX 'secret_org_id'"` RepoID int64 `json:"-" xorm:"NOT NULL DEFAULT 0 UNIQUE(s) INDEX 'secret_repo_id'"` Name string `json:"name" xorm:"NOT NULL UNIQUE(s) INDEX 'secret_name'"` Value string `json:"value,omitempty" xorm:"TEXT 'secret_value'"` Images []string `json:"image" xorm:"json 'secret_images'"` PluginsOnly bool `json:"plugins_only" xorm:"secret_plugins_only"` Events []WebhookEvent `json:"event" xorm:"json 'secret_events'"` SkipVerify bool `json:"-" xorm:"secret_skip_verify"` Conceal bool `json:"-" xorm:"secret_conceal"` } // @name Secret
Secret represents a secret variable, such as a password or token.
func (*Secret) BeforeInsert ¶
func (s *Secret) BeforeInsert()
BeforeInsert will sort events before inserted into database
func (*Secret) Match ¶
func (s *Secret) Match(event WebhookEvent) bool
Match returns true if an image and event match the restricted list.
type SecretService ¶
type SecretService interface { SecretListPipeline(*Repo, *Pipeline, *ListOptions) ([]*Secret, error) // Repository secrets SecretFind(*Repo, string) (*Secret, error) SecretList(*Repo, *ListOptions) ([]*Secret, error) SecretCreate(*Repo, *Secret) error SecretUpdate(*Repo, *Secret) error SecretDelete(*Repo, string) error // Organization secrets OrgSecretFind(int64, string) (*Secret, error) OrgSecretList(int64, *ListOptions) ([]*Secret, error) OrgSecretCreate(int64, *Secret) error OrgSecretUpdate(int64, *Secret) error OrgSecretDelete(int64, string) error // Global secrets GlobalSecretFind(string) (*Secret, error) GlobalSecretList(*ListOptions) ([]*Secret, error) GlobalSecretCreate(*Secret) error GlobalSecretUpdate(*Secret) error GlobalSecretDelete(string) error }
SecretService defines a service for managing secrets.
type SecretStore ¶
type SecretStore interface { SecretFind(*Repo, string) (*Secret, error) SecretList(*Repo, bool, *ListOptions) ([]*Secret, error) SecretCreate(*Secret) error SecretUpdate(*Secret) error SecretDelete(*Secret) error OrgSecretFind(int64, string) (*Secret, error) OrgSecretList(int64, *ListOptions) ([]*Secret, error) GlobalSecretFind(string) (*Secret, error) GlobalSecretList(*ListOptions) ([]*Secret, error) SecretListAll() ([]*Secret, error) }
SecretStore persists secret information to storage.
type ServerConfig ¶
ServerConfig represents a key-value pair for storing server configurations.
type ServerConfigStore ¶
type ServerConfigStore interface { ServerConfigGet(key string) (string, error) ServerConfigSet(key int64, value string) error }
ServerConfigStore persists key-value pairs for storing server configurations.
type Settings ¶
type Settings struct { Open bool // Enables open registration Admins map[string]bool // Administrative users Orgs map[string]bool // Organization whitelist OwnersWhitelist map[string]bool // Owners whitelist }
Settings defines system configuration parameters.
type StatusValue ¶
type StatusValue string // @name StatusValue
StatusValue represent pipeline states woodpecker know
const ( StatusSkipped StatusValue = "skipped" StatusPending StatusValue = "pending" StatusRunning StatusValue = "running" StatusSuccess StatusValue = "success" StatusFailure StatusValue = "failure" StatusKilled StatusValue = "killed" StatusError StatusValue = "error" StatusBlocked StatusValue = "blocked" StatusDeclined StatusValue = "declined" )
func PipelineStatus ¶
func PipelineStatus(workflows []*Workflow) StatusValue
PipelineStatus determine pipeline status based on corresponding workflow list
func WorkflowStatus ¶
func WorkflowStatus(steps []*Step) StatusValue
WorkflowStatus determine workflow status based on corresponding step list
type Step ¶
type Step struct { ID int64 `json:"id" xorm:"pk autoincr 'step_id'"` UUID string `json:"uuid" xorm:"INDEX 'step_uuid'"` PipelineID int64 `json:"pipeline_id" xorm:"UNIQUE(s) INDEX 'step_pipeline_id'"` PID int `json:"pid" xorm:"UNIQUE(s) 'step_pid'"` PPID int `json:"ppid" xorm:"step_ppid"` Name string `json:"name" xorm:"step_name"` State StatusValue `json:"state" xorm:"step_state"` Error string `json:"error,omitempty" xorm:"TEXT 'step_error'"` Failure string `json:"-" xorm:"step_failure"` ExitCode int `json:"exit_code" xorm:"step_exit_code"` Started int64 `json:"start_time,omitempty" xorm:"step_started"` Stopped int64 `json:"end_time,omitempty" xorm:"step_stopped"` Type StepType `json:"type,omitempty" xorm:"step_type"` } // @name Step
Step represents a process in the pipeline.
type StepStore ¶
type StepStore interface { StepLoad(int64) (*Step, error) StepFind(*Pipeline, int) (*Step, error) StepChild(*Pipeline, int, string) (*Step, error) StepList(*Pipeline) ([]*Step, error) StepCreate([]*Step) error StepUpdate(*Step) error StepClear(*Pipeline) error }
StepStore persists process information to storage.
type Task ¶
type Task struct { ID string `json:"id" xorm:"PK UNIQUE 'task_id'"` Data []byte `json:"data" xorm:"'task_data'"` Labels map[string]string `json:"labels" xorm:"json 'task_labels'"` Dependencies []string `json:"dependencies" xorm:"json 'task_dependencies'"` RunOn []string `json:"run_on" xorm:"json 'task_run_on'"` DepStatus map[string]StatusValue `json:"dep_status" xorm:"json 'task_dep_status'"` AgentID int64 `json:"agent_id" xorm:"'agent_id'"` } // @name Task
Task defines scheduled pipeline Task.
type TaskStore ¶
type TaskStore interface { TaskList() ([]*Task, error) TaskInsert(*Task) error TaskDelete(string) error }
TaskStore defines storage for scheduled Tasks.
type Team ¶
type Team struct { // Login is the username for this team. Login string `json:"login"` // the avatar url for this team. Avatar string `json:"avatar_url"` }
Team represents a team or organization in the forge.
type UpdatePipelineStore ¶
type UpdateStepStore ¶
type UpdateWorkflowStore ¶
type User ¶
type User struct { // the id for this user. // // required: true ID int64 `json:"id" xorm:"pk autoincr 'user_id'"` ForgeRemoteID ForgeRemoteID `json:"-" xorm:"forge_remote_id"` // Login is the username for this user. // // required: true Login string `json:"login" xorm:"UNIQUE 'user_login'"` // Token is the oauth2 token. Token string `json:"-" xorm:"TEXT 'user_token'"` // Secret is the oauth2 token secret. Secret string `json:"-" xorm:"TEXT 'user_secret'"` // Expiry is the token and secret expiration timestamp. Expiry int64 `json:"-" xorm:"user_expiry"` // Email is the email address for this user. // // required: true Email string `json:"email" xorm:" varchar(500) 'user_email'"` // the avatar url for this user. Avatar string `json:"avatar_url" xorm:" varchar(500) 'user_avatar'"` // Admin indicates the user is a system administrator. // // NOTE: If the username is part of the WOODPECKER_ADMIN // environment variable this value will be set to true on login. Admin bool `json:"admin,omitempty" xorm:"user_admin"` // Hash is a unique token used to sign tokens. Hash string `json:"-" xorm:"UNIQUE varchar(500) 'user_hash'"` } // @name User
User represents a registered user.
type WebhookEvent ¶
type WebhookEvent string // @name WebhookEvent
const ( EventPush WebhookEvent = "push" EventPull WebhookEvent = "pull_request" EventTag WebhookEvent = "tag" EventDeploy WebhookEvent = "deployment" EventCron WebhookEvent = "cron" EventManual WebhookEvent = "manual" )
type WebhookEventList ¶
type WebhookEventList []WebhookEvent
func (WebhookEventList) Len ¶
func (wel WebhookEventList) Len() int
func (WebhookEventList) Less ¶
func (wel WebhookEventList) Less(i, j int) bool
func (WebhookEventList) Swap ¶
func (wel WebhookEventList) Swap(i, j int)
type Workflow ¶
type Workflow struct { ID int64 `json:"id" xorm:"pk autoincr 'workflow_id'"` PipelineID int64 `json:"pipeline_id" xorm:"UNIQUE(s) INDEX 'workflow_pipeline_id'"` PID int `json:"pid" xorm:"UNIQUE(s) 'workflow_pid'"` Name string `json:"name" xorm:"workflow_name"` State StatusValue `json:"state" xorm:"workflow_state"` Error string `json:"error,omitempty" xorm:"TEXT 'workflow_error'"` Started int64 `json:"start_time,omitempty" xorm:"workflow_started"` Stopped int64 `json:"end_time,omitempty" xorm:"workflow_stopped"` AgentID int64 `json:"agent_id,omitempty" xorm:"workflow_agent_id"` Platform string `json:"platform,omitempty" xorm:"workflow_platform"` Environ map[string]string `json:"environ,omitempty" xorm:"json 'workflow_environ'"` Children []*Step `json:"children,omitempty" xorm:"-"` }
Workflow represents a workflow in the pipeline.