{"modulePath":"github.com/Coding/drone","version":"v0.4.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package model\n\n## Constants\n\n```go\nconst (\n\tEventPush   = \"push\"\n\tEventPull   = \"pull_request\"\n\tEventTag    = \"tag\"\n\tEventDeploy = \"deployment\"\n)\n```\n\n```go\nconst (\n\tStatusSkipped = \"skipped\"\n\tStatusPending = \"pending\"\n\tStatusRunning = \"running\"\n\tStatusSuccess = \"success\"\n\tStatusFailure = \"failure\"\n\tStatusKilled  = \"killed\"\n\tStatusError   = \"error\"\n)\n```\n\n```go\nconst (\n\tRepoGit      = \"git\"\n\tRepoHg       = \"hg\"\n\tRepoFossil   = \"fossil\"\n\tRepoPerforce = \"perforce\"\n)\n```\n\n```go\nconst (\n\tFreebsd_386 uint = iota\n\tFreebsd_amd64\n\tFreebsd_arm\n\tLinux_386\n\tLinux_amd64\n\tLinux_arm\n\tLinux_arm64\n\tSolaris_amd64\n\tWindows_386\n\tWindows_amd64\n)\n```\n\n## Variables\n\n```go\nvar Archs = map[string]uint{\n\t\"freebsd_386\":   Freebsd_386,\n\t\"freebsd_amd64\": Freebsd_amd64,\n\t\"freebsd_arm\":   Freebsd_arm,\n\t\"linux_386\":     Linux_386,\n\t\"linux_amd64\":   Linux_amd64,\n\t\"linux_arm\":     Linux_arm,\n\t\"linux_arm64\":   Linux_arm64,\n\t\"solaris_amd64\": Solaris_amd64,\n\t\"windows_386\":   Windows_386,\n\t\"windows_amd64\": Windows_amd64,\n}\n```\n\n## Types\n\n```go\ntype Build struct {\n\tID        int64  `json:\"id\"            meddler:\"build_id,pk\"`\n\tRepoID    int64  `json:\"-\"             meddler:\"build_repo_id\"`\n\tNumber    int    `json:\"number\"        meddler:\"build_number\"`\n\tEvent     string `json:\"event\"         meddler:\"build_event\"`\n\tStatus    string `json:\"status\"        meddler:\"build_status\"`\n\tEnqueued  int64  `json:\"enqueued_at\"   meddler:\"build_enqueued\"`\n\tCreated   int64  `json:\"created_at\"    meddler:\"build_created\"`\n\tStarted   int64  `json:\"started_at\"    meddler:\"build_started\"`\n\tFinished  int64  `json:\"finished_at\"   meddler:\"build_finished\"`\n\tDeploy    string `json:\"deploy_to\"     meddler:\"build_deploy\"`\n\tCommit    string `json:\"commit\"        meddler:\"build_commit\"`\n\tBranch    string `json:\"branch\"        meddler:\"build_branch\"`\n\tRef       string `json:\"ref\"           meddler:\"build_ref\"`\n\tRefspec   string `json:\"refspec\"       meddler:\"build_refspec\"`\n\tRemote    string `json:\"remote\"        meddler:\"build_remote\"`\n\tTitle     string `json:\"title\"         meddler:\"build_title\"`\n\tMessage   string `json:\"message\"       meddler:\"build_message\"`\n\tTimestamp int64  `json:\"timestamp\"     meddler:\"build_timestamp\"`\n\tAuthor    string `json:\"author\"        meddler:\"build_author\"`\n\tAvatar    string `json:\"author_avatar\" meddler:\"build_avatar\"`\n\tEmail     string `json:\"author_email\"  meddler:\"build_email\"`\n\tLink      string `json:\"link_url\"      meddler:\"build_link\"`\n}\n```\nswagger:model build\n\n```go\ntype BuildGroup struct {\n\tDate   string\n\tBuilds []*Build\n}\n```\n\n```go\ntype CCProject struct {\n\tXMLName         xml.Name `xml:\"Project\"`\n\tName            string   `xml:\"name,attr\"`\n\tActivity        string   `xml:\"activity,attr\"`\n\tLastBuildStatus string   `xml:\"lastBuildStatus,attr\"`\n\tLastBuildLabel  string   `xml:\"lastBuildLabel,attr\"`\n\tLastBuildTime   string   `xml:\"lastBuildTime,attr\"`\n\tWebURL          string   `xml:\"webUrl,attr\"`\n}\n```\n\n```go\ntype CCProjects struct {\n\tXMLName xml.Name   `xml:\"Projects\"`\n\tProject *CCProject `xml:\"Project\"`\n}\n```\n\n```go\nfunc NewCC(r *Repo, b *Build, link string) *CCProjects\n```\n\n```go\ntype Feed struct {\n\tOwner    string `json:\"owner\"         meddler:\"repo_owner\"`\n\tName     string `json:\"name\"          meddler:\"repo_name\"`\n\tFullName string `json:\"full_name\"     meddler:\"repo_full_name\"`\n\n\tNumber   int    `json:\"number\"        meddler:\"build_number\"`\n\tEvent    string `json:\"event\"         meddler:\"build_event\"`\n\tStatus   string `json:\"status\"        meddler:\"build_status\"`\n\tCreated  int64  `json:\"created_at\"    meddler:\"build_created\"`\n\tStarted  int64  `json:\"started_at\"    meddler:\"build_started\"`\n\tFinished int64  `json:\"finished_at\"   meddler:\"build_finished\"`\n\tCommit   string `json:\"commit\"        meddler:\"build_commit\"`\n\tBranch   string `json:\"branch\"        meddler:\"build_branch\"`\n\tRef      string `json:\"ref\"           meddler:\"build_ref\"`\n\tRefspec  string `json:\"refspec\"       meddler:\"build_refspec\"`\n\tRemote   string `json:\"remote\"        meddler:\"build_remote\"`\n\tTitle    string `json:\"title\"         meddler:\"build_title\"`\n\tMessage  string `json:\"message\"       meddler:\"build_message\"`\n\tAuthor   string `json:\"author\"        meddler:\"build_author\"`\n\tAvatar   string `json:\"author_avatar\" meddler:\"build_avatar\"`\n\tEmail    string `json:\"author_email\"  meddler:\"build_email\"`\n}\n```\nFeed represents an item in the user's feed or timeline.\n\nswagger:model feed\n\n```go\ntype Job struct {\n\tID       int64  `json:\"id\"           meddler:\"job_id,pk\"`\n\tBuildID  int64  `json:\"-\"            meddler:\"job_build_id\"`\n\tNodeID   int64  `json:\"-\"            meddler:\"job_node_id\"`\n\tNumber   int    `json:\"number\"       meddler:\"job_number\"`\n\tError    string `json:\"error\"        meddler:\"-\"`\n\tStatus   string `json:\"status\"       meddler:\"job_status\"`\n\tExitCode int    `json:\"exit_code\"    meddler:\"job_exit_code\"`\n\tEnqueued int64  `json:\"enqueued_at\"  meddler:\"job_enqueued\"`\n\tStarted  int64  `json:\"started_at\"   meddler:\"job_started\"`\n\tFinished int64  `json:\"finished_at\"  meddler:\"job_finished\"`\n\n\tEnvironment map[string]string `json:\"environment\" meddler:\"job_environment,json\"`\n}\n```\nswagger:model job\n\n```go\ntype Key struct {\n\tID      int64  `json:\"-\"       meddler:\"key_id,pk\"`\n\tRepoID  int64  `json:\"-\"       meddler:\"key_repo_id\"`\n\tPublic  string `json:\"public\"  meddler:\"key_public\"`\n\tPrivate string `json:\"private\" meddler:\"key_private\"`\n}\n```\n\n```go\ntype Log struct {\n\tID    int64  `meddler:\"log_id,pk\"`\n\tJobID int64  `meddler:\"log_job_id\"`\n\tData  []byte `meddler:\"log_data\"`\n}\n```\n\n```go\ntype Netrc struct {\n\tMachine  string `json:\"machine\"`\n\tLogin    string `json:\"login\"`\n\tPassword string `json:\"user\"`\n}\n```\n\n```go\ntype Node struct {\n\tID   int64  `meddler:\"node_id,pk\" json:\"id\"`\n\tAddr string `meddler:\"node_addr\"  json:\"address\"`\n\tArch string `meddler:\"node_arch\"  json:\"architecture\"`\n\tCert string `meddler:\"node_cert\"  json:\"-\"`\n\tKey  string `meddler:\"node_key\"   json:\"-\"`\n\tCA   string `meddler:\"node_ca\"    json:\"-\"`\n}\n```\n\n```go\ntype Perm struct {\n\tPull  bool `json:\"pull\"`\n\tPush  bool `json:\"push\"`\n\tAdmin bool `json:\"admin\"`\n}\n```\n\n```go\ntype Registry struct {\n\tID       int64  `json:\"id\"       meddler:\"registry_id,pk\"`\n\tRepoID   int64  `json:\"-\"        meddler:\"registry_repo_id\"`\n\tAddr     string `json:\"addr\"     meddler:\"registry_addr\"`\n\tUsername string `json:\"username\" meddler:\"registry_username\"`\n\tPassword string `json:\"password\" meddler:\"registry_password\"`\n\tEmail    string `json:\"email\"    meddler:\"registry_email\"`\n\tToken    string `json:\"token\"    meddler:\"registry_token\"`\n}\n```\n\n```go\nfunc (r *Registry) Validate() error\n```\n\n```go\ntype Repo struct {\n\tID          int64  `json:\"id\"                meddler:\"repo_id,pk\"`\n\tUserID      int64  `json:\"-\"                 meddler:\"repo_user_id\"`\n\tOwner       string `json:\"owner\"             meddler:\"repo_owner\"`\n\tName        string `json:\"name\"              meddler:\"repo_name\"`\n\tFullName    string `json:\"full_name\"         meddler:\"repo_full_name\"`\n\tAvatar      string `json:\"avatar_url\"        meddler:\"repo_avatar\"`\n\tLink        string `json:\"link_url\"          meddler:\"repo_link\"`\n\tKind        string `json:\"scm\"               meddler:\"repo_scm\"`\n\tClone       string `json:\"clone_url\"         meddler:\"repo_clone\"`\n\tBranch      string `json:\"default_branch\"    meddler:\"repo_branch\"`\n\tTimeout     int64  `json:\"timeout\"           meddler:\"repo_timeout\"`\n\tIsPrivate   bool   `json:\"private\"           meddler:\"repo_private\"`\n\tIsTrusted   bool   `json:\"trusted\"           meddler:\"repo_trusted\"`\n\tIsStarred   bool   `json:\"starred,omitempty\" meddler:\"-\"`\n\tAllowPull   bool   `json:\"allow_pr\"          meddler:\"repo_allow_pr\"`\n\tAllowPush   bool   `json:\"allow_push\"        meddler:\"repo_allow_push\"`\n\tAllowDeploy bool   `json:\"allow_deploys\"     meddler:\"repo_allow_deploys\"`\n\tAllowTag    bool   `json:\"allow_tags\"        meddler:\"repo_allow_tags\"`\n\tHash        string `json:\"-\"                 meddler:\"repo_hash\"`\n}\n```\nRepo represents a repository.\n\nswagger:model repo\n\n```go\ntype RepoLite struct {\n\tOwner    string `json:\"owner\"`\n\tName     string `json:\"name\"`\n\tFullName string `json:\"full_name\"`\n\tAvatar   string `json:\"avatar_url\"`\n}\n```\n\n```go\ntype Secret struct {\n\t// the id for this secret.\n\tID int64 `json:\"id\" meddler:\"secret_id,pk\"`\n\n\t// the foreign key for this secret.\n\tRepoID int64 `json:\"-\" meddler:\"secret_repo_id\"`\n\n\t// the name of the secret which will be used as the environment variable\n\t// name at runtime.\n\tName string `json:\"name\" meddler:\"secret_name\"`\n\n\t// the value of the secret which will be provided to the runtime environment\n\t// as a named environment variable.\n\tValue string `json:\"value\" meddler:\"secret_value\"`\n\n\t// the secret is restricted to this list of images.\n\tImages []string `json:\"image,omitempty\" meddler:\"secret_images,json\"`\n\n\t// the secret is restricted to this list of events.\n\tEvents []string `json:\"event,omitempty\" meddler:\"secret_events,json\"`\n}\n```\n\n```go\nfunc (s *Secret) Match(image, event string) bool\n```\nMatch returns true if an image and event match the restricted list.\n\n```go\nfunc (s *Secret) MatchEvent(event string) bool\n```\nMatchEvent returns true if an event matches the restricted list.\n\n```go\nfunc (s *Secret) MatchImage(image string) bool\n```\nMatchImage returns true if an image matches the restricted list.\n\n```go\nfunc (s *Secret) Validate() error\n```\nValidate validates the required fields and formats.\n\n```go\ntype System struct {\n\tVersion   string   `json:\"version\"`\n\tLink      string   `json:\"link_url\"`\n\tPlugins   []string `json:\"plugins\"`\n\tGlobals   []string `json:\"globals\"`\n\tEscalates []string `json:\"privileged_plugins\"`\n}\n```\n\n```go\ntype User struct {\n\t// the id for this user.\n\t//\n\t// required: true\n\tID int64 `json:\"id\" meddler:\"user_id,pk\"`\n\n\t// Login is the username for this user.\n\t//\n\t// required: true\n\tLogin string `json:\"login\"  meddler:\"user_login\"`\n\n\t// Token is the oauth2 token.\n\tToken string `json:\"-\"  meddler:\"user_token\"`\n\n\t// Secret is the oauth2 token secret.\n\tSecret string `json:\"-\" meddler:\"user_secret\"`\n\n\t// Expiry is the token and secret expriation timestamp.\n\tExpiry int64 `json:\"-\" meddler:\"user_expiry\"`\n\n\t// Email is the email address for this user.\n\t//\n\t// required: true\n\tEmail string `json:\"email\" meddler:\"user_email\"`\n\n\t// the avatar url for this user.\n\tAvatar string `json:\"avatar_url\" meddler:\"user_avatar\"`\n\n\t// Activate indicates the user is active in the system.\n\tActive bool `json:\"active,\" meddler:\"user_active\"`\n\n\t// Admin indicates the user is a system administrator.\n\tAdmin bool `json:\"admin,\" meddler:\"user_admin\"`\n\n\t// Hash is a unique token used to sign tokens.\n\tHash string `json:\"-\" meddler:\"user_hash\"`\n}\n```\nUser represents a registered user.\n\nswagger:model user\n\n","path":"github.com/Coding/drone/model","name":"model","synopsis":"","isRedistributable":true}
