Documentation ¶
Index ¶
- Constants
- Variables
- func IsNotFound(err error) bool
- func MembershipTypeHierarchyLevel(membershipType string) int
- func RandomTotpSecret() string
- func RegisterBillingEvent(event BillingEventData)
- func ValidateOrganization(u *Organization) error
- func ValidateProject(u *Project) error
- func ValidateRepository(u *Repository) error
- func ValidateTarget(t *Target) error
- func ValidateUser(u *User) error
- type Activity
- func (self *Activity) Audience() []string
- func (self *Activity) JobUuid() string
- func (self *Activity) ProjectUuid() string
- func (self *Activity) SetAudience(audience []string) *Activity
- func (self *Activity) SetJobUuid(jobUuid string) *Activity
- func (self *Activity) SetProjectUuid(projectUuid string) *Activity
- func (self *Activity) SubscriptionKey() string
- type ActivityActor
- type ActivityOnStream
- func (self *ActivityOnStream) Embed(k string, subject Subject)
- func (self *ActivityOnStream) Embedded() map[string][]Subject
- func (self *ActivityOnStream) FindUser(users UserStore) (*User, error)
- func (self *ActivityOnStream) Links(response map[string]map[string]string, requestScheme, requestBase string) map[string]map[string]string
- func (self *ActivityOnStream) OwnUrl(requestBase, requestScheme string) string
- type Archiver
- type BasicRepositoryCredential
- type BillingCreditCardAdded
- type BillingEvent
- type BillingEventData
- type BillingExtraLimitsGranted
- type BillingHistory
- func (self *BillingHistory) CreditCardsFor(organizationUuid string) []*CreditCard
- func (self *BillingHistory) ExtraProjectsFor(organizationUuid string) int
- func (self *BillingHistory) ExtraUsersFor(organizationUuid string) int
- func (self *BillingHistory) ExtrasGrantedTo(organizationUuid string) []*BillingEvent
- func (self *BillingHistory) HandleEvent(event *BillingEvent)
- func (self *BillingHistory) PlanUuidFor(organizationUuid string) string
- func (self *BillingHistory) Subscription(subscriptionId string) *BillingPlanSubscription
- func (self *BillingHistory) SubscriptionFor(organizationUuid string) *BillingPlanSubscription
- type BillingPlan
- func (self *BillingPlan) Embed(k string, subject Subject)
- func (self *BillingPlan) Embedded() map[string][]Subject
- func (self *BillingPlan) EnsureDefaultPrice()
- func (self *BillingPlan) Links(response map[string]map[string]string, requestScheme, requestBase string) map[string]map[string]string
- func (self *BillingPlan) OwnUrl(requestScheme, requestBase string) string
- func (self *BillingPlan) ProjectsExceedingLimit(projects int) int
- func (self *BillingPlan) UsersExceedingLimit(members int) int
- type BillingPlanSelected
- type BillingPlanSubscription
- type BillingPlanSubscriptionChanged
- type ChangedRepositoryRef
- type CreditCard
- type Currency
- type DeliveredRequest
- type Delivery
- func (self *Delivery) AuthorizationName() string
- func (self *Delivery) Embed(k string, subject Subject)
- func (self *Delivery) Embedded() map[string][]Subject
- func (self *Delivery) FindProject(projects ProjectStore) (*Project, error)
- func (self *Delivery) GitRef() string
- func (self *Delivery) Links(response map[string]map[string]string, requestScheme, requestBase string) map[string]map[string]string
- func (self *Delivery) OperationParameters(projectUuid string, repositories RepositoriesByName) *OperationParameters
- func (self *Delivery) OwnUrl(requestScheme, requestBase string) string
- func (self *Delivery) RepositoryName() string
- type DeliveryStore
- type Dictionary
- func (dictionary Dictionary) Get(key string) interface{}
- func (dictionary Dictionary) MarshalJSON() ([]byte, error)
- func (dictionary *Dictionary) Scan(data interface{}) error
- func (dictionary Dictionary) Set(key string, value interface{}) Dictionary
- func (dictionary *Dictionary) UnmarshalJSON(data []byte) error
- func (dictionary Dictionary) Value() (driver.Value, error)
- type EmailNotifier
- func (self *EmailNotifier) AuthorizationName() string
- func (self *EmailNotifier) Embed(k string, subject Subject)
- func (self *EmailNotifier) Embedded() map[string][]Subject
- func (self *EmailNotifier) FindProject(projects ProjectStore) (*Project, error)
- func (self *EmailNotifier) Links(response map[string]map[string]string, requestScheme, requestBase string) map[string]map[string]string
- func (self *EmailNotifier) OwnUrl(requestScheme, requestBase string) string
- func (self *EmailNotifier) Validate() error
- type Environment
- func (self *Environment) AuthorizationName() string
- func (self *Environment) CreationDate() time.Time
- func (self *Environment) Embed(k string, subject Subject)
- func (self *Environment) Embedded() map[string][]Subject
- func (self *Environment) Equal(b *Environment) bool
- func (self *Environment) FindProject(store ProjectStore) (*Project, error)
- func (self *Environment) Get(variable string) string
- func (self *Environment) Id() string
- func (self *Environment) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *Environment) NewSecret(name string, kind SecretType) *Secret
- func (self *Environment) OwnUrl(requestScheme, requestBaseUri string) string
- func (self *Environment) PruneVariables()
- func (self *Environment) Set(variable, value string) *Environment
- type EnvironmentSecret
- func (self *EnvironmentSecret) AsPrivileged() (*PrivilegedEnvironmentSecret, error)
- func (self *EnvironmentSecret) AsSecret() (*Secret, error)
- func (self *EnvironmentSecret) AsUnprivileged() (*UnprivilegedEnvironmentSecret, error)
- func (self EnvironmentSecret) Embed(k string, subject Subject)
- func (self EnvironmentSecret) Embedded() map[string][]Subject
- type EnvironmentStore
- type EnvironmentVariable
- type EnvironmentVariableChanges
- type EnvironmentVariables
- func (self EnvironmentVariables) Diff(other EnvironmentVariables) *EnvironmentVariableChanges
- func (self *EnvironmentVariables) MarshalJSON() ([]byte, error)
- func (self *EnvironmentVariables) Scan(value interface{}) error
- func (self *EnvironmentVariables) UnmarshalJSON(data []byte) error
- func (self EnvironmentVariables) Value() (driver.Value, error)
- type EventPayload
- type ExecutionsByTime
- type Feature
- func (self *Feature) Embed(k string, subject Subject)
- func (self *Feature) Embedded() map[string][]Subject
- func (self *Feature) Links(response map[string]map[string]string, requestScheme string, ...) map[string]map[string]string
- func (self *Feature) OwnUrl(requestScheme string, requestBaseUri string) string
- type GitLogEntry
- type GitLogs
- type GitTrigger
- func (self *GitTrigger) AuthorizationName() string
- func (self *GitTrigger) Embed(k string, subject Subject)
- func (self *GitTrigger) Embedded() map[string][]Subject
- func (self *GitTrigger) FindProject(store ProjectStore) (*Project, error)
- func (self *GitTrigger) ForChangeType(changeType string) *GitTrigger
- func (self *GitTrigger) ForJob(jobUuid string) *GitTrigger
- func (self *GitTrigger) InProject(projectUuid string) *GitTrigger
- func (self *GitTrigger) InRepository(repositoryUuid string) *GitTrigger
- func (self *GitTrigger) Links(response map[string]map[string]string, requestScheme, requestBase string) map[string]map[string]string
- func (self *GitTrigger) Match(activity *Activity) bool
- func (self *GitTrigger) MatchingRef(refspec string) *GitTrigger
- func (self *GitTrigger) OwnUrl(requestScheme, requestBase string) string
- func (self *GitTrigger) Validate() error
- type ISODate
- type Invitation
- func (self *Invitation) Accept(invitee *User)
- func (self *Invitation) AuthorizationName() string
- func (self *Invitation) CallToActionPath(users UserStore) string
- func (self *Invitation) Embed(k string, subject Subject)
- func (self *Invitation) Embedded() map[string][]Subject
- func (self *Invitation) FindOrganization(store OrganizationStore) (*Organization, error)
- func (self *Invitation) FindProject(store ProjectStore) (*Project, error)
- func (self *Invitation) FindUser(store UserStore) (*User, error)
- func (self *Invitation) IsAccepted() bool
- func (self *Invitation) IsOpen() bool
- func (self *Invitation) IsRefused() bool
- func (self *Invitation) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *Invitation) NewProjectMembership() *ProjectMembership
- func (self *Invitation) OwnUrl(requestScheme, requestBaseUri string) string
- func (self *Invitation) OwnedBy(user *User) bool
- func (self *Invitation) Refuse()
- func (self *Invitation) Validate() error
- type InvitationStore
- type Job
- func (self *Job) AuthorizationName() string
- func (self *Job) CreationDate() time.Time
- func (self *Job) Embed(k string, subject Subject)
- func (self *Job) Embedded() map[string][]Subject
- func (self *Job) FindProject(store ProjectStore) (*Project, error)
- func (self *Job) FindRecentOperations(operations RecentOperations) error
- func (self *Job) Id() string
- func (self *Job) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *Job) NewJobNotifier() *JobNotifier
- func (self *Job) NewOperation(wsbiUuid string) *Operation
- func (self *Job) NewRecurringSchedule(initiatorUuid string, cronexpr string) *Schedule
- func (self *Job) OwnUrl(requestScheme, requestBaseUri string) string
- func (self *Job) WatchableEvents() []string
- func (self *Job) WatchableType() string
- type JobNotifier
- func (self *JobNotifier) AuthorizationName() string
- func (self *JobNotifier) Embed(k string, subject Subject)
- func (self *JobNotifier) Embedded() map[string][]Subject
- func (self *JobNotifier) FindProject(projects ProjectStore) (*Project, error)
- func (self *JobNotifier) Links(response map[string]map[string]string, requestScheme, requestBase string) map[string]map[string]string
- func (self *JobNotifier) OwnUrl(requestScheme, requestBase string) string
- func (self *JobNotifier) Validate() error
- func (self *JobNotifier) WebhookSlug() string
- type JobOperationVars
- type JobStore
- type Limits
- func (self *Limits) AuthorizationName() string
- func (self *Limits) Embed(k string, subject Subject)
- func (self *Limits) Embedded() map[string][]Subject
- func (self *Limits) Exceeded() bool
- func (self *Limits) FindOrganization(organizations OrganizationStore) (*Organization, error)
- func (self *Limits) FindProject(store ProjectStore) (*Project, error)
- func (self *Limits) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *Limits) MarshalJSON() ([]byte, error)
- func (self *Limits) OwnUrl(requestScheme, requestBaseUri string) string
- type LimitsComparedToPlan
- type LogLine
- type LogSubscription
- type Loggable
- func (self *Loggable) AuthorizationName() string
- func (self *Loggable) Embed(k string, subject Subject)
- func (self *Loggable) Embedded() map[string][]Subject
- func (self *Loggable) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *Loggable) MustMarshal() []byte
- func (self *Loggable) OwnUrl(requestScheme, requestBaseUri string) string
- func (self *Loggable) Wrap() *LoggableWrapper
- type LoggableWrapper
- type MapPayload
- type Money
- func (self Money) Cents() int
- func (self Money) Equal(other *Money) bool
- func (self Money) MarshalJSON() ([]byte, error)
- func (self *Money) Scan(src interface{}) error
- func (self Money) String() string
- func (self *Money) UnmarshalJSON(src []byte) error
- func (self Money) Value() interface{}
- func (self Money) Whole() int
- type NotFoundError
- type NotificationRule
- func (self *NotificationRule) AppliesToJob(jobUuid string) bool
- func (self *NotificationRule) AuthorizationName() string
- func (self *NotificationRule) Embed(k string, subject Subject)
- func (self *NotificationRule) Embedded() map[string][]Subject
- func (self *NotificationRule) FindProject(projects ProjectStore) (*Project, error)
- func (self *NotificationRule) Links(response map[string]map[string]string, requestScheme, requestBase string) map[string]map[string]string
- func (self *NotificationRule) Matches(activity *Activity) bool
- func (self *NotificationRule) OwnUrl(requestScheme, requestBase string) string
- func (self *NotificationRule) Validate() error
- type OAuthToken
- func (self *OAuthToken) AuthorizationName() string
- func (self *OAuthToken) Embed(k string, subject Subject)
- func (self *OAuthToken) Embedded() map[string][]Subject
- func (self *OAuthToken) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *OAuthToken) OwnUrl(requestScheme, requestBaseUri string) string
- func (self *OAuthToken) OwnedBy(user *User) bool
- type Operation
- func (self *Operation) AddLogEvent(e *logevent.Message)
- func (self *Operation) AuthorizationName() string
- func (self *Operation) Category() string
- func (self *Operation) Embed(k string, subject Subject)
- func (self *Operation) Embedded() map[string][]Subject
- func (self *Operation) Environment(store EnvironmentStore) (*Environment, error)
- func (self *Operation) FindJob(store JobStore) (*Job, error)
- func (self *Operation) FindProject(store ProjectStore) (*Project, error)
- func (self *Operation) FindWorkspaceBaseImage(store WorkspaceBaseImageStore) (*WorkspaceBaseImage, error)
- func (self *Operation) HandleEvent(payload EventPayload)
- func (self *Operation) IsGitAccessCheck() bool
- func (self *Operation) IsGitMetadataCollect() bool
- func (self *Operation) IsReady(repos RepositoryStore, credentials RepositoryCredentialStore, ...) (bool, error)
- func (self *Operation) IsUserJob() bool
- func (self *Operation) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *Operation) NewScriptVars(tasks TaskStore, repositories RepositoryStore) (interface{}, error)
- func (self *Operation) NewSetupScriptCtxt(wsbi *WorkspaceBaseImage, project *Project) (*OperationSetupScriptCtxt, error)
- func (self *Operation) OwnUrl(requestScheme, requestBaseUri string) string
- func (self *Operation) Repositories(store RepositoryStore) ([]*Repository, error)
- func (self *Operation) Secrets(es EnvironmentStore, ss SecretStore) ([]*Secret, error)
- func (self *Operation) ShieldsIoStatusColorAndParams() (string, string)
- func (self *Operation) Status() string
- func (self *Operation) Successful() bool
- func (self *Operation) Task(store TaskStore) (*Task, error)
- func (self *Operation) UuidBigInt() big.Int
- type OperationParameters
- type OperationSecret
- type OperationSetupScriptCtxt
- func (vars *OperationSetupScriptCtxt) AddKey(belongsTo, name, private, public string) *OperationSetupScriptCtxt
- func (vars *OperationSetupScriptCtxt) AddSshConfig(repository *Repository, repostioryCredential *RepositoryCredential) *OperationSetupScriptCtxt
- func (self *OperationSetupScriptCtxt) LoadPreviousOperation(operations OperationStore) error
- func (self *OperationSetupScriptCtxt) LoadWebhookBody(deliveries DeliveryStore) error
- type OperationStore
- type OperationTriggerReason
- type Organization
- func (self *Organization) AuthorizationName() string
- func (self *Organization) CreationDate() time.Time
- func (self *Organization) DeletionDate() time.Time
- func (self *Organization) Embed(k string, subject Subject)
- func (self *Organization) Embedded() map[string][]Subject
- func (self *Organization) FindOrganization(store OrganizationStore) (*Organization, error)
- func (self *Organization) FindProject(store ProjectStore) (*Project, error)
- func (self *Organization) Id() string
- func (self *Organization) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *Organization) NewBillingEvent(data BillingEventData) *BillingEvent
- func (self *Organization) OwnUrl(requestScheme, requestBaseUri string) string
- type OrganizationMember
- func (self *OrganizationMember) AuthorizationName() string
- func (self *OrganizationMember) Capabilities() []string
- func (self *OrganizationMember) Embed(k string, subject Subject)
- func (self *OrganizationMember) Embedded() map[string][]Subject
- func (self *OrganizationMember) FindOrganization(organizations OrganizationStore) (*Organization, error)
- func (self *OrganizationMember) FindUser(users UserStore) (*User, error)
- func (self *OrganizationMember) Links(response map[string]map[string]string, requestScheme, requestBase string) map[string]map[string]string
- func (self *OrganizationMember) OwnUrl(requestScheme, requestBase string) string
- func (self *OrganizationMember) OwnedBy(user *User) bool
- type OrganizationMembership
- func (self *OrganizationMembership) AuthorizationName() string
- func (self *OrganizationMembership) Embed(k string, subject Subject)
- func (self *OrganizationMembership) Embedded() map[string][]Subject
- func (self *OrganizationMembership) FindOrganization(organizations OrganizationStore) (*Organization, error)
- func (self *OrganizationMembership) FindUser(users UserStore) (*User, error)
- func (self *OrganizationMembership) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *OrganizationMembership) OwnUrl(requestScheme, requestBaseUri string) string
- func (self *OrganizationMembership) OwnedBy(user *User) bool
- type OrganizationStore
- type Person
- type PrivilegedEnvironmentSecret
- type PrivilegedSshSecret
- type Project
- func (self *Project) AuthorizationName() string
- func (self *Project) CreationDate() time.Time
- func (self *Project) DeletionDate() time.Time
- func (self *Project) Embed(k string, subject Subject)
- func (self *Project) Embedded() map[string][]Subject
- func (self *Project) FindOrganization(store OrganizationStore) (*Organization, error)
- func (self *Project) FindProject(store ProjectStore) (*Project, error)
- func (self *Project) Id() string
- func (self *Project) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *Project) NewDefaultEnvironment() *Environment
- func (self *Project) NewEmailNotifier(recipient, urlHost string) *EmailNotifier
- func (self *Project) NewEnvironment(name string) *Environment
- func (self *Project) NewGitTrigger(name, creatorUuid, jobUuid string) *GitTrigger
- func (self *Project) NewInvitationToHarrow(name, email, message string, membership string) *Invitation
- func (self *Project) NewInvitationToUser(message string, membership string, recipient *User) *Invitation
- func (self *Project) NewJob(name, taskUuid, environmentUuid string) *Job
- func (self *Project) NewMembership(member *User, membershipType string) *ProjectMembership
- func (self *Project) NewNotificationRule(notifierType, notifierUuid, jobUuid, matchActivities string) *NotificationRule
- func (self *Project) NewRepository(name, url string) *Repository
- func (self *Project) NewTask(name, body string) *Task
- func (self *Project) OwnUrl(requestScheme, requestBaseUri string) string
- type ProjectCard
- func (self *ProjectCard) AuthorizationName() string
- func (self *ProjectCard) Embed(k string, subject Subject)
- func (self *ProjectCard) Embedded() map[string][]Subject
- func (self *ProjectCard) FindOrganization(organizations OrganizationStore) (*Organization, error)
- func (self *ProjectCard) FindProject(projects ProjectStore) (*Project, error)
- func (self *ProjectCard) Links(response map[string]map[string]string, requestScheme string, ...) map[string]map[string]string
- func (self *ProjectCard) OwnUrl(requestScheme, requestBase string) string
- type ProjectMember
- func (self *ProjectMember) AddMember(userUuid string, membershipType string, ...) (string, error)
- func (self *ProjectMember) AuthorizationName() string
- func (self *ProjectMember) Capabilities() []string
- func (self *ProjectMember) Embed(k string, subject Subject)
- func (self *ProjectMember) Embedded() map[string][]Subject
- func (self *ProjectMember) FindProject(projects ProjectStore) (*Project, error)
- func (self *ProjectMember) FindUser(users UserStore) (*User, error)
- func (self *ProjectMember) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *ProjectMember) OwnUrl(requestScheme, requestBaseUri string) string
- func (self *ProjectMember) OwnedBy(user *User) bool
- func (self *ProjectMember) Promote(other *ProjectMember) error
- func (self *ProjectMember) Remove(other *ProjectMember, projectMemberships Archiver) error
- func (self *ProjectMember) ToMembership() *ProjectMembership
- type ProjectMembership
- func (self *ProjectMembership) AuthorizationName() string
- func (self *ProjectMembership) Embed(k string, subject Subject)
- func (self *ProjectMembership) Embedded() map[string][]Subject
- func (self *ProjectMembership) FindProject(project ProjectStore) (*Project, error)
- func (self *ProjectMembership) FindUser(users UserStore) (*User, error)
- func (self *ProjectMembership) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *ProjectMembership) OwnUrl(requestScheme, requestUri string) string
- func (self *ProjectMembership) OwnedBy(user *User) bool
- type ProjectMembershipCreator
- type ProjectStore
- type RecentOperations
- type RepositoriesByName
- type Repository
- func (self *Repository) AuthorizationName() string
- func (self *Repository) CloneURL() string
- func (self *Repository) ClonedGit(OS git.System, credentials RepositoryCredentialStore) (*git.ClonedRepository, error)
- func (self *Repository) Embed(k string, subject Subject)
- func (self *Repository) Embedded() map[string][]Subject
- func (self *Repository) FindProject(store ProjectStore) (*Project, error)
- func (self *Repository) Git() (*git.Repository, error)
- func (self *Repository) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *Repository) NewMetadataUpdateOperation() *Operation
- func (self *Repository) OwnUrl(requestScheme, requestBaseUri string) string
- func (self *Repository) PublicURL() string
- func (self *Repository) SetCredential(credential *RepositoryCredential) *Repository
- type RepositoryCheckout
- type RepositoryCheckouts
- func (self *RepositoryCheckouts) HandleEvent(payload EventPayload)
- func (self *RepositoryCheckouts) Hash(repositoryUuid string) string
- func (self *RepositoryCheckouts) Ref(repositoryUuid string) string
- func (self *RepositoryCheckouts) Scan(data interface{}) error
- func (self *RepositoryCheckouts) Value() (driver.Value, error)
- type RepositoryCredential
- func (self *RepositoryCredential) AuthorizationName() string
- func (self *RepositoryCredential) Embed(k string, subject Subject)
- func (self *RepositoryCredential) Embedded() map[string][]Subject
- func (self *RepositoryCredential) FindProject(store ProjectStore) (*Project, error)
- func (self *RepositoryCredential) IsBasic() bool
- func (self *RepositoryCredential) IsPending() bool
- func (self *RepositoryCredential) IsSsh() bool
- func (self *RepositoryCredential) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *RepositoryCredential) OwnUrl(requestScheme, requestBaseUri string) string
- type RepositoryCredentialStatus
- type RepositoryCredentialStore
- type RepositoryCredentialType
- type RepositoryCredentialTypeError
- type RepositoryMetaData
- func (self *RepositoryMetaData) Changes(newVersion *RepositoryMetaData) *RepositoryMetaDataChanges
- func (self *RepositoryMetaData) IsEmpty() bool
- func (self *RepositoryMetaData) Scan(value interface{}) error
- func (self *RepositoryMetaData) Value() (driver.Value, error)
- func (self *RepositoryMetaData) WithRef(symbolic, hash string) *RepositoryMetaData
- type RepositoryMetaDataChanges
- func (self *RepositoryMetaDataChanges) Add(ref *RepositoryRef) *RepositoryMetaDataChanges
- func (self *RepositoryMetaDataChanges) Added() []*RepositoryRef
- func (self *RepositoryMetaDataChanges) Change(symbolic, oldHash, newHash string) *RepositoryMetaDataChanges
- func (self *RepositoryMetaDataChanges) Changed() []*ChangedRepositoryRef
- func (self *RepositoryMetaDataChanges) Remove(ref *RepositoryRef) *RepositoryMetaDataChanges
- func (self *RepositoryMetaDataChanges) Removed() []*RepositoryRef
- type RepositoryOperationVars
- type RepositoryRef
- type RepositoryStore
- type Schedulable
- type Schedule
- func (self *Schedule) AuthorizationName() string
- func (self *Schedule) Embed(k string, subject Subject)
- func (self *Schedule) Embedded() map[string][]Subject
- func (self *Schedule) FindProject(store ProjectStore) (*Project, error)
- func (self *Schedule) FindUser(store UserStore) (*User, error)
- func (self *Schedule) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *Schedule) OperationParameters() *OperationParameters
- func (self *Schedule) OwnUrl(requestScheme, requestBaseUri string) string
- func (self *Schedule) OwnedBy(user *User) bool
- func (self *Schedule) Validate() error
- type ScheduledExecution
- func (self *ScheduledExecution) AuthorizationName() string
- func (self *ScheduledExecution) Embed(k string, subject Subject)
- func (self *ScheduledExecution) Embedded() map[string][]Subject
- func (self *ScheduledExecution) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *ScheduledExecution) OwnUrl(requestScheme, requestBaseUri string) string
- type ScriptCard
- func (self *ScriptCard) AuthorizationName() string
- func (self *ScriptCard) Embed(k string, subject Subject)
- func (self *ScriptCard) Embedded() map[string][]Subject
- func (self *ScriptCard) FindProject(projects ProjectStore) (*Project, error)
- func (self *ScriptCard) Links(response map[string]map[string]string, requestScheme string, ...) map[string]map[string]string
- func (self *ScriptCard) OwnUrl(requestScheme string, requestBaseUri string) string
- type Secret
- func (self *Secret) AuthorizationName() string
- func (self *Secret) Embed(k string, subject Subject)
- func (self *Secret) Embedded() map[string][]Subject
- func (self *Secret) FindProject(store ProjectStore) (*Project, error)
- func (self *Secret) IsEnv() bool
- func (self *Secret) IsEnvOverride() bool
- func (self *Secret) IsPending() bool
- func (self *Secret) IsSsh() bool
- func (self *Secret) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *Secret) OwnUrl(requestScheme, requestBaseUri string) string
- type SecretStatus
- type SecretStore
- type SecretType
- type Session
- func (self *Session) AuthorizationName() string
- func (self *Session) Embed(k string, subject Subject)
- func (self *Session) Embedded() map[string][]Subject
- func (self *Session) FindUser(store UserStore) (*User, error)
- func (s *Session) IsExpired() bool
- func (s *Session) IsInvalidated() bool
- func (self *Session) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (s *Session) LogOut()
- func (self *Session) OwnUrl(requestScheme, requestBaseUri string) string
- func (self *Session) OwnedBy(user *User) bool
- func (s *Session) Validate() error
- type Set
- type SlackNotifier
- func (self *SlackNotifier) AuthorizationName() string
- func (self *SlackNotifier) Embed(k string, subject Subject)
- func (self *SlackNotifier) Embedded() map[string][]Subject
- func (self *SlackNotifier) FindProject(projects ProjectStore) (*Project, error)
- func (self *SlackNotifier) Links(response map[string]map[string]string, requestScheme, requestBase string) map[string]map[string]string
- func (self *SlackNotifier) OwnUrl(requestScheme, requestBase string) string
- func (self *SlackNotifier) Validate() error
- type SshRepositoryCredential
- type SshSecret
- type StatusLogEntry
- type StatusLogs
- func (self *StatusLogs) HandleEvent(payload EventPayload)
- func (self *StatusLogs) Len() int
- func (self *StatusLogs) Less(i, j int) bool
- func (self *StatusLogs) Log(entry *StatusLogEntry) *StatusLogs
- func (self *StatusLogs) Newest() *StatusLogEntry
- func (self *StatusLogs) Scan(data interface{}) error
- func (self *StatusLogs) Swap(i, j int)
- func (self *StatusLogs) Value() (driver.Value, error)
- type Stencil
- func (self *Stencil) AuthorizationName() string
- func (self *Stencil) Embed(k string, subject Subject)
- func (self *Stencil) Embedded() map[string][]Subject
- func (self *Stencil) FindProject(projects ProjectStore) (*Project, error)
- func (self *Stencil) Links(response map[string]map[string]string, requestScheme, requestBase string) map[string]map[string]string
- func (self *Stencil) OwnUrl(requestScheme, requestBase string) string
- func (self *Stencil) Validate() error
- type Subject
- type Subscription
- type SubscriptionStore
- type Subscriptions
- func (self *Subscriptions) AuthorizationName() string
- func (self *Subscriptions) Embed(k string, subject Subject)
- func (self *Subscriptions) Embedded() map[string][]Subject
- func (self *Subscriptions) FindUser(users UserStore) (*User, error)
- func (self *Subscriptions) Links(response map[string]map[string]string, requestScheme, requestBase string) map[string]map[string]string
- func (self *Subscriptions) OwnUrl(requestScheme, requestBase string) string
- func (self *Subscriptions) OwnedBy(user *User) bool
- type Target
- func (self *Target) AuthorizationName() string
- func (self *Target) Embed(k string, subject Subject)
- func (self *Target) Embedded() map[string][]Subject
- func (self *Target) FindProject(projects ProjectStore) (*Project, error)
- func (self *Target) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *Target) OwnUrl(requestScheme, requestBaseUri string) string
- type Task
- func (self *Task) AuthorizationName() string
- func (self *Task) CreationDate() time.Time
- func (self *Task) Embed(k string, subject Subject)
- func (self *Task) Embedded() map[string][]Subject
- func (self *Task) FindProject(store ProjectStore) (*Project, error)
- func (self *Task) Id() string
- func (self *Task) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *Task) NewJob(environment *Environment) *Job
- func (self *Task) OwnUrl(requestScheme, requestBaseUri string) string
- type TaskStore
- type TotpToken
- type TotpTokenWithClock
- type UnprivilegedEnvironmentSecret
- type UnprivilegedSshSecret
- type User
- func (self *User) AuthorizationName() string
- func (self *User) Capabilities() []string
- func (self *User) CurrentTotpToken() int32
- func (self *User) DisableTotp(token int32) error
- func (self *User) Embed(k string, subject Subject)
- func (self *User) Embedded() map[string][]Subject
- func (self *User) EnableTotp(token int32) error
- func (self *User) FindProject(store ProjectStore) (*Project, error)
- func (self *User) FindUser(store UserStore) (*User, error)
- func (self *User) GenerateTotpSecret()
- func (self *User) HMAC(key []byte) []byte
- func (self *User) InvitedTo(project *Project, invitations InvitationStore) (bool, error)
- func (self *User) IsSubscribedTo(watchable Watchable, event string, subscriptions SubscriptionStore) (bool, error)
- func (self *User) IsValidTotpToken(token int32) bool
- func (self *User) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- func (self *User) NewBlock(reason string) (*UserBlock, error)
- func (self *User) NewSession(userAgent, clientAddress string) *Session
- func (self *User) OwnUrl(requestScheme, requestBaseUri string) string
- func (self *User) OwnedBy(user *User) bool
- func (self *User) Scrub() *User
- func (self *User) SubscribeTo(watchable Watchable, event string, subscriptions SubscriptionStore) error
- func (self *User) SubscriptionsFor(watchable Watchable, allSubscriptions SubscriptionStore) (*Subscriptions, error)
- func (self *User) TotpEnabled() bool
- func (self *User) UnsubscribeFrom(watchable Watchable, event string, subscriptions SubscriptionStore) error
- func (self *User) Unwatch(watchable Watchable, subscriptions SubscriptionStore) error
- func (self *User) Watch(watchable Watchable, subscriptions SubscriptionStore) error
- type UserBlock
- func (self *UserBlock) BlockForever(now time.Time)
- func (self *UserBlock) Embed(k string, subject Subject)
- func (self *UserBlock) Embedded() map[string][]Subject
- func (self *UserBlock) Links(response map[string]map[string]string, requestScheme, requestBase string) map[string]map[string]string
- func (self *UserBlock) OwnUrl(requestScheme, requestBase string) string
- type UserHistory
- type UserStore
- type ValidationError
- type Watchable
- type Webhook
- func (self *Webhook) AuthorizationName() string
- func (self *Webhook) Embed(k string, subject Subject)
- func (self *Webhook) Embedded() map[string][]Subject
- func (self *Webhook) FindProject(projects ProjectStore) (*Project, error)
- func (self *Webhook) GenerateSlug()
- func (self *Webhook) IsInternal() bool
- func (self *Webhook) Links(response map[string]map[string]string, requestScheme, requestBase string) map[string]map[string]string
- func (self *Webhook) NewDelivery(req *http.Request) *Delivery
- func (self *Webhook) OwnUrl(requestScheme, requestBase string) string
- func (self *Webhook) Validate() error
- type WorkspaceBaseImage
- func (self *WorkspaceBaseImage) AuthorizationName() string
- func (self *WorkspaceBaseImage) Embed(k string, subject Subject)
- func (self *WorkspaceBaseImage) Embedded() map[string][]Subject
- func (self *WorkspaceBaseImage) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
- type WorkspaceBaseImageStore
Constants ¶
const ( FreePlanUuid = "b99a21cc-b108-466e-aa4d-bde10ebbe1f3" PlatinumPlanUuid = "f975a385-3625-4883-b353-8f1febeb5b3e" )
const ( EventNone = "no events" EventNoHandler = "no event handler registered" EventOperationStarted = "operations.started" EventOperationFailed = "operations.failed" EventOperationSucceeded = "operations.succeeded" EventOperationTimedOut = "operations.timed_out" EventOperationScheduled = "operations.scheduled" )
const ( LoggableOK = iota LoggableEndOfTransmission )
const ( LoggableWorkspace = "workspace" LoggableVerbose = "verbose" )
const ( LogSubscriptionSubscribe = iota LogSubscriptionUnsubscribe )
const ( OperationTypeGitAccessCheck string = "git.check.access" OperationTypeGitEnumerationBranches string = "git.enumeration.branches" OperationTypeGitEnumerationCommits string = "git.enumeration.commits" OperationTypeJobScheduled string = "job.scheduled" OperationTypeJobWebhooked string = "job.webhooked" OperationTypeJobRetried string = "job.retried" OperationTypeNotifierInvoke string = "notifier.invoke" )
const ( ScheduledExecutionDefaultInterval = 24 * time.Hour ScheduledExecutionDefaultN = 20 )
const ISODateFormat = "2006-01-02 15:04:05 -0700"
Variables ¶
var ( FreePlan = &BillingPlan{ Uuid: FreePlanUuid, Name: "free", PrivateCodeAvailable: true, PricePerMonth: Money{0, USD}, UsersIncluded: 1, ProjectsIncluded: 1, PricePerAdditionalUser: Money{0, USD}, NumberOfConcurrentJobs: 1, } PlatinumPlan = &BillingPlan{ Uuid: PlatinumPlanUuid, Name: "Platinum", PrivateCodeAvailable: true, PricePerMonth: Money{12900, USD}, UsersIncluded: 10, ProjectsIncluded: 10, PricePerAdditionalUser: Money{1900, USD}, NumberOfConcurrentJobs: 1, } )
var ( CapabilitySignUp = "signup" CapabilityCreate = "create" CapabilityRead = "read" CapabilityUpdate = "update" CapabilityValidate = "validate" CapabilityArchive = "archive" CapabilityReadPrivileged = "readPrivileged" )
var ( EUR = Currency("EUR") USD = Currency("USD") )
var ( ErrInvalidCronspecFormat = fmt.Errorf("Invalid Cronspec Format.") ErrInvalidTimespecFormat = fmt.Errorf("Invalid Timespec Format.") ErrScheduledInThePast = fmt.Errorf("Scheduled in the past.") ErrInvalidTimezoneName = fmt.Errorf("Invalid timezone name.") ErrNoTimeScheduled = fmt.Errorf("Empty schedule time (Cronspec/Timespec).") )
var ( ScheduleDisabledInternalError = "internal_error" ScheduleDisabledJobArchived = "job_archived" ScheduleDisabledRanOnce = "ran_once" )
var ( ProjectInvitee = newCapabilityList(). reads("project", "organization", "user") ErrTotpTokenNotValid = NewValidationError("totp", "not valid anymore") )
var ( SegmentCold = "cold" SegmentLimbo = "limbo" SegmentReturned = "returned" SegmentFailed = "failed" SegmentLoner = "loner" SegmentIdeal = "ideal" UserSegments = []string{SegmentCold, SegmentLimbo, SegmentReturned, SegmentFailed, SegmentLoner, SegmentIdeal} )
var Clock clock.Interface = clock.System
var ErrNotASshSecret = errors.New("secret type is not ssh")
var ErrNotAnEnvironmentSecret = errors.New("secret type is not env")
var ( // ErrUnknownOperationCategory indicates that no script can be // run for operations of the given type. ErrUnknownOperationCategory = errors.New("operation: unknown category") )
var (
GitTriggerChangeTypes = map[string]string{
"change": "ref-changed",
"add": "ref-added",
"remove": "ref-removed",
}
)
var MembershipTypeGuest string = guest
var MembershipTypeManager string = manager
var MembershipTypeMember string = member
var MembershipTypeOwner string = owner
var (
ProjectVisitor = &ProjectMember{}
)
var TaskTypeBuild string = "build"
var TaskTypeDeployment string = "deployment"
var TaskTypeScript string = "script"
var TaskTypeTest string = "test"
var WorkspaceBaseImageTypeContainer string = container
Functions ¶
func IsNotFound ¶
func RandomTotpSecret ¶
func RandomTotpSecret() string
func RegisterBillingEvent ¶
func RegisterBillingEvent(event BillingEventData)
func ValidateOrganization ¶
func ValidateOrganization(u *Organization) error
TODO: Lh/DH Move this to a struct method
func ValidateProject ¶
func ValidateRepository ¶
func ValidateRepository(u *Repository) error
func ValidateTarget ¶
func ValidateUser ¶
Types ¶
type Activity ¶
type Activity struct { // Id is a strictly monotonically increasing integer and // functions as a sequence number for ordering events. Id int `json:"id" db:"id"` // Name is used to disambiguate different activities. Values // should follow the form: // // ${OBJECT}.${EVENT} // // Examples: // // operation.finished // job.added Name string `json:"name" db:"name"` // OccurredOn is the time at which the activity has occurred. OccurredOn time.Time `json:"occurredOn" db:"occurred_on"` // CreatedAt is the time at which the activity has been // persisted. CreatedAt time.Time `json:"createdAt" db:"created_at"` // ContextUserUuid is the uuid of the user who caused the // activity. For activities that are not triggered by a user, // this field is nil. ContextUserUuid *string `json:"contextUserUuid" db:"context_user_uuid"` // Payload is the context dependent data captured about the // activity. Payload interface{} `json:"payload" db:"payload"` // Extra is additional data added to the activity by various // processors of an activity. Extra map[string]interface{} `json:"extra" db:"extra"` }
An activity is something that has been done, most of times by a user, sometimes by a program. An activity represents that an action has lead to a result and captures information about the action and the result.
func NewActivity ¶
func (*Activity) Audience ¶
Audience returns a list of user ids that should be notified about this activity.
Usually it refers to all people having access to a project if the activity is emitted from something within a given project.
func (*Activity) JobUuid ¶
JobUuid returns the uuid of the job this activity is associated with or the empty string if this activity is not associated with any job.
func (*Activity) ProjectUuid ¶
ProjectUuid returns the uuid of the project this activity is associated with or the empty string if this activity is not associated with any project.
func (*Activity) SetAudience ¶
func (*Activity) SetJobUuid ¶
func (*Activity) SetProjectUuid ¶
func (*Activity) SubscriptionKey ¶
SubscriptionKey returns the key used for matching notification subscriptions against this activity. Usually this is the activity name.
type ActivityActor ¶
ActivityOnStream represents an activity as it is displayed on an activity stream.
type ActivityOnStream ¶
type ActivityOnStream struct { Id int `json:"id"` UserUuid string `json:"userUuid"` Project *ActivityActor `json:"project"` OccurredOn time.Time `json:"occurredOn"` Actor *ActivityActor `json:"actor"` Action string `json:"action"` Object string `json:"object"` Subject *ActivityActor `json:"subject"` Unread bool `json:"unread"` // contains filtered or unexported fields }
func (*ActivityOnStream) FindUser ¶
func (self *ActivityOnStream) FindUser(users UserStore) (*User, error)
func (*ActivityOnStream) OwnUrl ¶
func (self *ActivityOnStream) OwnUrl(requestBase, requestScheme string) string
type BasicRepositoryCredential ¶
type BasicRepositoryCredential struct { *RepositoryCredential `json:"-"` Username string `json:"username"` Password string `json:"password"` }
func AsBasicRepositoryCredential ¶
func AsBasicRepositoryCredential(rc *RepositoryCredential) (*BasicRepositoryCredential, error)
func (*BasicRepositoryCredential) AsRepositoryCredential ¶
func (self *BasicRepositoryCredential) AsRepositoryCredential() (*RepositoryCredential, error)
type BillingCreditCardAdded ¶
type BillingCreditCardAdded struct { // CreditCard is the credit card that has been added. CreditCard *CreditCard // UserUuid is the uuid of the user who added the card. UserUuid string // PaymentProviderName is the name of the payment provider at // which the card has been registered. PaymentProviderName string }
func (*BillingCreditCardAdded) BillingEventName ¶
func (self *BillingCreditCardAdded) BillingEventName() string
type BillingEvent ¶
type BillingEvent struct { Uuid string `json:"uuid" db:"uuid"` EventName string `json:"eventName" db:"event_name"` OrganizationUuid string `json:"organizationUuid" db:"organization_uuid"` OccurredOn time.Time `json:"occurredOn" db:"occurred_on"` Data BillingEventData }
func NewBillingEvent ¶
func NewBillingEvent(organizationUuid string, eventData BillingEventData) *BillingEvent
func (*BillingEvent) UnmarshalJSON ¶
func (self *BillingEvent) UnmarshalJSON(data []byte) error
type BillingEventData ¶
type BillingEventData interface {
BillingEventName() string
}
func NewBillingEventDataByName ¶
func NewBillingEventDataByName(eventName string) BillingEventData
type BillingExtraLimitsGranted ¶
type BillingExtraLimitsGranted struct { // Number of addtional projects granted to the organization Projects int // Number of addtional users granted to the organization Users int // Uuid of the user granting those limits GrantedBy string // Reason for granting those limits Reason string }
func (*BillingExtraLimitsGranted) BillingEventName ¶
func (self *BillingExtraLimitsGranted) BillingEventName() string
type BillingHistory ¶
type BillingHistory struct { Subscriptions map[string]*BillingPlanSubscription `json:"subscriptions"` // OrganizationToPlanUuids maps organization uuids to the plan // uuid of the most recent subscription created for that // organization. OrganizationToPlanUuids map[string]string `json:"organizationToPlanUuids"` // OrganizationUuidsToSubscriptions maps organization uuids to // the currently active subscription for the organization. OrganizationUuidsToSubscriptions map[string]string // OrganizationUuidsToCreditCards maps organization uuids to // credit cards registered for that organization. OrganizationUuidsToCreditCards map[string][]*CreditCard // OrganizationUuidsToExtraProjects maps organization uuids to // increases in project limits an organization should be // granted. OrganizationUuidsToExtraProjects map[string]int // OrganizationUuidsToExtraProjects maps organization uuids to // increases in user limits an organization should be granted. OrganizationUuidsToExtraUsers map[string]int // OrganizationUuidsToExtras maps organization uuids to a // history of discounts that have been applied to an // organization. OrganizationUuidsToExtras map[string][]*BillingEvent // Version is the time of the last event that has been // processed by this instance. Version time.Time `json:"version"` }
func NewBillingHistory ¶
func NewBillingHistory() *BillingHistory
func (*BillingHistory) CreditCardsFor ¶
func (self *BillingHistory) CreditCardsFor(organizationUuid string) []*CreditCard
func (*BillingHistory) ExtraProjectsFor ¶
func (self *BillingHistory) ExtraProjectsFor(organizationUuid string) int
func (*BillingHistory) ExtraUsersFor ¶
func (self *BillingHistory) ExtraUsersFor(organizationUuid string) int
func (*BillingHistory) ExtrasGrantedTo ¶
func (self *BillingHistory) ExtrasGrantedTo(organizationUuid string) []*BillingEvent
func (*BillingHistory) HandleEvent ¶
func (self *BillingHistory) HandleEvent(event *BillingEvent)
HandleEvent ...
func (*BillingHistory) PlanUuidFor ¶
func (self *BillingHistory) PlanUuidFor(organizationUuid string) string
func (*BillingHistory) Subscription ¶
func (self *BillingHistory) Subscription(subscriptionId string) *BillingPlanSubscription
Subscription returns the billing plan subscription for the given id or nil if no such subscription exists.
func (*BillingHistory) SubscriptionFor ¶
func (self *BillingHistory) SubscriptionFor(organizationUuid string) *BillingPlanSubscription
type BillingPlan ¶
type BillingPlan struct { Uuid string `json:"uuid" db:"uuid"` Name string `json:"name" db:"name"` ProviderName string `json:"providerName" db:"provider_name"` ProviderPlanId string `json:"providerPlanId" db:"provider_plan_id"` PrivateCodeAvailable bool `json:"privateCodeAvailable" db:"private_code_available"` PricePerMonth Money `json:"pricePerMonth" db:"price_per_month"` UsersIncluded int `json:"usersIncluded" db:"users_included"` ProjectsIncluded int `json:"projectsIncluded" db:"projects_included"` PricePerAdditionalUser Money `json:"pricePerAdditionalUser" db:"price_per_additional_user"` NumberOfConcurrentJobs int `json:"numberOfConcurrentJobs" db:"number_of_concurrent_jobs"` // contains filtered or unexported fields }
func NewBillingPlan ¶
func NewBillingPlan(uuid string) *BillingPlan
func (*BillingPlan) EnsureDefaultPrice ¶
func (self *BillingPlan) EnsureDefaultPrice()
func (*BillingPlan) OwnUrl ¶
func (self *BillingPlan) OwnUrl(requestScheme, requestBase string) string
func (*BillingPlan) ProjectsExceedingLimit ¶
func (self *BillingPlan) ProjectsExceedingLimit(projects int) int
ProjectsExceedingLimit returns the number of projects by which projects exceeds the limits imposed by this plan.
func (*BillingPlan) UsersExceedingLimit ¶
func (self *BillingPlan) UsersExceedingLimit(members int) int
UsersExceedingLimit returns the number of users by which members exceeds the limits imposed by this plan.
type BillingPlanSelected ¶
type BillingPlanSelected struct { UserUuid string PlanUuid string PlanName string SubscriptionId string PrivateCodeAvailable bool PricePerMonth Money UsersIncluded int ProjectsIncluded int PricePerAdditionalUser Money NumberOfConcurrentJobs int }
func (*BillingPlanSelected) BillingEventName ¶
func (self *BillingPlanSelected) BillingEventName() string
func (*BillingPlanSelected) FillFromPlan ¶
func (self *BillingPlanSelected) FillFromPlan(plan *BillingPlan)
type BillingPlanSubscription ¶
type BillingPlanSubscription struct { Id string `json:"id"` PlanUuid string `json:"planUuid"` OrganizationUuid string `json:"organizationUuid"` UserUuid string `json:"userUuid"` Status string `json:"status"` }
func NewBillingPlanSubscription ¶
func NewBillingPlanSubscription() *BillingPlanSubscription
func (*BillingPlanSubscription) IsCancellable ¶
func (self *BillingPlanSubscription) IsCancellable() bool
type BillingPlanSubscriptionChanged ¶
type BillingPlanSubscriptionChanged struct { UserUuid string SubscriptionId string PlanId string Status string }
func (*BillingPlanSubscriptionChanged) BillingEventName ¶
func (self *BillingPlanSubscriptionChanged) BillingEventName() string
type ChangedRepositoryRef ¶
type ChangedRepositoryRef struct { RepositoryUuid string `json:"repositoryUuid"` Symbolic string `json:"symbolic"` OldHash string `json:"oldHash"` NewHash string `json:"newHash"` }
func (*ChangedRepositoryRef) FindProject ¶
func (self *ChangedRepositoryRef) FindProject(projects ProjectStore) (*Project, error)
type CreditCard ¶
type CreditCard struct { // IsDefault is set to true if the payment provider reports this // credit card as the default mode of payment. IsDefault bool `json:"isDefault"` CardholderName string `json:"cardholderName"` // SafeCardNumber is a truncated version of the credit card // number, safe for display purposes. SafeCardNumber string `json:"safeCardNumber"` // CardId identifies this card at the payment provider CardId string `json:"cardId"` // Token is a provider specific identifier for using this // credit card in transactions. Token string `json:"token"` }
*
* * CAUTION! * * This type is used withing billing events as well; only make * backwards compatible hchanges with regards to serialization: * * - if you rename a field, keep the old name in the "json" tag * - do not remove fields, only add new fields * *
func NewCreditCard ¶
func NewCreditCard(cardId string) *CreditCard
type DeliveredRequest ¶
func (DeliveredRequest) MarshalJSON ¶
func (self DeliveredRequest) MarshalJSON() ([]byte, error)
func (*DeliveredRequest) Scan ¶
func (self *DeliveredRequest) Scan(value interface{}) error
type Delivery ¶
type Delivery struct { Uuid string `json:"uuid" db:"uuid"` WebhookUuid string `json:"webhookUuid" db:"webhook_uuid"` DeliveredAt time.Time `json:"deliveredAt" db:"delivered_at"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` // The Schedule this Delivery triggered, optional ScheduleUuid *string `json:"scheduleUuid" db:"schedule_uuid"` Request DeliveredRequest `json:"request" db:"request"` // contains filtered or unexported fields }
func (*Delivery) AuthorizationName ¶
func (*Delivery) FindProject ¶
func (self *Delivery) FindProject(projects ProjectStore) (*Project, error)
func (*Delivery) OperationParameters ¶
func (self *Delivery) OperationParameters(projectUuid string, repositories RepositoriesByName) *OperationParameters
func (*Delivery) RepositoryName ¶
type DeliveryStore ¶
type Dictionary ¶
type Dictionary map[string]interface{}
Dictionary is a generic mapping for seamlessly storing JSON objects in the database.
func NewDictionary ¶
func NewDictionary() Dictionary
func (Dictionary) Get ¶
func (dictionary Dictionary) Get(key string) interface{}
Get returns the value associated with key in the dictionary or nil if no such value exists.
func (Dictionary) MarshalJSON ¶
func (dictionary Dictionary) MarshalJSON() ([]byte, error)
func (*Dictionary) Scan ¶
func (dictionary *Dictionary) Scan(data interface{}) error
func (Dictionary) Set ¶
func (dictionary Dictionary) Set(key string, value interface{}) Dictionary
Set associates key with value in the dictionary.
func (*Dictionary) UnmarshalJSON ¶
func (dictionary *Dictionary) UnmarshalJSON(data []byte) error
type EmailNotifier ¶
type EmailNotifier struct { Uuid string `json:"uuid" db:"uuid"` Recipient string `json:"recipient" db:"recipient"` ProjectUuid *string `json:"projectUuid" db:"project_uuid"` UrlHost string `json:"urlHost" db:"url_host"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` // contains filtered or unexported fields }
func (*EmailNotifier) AuthorizationName ¶
func (self *EmailNotifier) AuthorizationName() string
func (*EmailNotifier) FindProject ¶
func (self *EmailNotifier) FindProject(projects ProjectStore) (*Project, error)
func (*EmailNotifier) OwnUrl ¶
func (self *EmailNotifier) OwnUrl(requestScheme, requestBase string) string
func (*EmailNotifier) Validate ¶
func (self *EmailNotifier) Validate() error
type Environment ¶
type Environment struct { Uuid string `json:"uuid"` Name string `json:"name"` ProjectUuid string `json:"projectUuid" db:"project_uuid"` IsDefault bool `json:"-" db:"is_default"` Variables EnvironmentVariables `json:"variables"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` CreatedAt time.Time `json:"-"` // contains filtered or unexported fields }
func NewEnvironment ¶
func NewEnvironment(uuid string) *Environment
func (*Environment) AuthorizationName ¶
func (self *Environment) AuthorizationName() string
func (*Environment) CreationDate ¶
func (self *Environment) CreationDate() time.Time
func (*Environment) Equal ¶
func (self *Environment) Equal(b *Environment) bool
func (*Environment) FindProject ¶
func (self *Environment) FindProject(store ProjectStore) (*Project, error)
FindProject satisfies authz.BelongsToProject in order to determine authorization.
func (*Environment) Get ¶
func (self *Environment) Get(variable string) string
func (*Environment) Id ¶
func (self *Environment) Id() string
func (*Environment) NewSecret ¶
func (self *Environment) NewSecret(name string, kind SecretType) *Secret
NewSecret returns a new secret associated with this environment
func (*Environment) OwnUrl ¶
func (self *Environment) OwnUrl(requestScheme, requestBaseUri string) string
func (*Environment) PruneVariables ¶
func (self *Environment) PruneVariables()
func (*Environment) Set ¶
func (self *Environment) Set(variable, value string) *Environment
type EnvironmentSecret ¶
func AsEnvironmentSecret ¶
func AsEnvironmentSecret(s *Secret) (*EnvironmentSecret, error)
func (*EnvironmentSecret) AsPrivileged ¶
func (self *EnvironmentSecret) AsPrivileged() (*PrivilegedEnvironmentSecret, error)
func (*EnvironmentSecret) AsSecret ¶
func (self *EnvironmentSecret) AsSecret() (*Secret, error)
func (*EnvironmentSecret) AsUnprivileged ¶
func (self *EnvironmentSecret) AsUnprivileged() (*UnprivilegedEnvironmentSecret, error)
type EnvironmentStore ¶
type EnvironmentStore interface {
FindByJobUuid(uuid string) (*Environment, error)
}
EnvironmentStore defines all the operations that are necessary for domain objects to fetch associated environment objects.
type EnvironmentVariable ¶
type EnvironmentVariableChanges ¶
type EnvironmentVariableChanges struct { Added []*EnvironmentVariable `json:"added"` Removed []*EnvironmentVariable `json:"removed"` Changed []*EnvironmentVariable `json:"changed"` }
func NewEnvironmentVariableChanges ¶
func NewEnvironmentVariableChanges() *EnvironmentVariableChanges
type EnvironmentVariables ¶
func (EnvironmentVariables) Diff ¶
func (self EnvironmentVariables) Diff(other EnvironmentVariables) *EnvironmentVariableChanges
func (*EnvironmentVariables) MarshalJSON ¶
func (self *EnvironmentVariables) MarshalJSON() ([]byte, error)
func (*EnvironmentVariables) Scan ¶
func (self *EnvironmentVariables) Scan(value interface{}) error
func (*EnvironmentVariables) UnmarshalJSON ¶
func (self *EnvironmentVariables) UnmarshalJSON(data []byte) error
type EventPayload ¶
type ExecutionsByTime ¶
type ExecutionsByTime []*ScheduledExecution
sort.Interface
func (ExecutionsByTime) Len ¶
func (a ExecutionsByTime) Len() int
func (ExecutionsByTime) Less ¶
func (a ExecutionsByTime) Less(i, j int) bool
func (ExecutionsByTime) Swap ¶
func (a ExecutionsByTime) Swap(i, j int)
type Feature ¶
type Feature struct { Name string `json:"name"` Enabled bool `json:"enabled"` // contains filtered or unexported fields }
func NewFeaturesFromConfig ¶
type GitLogEntry ¶
type GitLogs ¶
type GitLogs struct {
Repositories map[string][]*GitLogEntry `json:"repositories"`
}
func NewGitLogs ¶
func NewGitLogs() *GitLogs
func (*GitLogs) HandleEvent ¶
func (self *GitLogs) HandleEvent(payload EventPayload)
type GitTrigger ¶
type GitTrigger struct { Uuid string `json:"uuid" db:"uuid"` Name string `json:"name" db:"name"` ProjectUuid string `json:"projectUuid" db:"project_uuid"` JobUuid string `json:"jobUuid" db:"job_uuid"` RepositoryUuid *string `json:"repositoryUuid" db:"repository_uuid"` ChangeType string `json:"changeType" db:"change_type"` MatchRef string `json:"matchRef" db:"match_ref"` CreatorUuid string `json:"creatorUuid" db:"creator_uuid"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` // contains filtered or unexported fields }
func NewGitTrigger ¶
func NewGitTrigger(name, creatorUuid string) *GitTrigger
func (*GitTrigger) AuthorizationName ¶
func (self *GitTrigger) AuthorizationName() string
func (*GitTrigger) FindProject ¶
func (self *GitTrigger) FindProject(store ProjectStore) (*Project, error)
func (*GitTrigger) ForChangeType ¶
func (self *GitTrigger) ForChangeType(changeType string) *GitTrigger
func (*GitTrigger) ForJob ¶
func (self *GitTrigger) ForJob(jobUuid string) *GitTrigger
func (*GitTrigger) InProject ¶
func (self *GitTrigger) InProject(projectUuid string) *GitTrigger
func (*GitTrigger) InRepository ¶
func (self *GitTrigger) InRepository(repositoryUuid string) *GitTrigger
func (*GitTrigger) Match ¶
func (self *GitTrigger) Match(activity *Activity) bool
Match returns true if this trigger should fire for the given activity.
func (*GitTrigger) MatchingRef ¶
func (self *GitTrigger) MatchingRef(refspec string) *GitTrigger
func (*GitTrigger) OwnUrl ¶
func (self *GitTrigger) OwnUrl(requestScheme, requestBase string) string
func (*GitTrigger) Validate ¶
func (self *GitTrigger) Validate() error
type Invitation ¶
type Invitation struct { Uuid string `json:"uuid" db:"uuid"` RecipientName string `json:"recipientName" db:"recipient_name"` Email string `json:"email" db:"email"` OrganizationUuid string `json:"organizationUuid" db:"organization_uuid"` ProjectUuid string `json:"projectUuid" db:"project_uuid"` MembershipType string `json:"membershipType" db:"membership_type"` CreatorUuid string `json:"creatorUuid" db:"creator_uuid"` CreatedAt time.Time `json:"createdAt" db:"created_at"` SentAt *time.Time `json:"sentAt" db:"sent_at"` AcceptedAt *time.Time `json:"acceptedAt" db:"accepted_at"` RefusedAt *time.Time `json:"refusedAt" db:"refused_at"` InviteeUuid string `json:"inviteeUuid" db:"invitee_uuid"` Message string `json:"message" db:"message"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` // contains filtered or unexported fields }
func (*Invitation) Accept ¶
func (self *Invitation) Accept(invitee *User)
Accept marks the invitation as accepted. The current time is used for recording the time of accepting the invitation.
func (*Invitation) AuthorizationName ¶
func (self *Invitation) AuthorizationName() string
func (*Invitation) CallToActionPath ¶
func (self *Invitation) CallToActionPath(users UserStore) string
CallToActionPath returns the URL path for the page on which the invitee can react to this invitation.
func (*Invitation) FindOrganization ¶
func (self *Invitation) FindOrganization(store OrganizationStore) (*Organization, error)
FindOrganization satisfies authz.BelongsToOrganization
func (*Invitation) FindProject ¶
func (self *Invitation) FindProject(store ProjectStore) (*Project, error)
FindProject satifies authz.BelongsToProject to determine access to project level invitations.
func (*Invitation) FindUser ¶
func (self *Invitation) FindUser(store UserStore) (*User, error)
FindUser satisfies authz.BelongsToUser by looking for the invitation's recipient (who might not exist yet).
func (*Invitation) IsAccepted ¶
func (self *Invitation) IsAccepted() bool
IsAccepted returns true if the invitation has been marked as accepted.
func (*Invitation) IsOpen ¶
func (self *Invitation) IsOpen() bool
IsOpen returns true if the invitation can still be responded to, i.e. whether it can still be accepted or refused.
func (*Invitation) IsRefused ¶
func (self *Invitation) IsRefused() bool
IsRefused returns true if the invitation has been marked as refused.
func (*Invitation) NewProjectMembership ¶
func (self *Invitation) NewProjectMembership() *ProjectMembership
NewProjectMembership returns the new project membership that should be created when accepting this invitation.
func (*Invitation) OwnUrl ¶
func (self *Invitation) OwnUrl(requestScheme, requestBaseUri string) string
func (*Invitation) OwnedBy ¶
func (self *Invitation) OwnedBy(user *User) bool
OwnedBy satisfies authz.Ownable by looking at the creator of the invitation.
func (*Invitation) Refuse ¶
func (self *Invitation) Refuse()
Refuse marks the invitation as refused. The current time is usd for recording the time of refusing the invitation.
func (*Invitation) Validate ¶
func (self *Invitation) Validate() error
type InvitationStore ¶
type InvitationStore interface {
FindByUserAndProjectUuid(userId, projectId string) (*Invitation, error)
}
type Job ¶
type Job struct { Uuid string `json:"uuid"` CreatedAt time.Time `json:"createdAt" db:"created_at"` Name string `json:"name"` Description *string `json:"description" db:"description"` TaskUuid string `json:"taskUuid" db:"task_uuid"` EnvironmentUuid string `json:"environmentUuid" db:"environment_uuid"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` // makes the job widget much easier to implement ProjectUuid string `json:"projectUuid" db:"project_uuid"` ProjectName string `json:"projectName" db:"project_name"` LastRunStartedAt *time.Time `json:"lastRunStartedAt"` LastRunCreatedAt *time.Time `json:"lastRunCreatedAt"` Runs []string `json:"runs"` // contains filtered or unexported fields }
func (*Job) AuthorizationName ¶
func (*Job) CreationDate ¶
func (*Job) FindProject ¶
func (self *Job) FindProject(store ProjectStore) (*Project, error)
FindProject satisfies authz.BelongsToProject in order to determine authorization.
func (*Job) FindRecentOperations ¶
func (self *Job) FindRecentOperations(operations RecentOperations) error
func (*Job) NewJobNotifier ¶
func (self *Job) NewJobNotifier() *JobNotifier
NewJobNotifier returns a new job notifier which triggers this job.
func (*Job) NewOperation ¶
NewOperation constructs a new operation for running this job.
func (*Job) NewRecurringSchedule ¶
NewRecurringSchedule returns a recurring schedule for this job, using the given cronexpr for scheduling runs of this job.
func (*Job) WatchableEvents ¶
func (*Job) WatchableType ¶
type JobNotifier ¶
type JobNotifier struct { Uuid string `json:"uuid" db:"uuid"` WebhookURL string `json:"webhookURL" db:"webhook_url"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` ProjectUuid string `json:"projectUuid" db:"project_uuid"` JobUuid string `json:"jobUuid" db:"job_uuid"` JobName string `json:"jobName" db:"job_name"` // contains filtered or unexported fields }
func (*JobNotifier) AuthorizationName ¶
func (self *JobNotifier) AuthorizationName() string
func (*JobNotifier) FindProject ¶
func (self *JobNotifier) FindProject(projects ProjectStore) (*Project, error)
func (*JobNotifier) OwnUrl ¶
func (self *JobNotifier) OwnUrl(requestScheme, requestBase string) string
func (*JobNotifier) Validate ¶
func (self *JobNotifier) Validate() error
func (*JobNotifier) WebhookSlug ¶
func (self *JobNotifier) WebhookSlug() string
type JobOperationVars ¶
type JobOperationVars struct { // Body contains the body of the script to execute. It is // expected to be directly executable using `exec`. Body string }
JobOperationVars holds the necessary information for the template producing the shell script to run a job operation.
type Limits ¶
type Limits struct { OrganizationUuid string `json:"organizationUuid"` Projects int `json:"projects"` Members int `json:"members"` PublicRepositories int `json:"publicRepositories"` PrivateRepositories int `json:"privateRepositories"` TrialDaysLeft int `json:"trialDaysLeft"` TrialEnabled bool `json:"trialEnabled"` Version time.Time `json:"version"` Plan *LimitsComparedToPlan `json:"plan"` // contains filtered or unexported fields }
func (*Limits) AuthorizationName ¶
func (*Limits) FindOrganization ¶
func (self *Limits) FindOrganization(organizations OrganizationStore) (*Organization, error)
func (*Limits) FindProject ¶
func (self *Limits) FindProject(store ProjectStore) (*Project, error)
func (*Limits) MarshalJSON ¶
type LimitsComparedToPlan ¶
type LimitsComparedToPlan struct { UsersExceedingLimit int `json:"usersExceedingLimit"` ProjectsExceedingLimit int `json:"projectsExceedingLimit"` RequiresUpgradeForPrivateCode bool `json:"requiresUpgradeForPrivateCode"` UsersIncluded int `json:"usersIncluded"` ProjectsIncluded int `json:"projectsIncluded"` }
type LogLine ¶
type LogLine struct { Seq int `json:"seq"` // the line number Msg string `json:"msg"` // the line, without trailing \n }
func LogLinesFromFile ¶
func LogLinesFromSlice ¶
func MustUnmarshalLogLine ¶
func NewLogLine ¶
func (*LogLine) IsInternal ¶
func (*LogLine) MustMarshal ¶
type LogSubscription ¶
type Loggable ¶
type Loggable struct { Uuid string `json:"uuid"` // Actually, this is the operation's uuid LogLines []*LogLine `json:"logLines"` Status int `json:"status"` // contains filtered or unexported fields }
func MustUnmarshalLoggable ¶
func (*Loggable) AuthorizationName ¶
func (*Loggable) MustMarshal ¶
func (*Loggable) Wrap ¶
func (self *Loggable) Wrap() *LoggableWrapper
type LoggableWrapper ¶
type LoggableWrapper struct { Subject Loggable `json:"subject"` Links map[string]map[string]string `json:"_links"` }
resembles a HAL type
type MapPayload ¶
func (MapPayload) Get ¶
func (self MapPayload) Get(key string) string
type NotFoundError ¶
type NotFoundError struct{}
func (NotFoundError) Error ¶
func (nfe NotFoundError) Error() string
type NotificationRule ¶
type NotificationRule struct { Uuid string `json:"uuid" db:"uuid"` ProjectUuid string `json:"projectUuid" db:"project_uuid"` NotifierUuid string `json:"notifierUuid" db:"notifier_uuid"` NotifierType string `json:"notifierType" db:"notifier_type"` MatchActivity string `json:"matchActivity" db:"match_activity"` CreatorUuid string `json:"creatorUuid" db:"creator_uuid"` JobUuid *string `json:"jobUuid" db:"job_uuid"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` // contains filtered or unexported fields }
func (*NotificationRule) AppliesToJob ¶
func (self *NotificationRule) AppliesToJob(jobUuid string) bool
func (*NotificationRule) AuthorizationName ¶
func (self *NotificationRule) AuthorizationName() string
func (*NotificationRule) FindProject ¶
func (self *NotificationRule) FindProject(projects ProjectStore) (*Project, error)
func (*NotificationRule) Matches ¶
func (self *NotificationRule) Matches(activity *Activity) bool
func (*NotificationRule) OwnUrl ¶
func (self *NotificationRule) OwnUrl(requestScheme, requestBase string) string
func (*NotificationRule) Validate ¶
func (self *NotificationRule) Validate() error
type OAuthToken ¶
type OAuthToken struct { Uuid string `json:"uuid"` UserUuid string `json:"userUuid" db:"user_uuid"` Provider string `json:"provider"` Scope string `json:"scope" db:"scopes"` AccessToken string `json:"accessToken" db:"access_token"` TokenType string `json:"tokenType" db:"token_type"` CreatedAt *time.Time `json:"createdAt" db:"created_at"` // contains filtered or unexported fields }
func (*OAuthToken) AuthorizationName ¶
func (self *OAuthToken) AuthorizationName() string
func (*OAuthToken) OwnUrl ¶
func (self *OAuthToken) OwnUrl(requestScheme, requestBaseUri string) string
func (*OAuthToken) OwnedBy ¶
func (self *OAuthToken) OwnedBy(user *User) bool
OwnedBy satisfies authz.Ownable by identifying the user for which this OAuth token is valid.
type Operation ¶
type Operation struct { Uuid string `json:"uuid"` Type string `json:"type"` RepositoryUuid *string `json:"repositoryUuid" db:"repository_uuid"` JobUuid *string `json:"jobUuid" db:"job_uuid"` NotifierUuid *string `json:"notifierUuid" db:"notifier_uuid"` NotifierType *string `json:"notifierType" db:"notifier_type"` WorkspaceBaseImageUuid string `json:"workspaceBaseImageUuid" db:"workspace_base_image_uuid"` TimeLimit int `json:"timeLimitSecs" db:"time_limit"` VisibleTo string `json:"-" db:"visible_to"` ExitStatus int `json:"exitStatus" db:"exit_status"` CreatedAt *time.Time `json:"createdAt" db:"created_at"` StartedAt *time.Time `json:"startedAt" db:"started_at"` FinishedAt *time.Time `json:"finishedAt" db:"finished_at"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` FailedAt *time.Time `json:"failedAt" db:"failed_at"` TimedOutAt *time.Time `json:"timedOutAt" db:"timed_out_at"` CanceledAt *time.Time `json:"canceledAt" db:"canceled_at"` FatalError *string `json:"fatalError" db:"fatal_error"` Parameters *OperationParameters `json:"parameters" db:"parameters"` RepositoryCheckouts *RepositoryCheckouts `json:"repositoryCheckouts" db:"repository_refs"` GitLogs *GitLogs `json:"gitLogs" db:"git_logs"` StatusLogs *StatusLogs `json:"statusLogs" db:"status_logs"` LogEvents []*logevent.Message `json:"logEvents" db:"-"` // contains filtered or unexported fields }
NOTE(dh): This should probably be split into separate types (JobOperation, RepositoryOperation, ...) once a new operation type is added. Distinguishing operations by the value of their `Type` field seems to work for now, because there are only two cases.
func (*Operation) AddLogEvent ¶
func (*Operation) AuthorizationName ¶
func (*Operation) Category ¶
Category returns the broader category an operation belongs into based on its type. For example, the category of OperationTypeGit* operations is "repository". If the type cannot be mapped to a category, "unknown" is returned.
func (*Operation) Environment ¶
func (self *Operation) Environment(store EnvironmentStore) (*Environment, error)
Environment returns the environment in which the operation runs. If the operation is not associated with an environment (such as a Git repository access check), nil is returned. Any errors returned are from store.
func (*Operation) FindProject ¶
func (self *Operation) FindProject(store ProjectStore) (*Project, error)
FindProject satisfies authz.BelongsToProject in order to determine authorization.
func (*Operation) FindWorkspaceBaseImage ¶
func (self *Operation) FindWorkspaceBaseImage(store WorkspaceBaseImageStore) (*WorkspaceBaseImage, error)
FindWorkspaceBaseImage returns the workspace base image that should be used for running this operation.
func (*Operation) HandleEvent ¶
func (self *Operation) HandleEvent(payload EventPayload)
func (*Operation) IsGitAccessCheck ¶
func (*Operation) IsGitMetadataCollect ¶
func (*Operation) IsReady ¶
func (self *Operation) IsReady(repos RepositoryStore, credentials RepositoryCredentialStore, envs EnvironmentStore, secrets SecretStore) (bool, error)
func (*Operation) NewScriptVars ¶
func (self *Operation) NewScriptVars(tasks TaskStore, repositories RepositoryStore) (interface{}, error)
func (*Operation) NewSetupScriptCtxt ¶
func (self *Operation) NewSetupScriptCtxt(wsbi *WorkspaceBaseImage, project *Project) (*OperationSetupScriptCtxt, error)
NewSetupScriptCtxt returns the setup script context necessary for running this operation.
func (*Operation) Repositories ¶
func (self *Operation) Repositories(store RepositoryStore) ([]*Repository, error)
Repositories returns the list of repositories that will be used when running this operation. If the operation doesn't require any repositories to exist (such as a repository access check operation), then an empty slice of repositories and no error is returned. Otherwise any error returned originates from store.
func (*Operation) Secrets ¶
func (self *Operation) Secrets(es EnvironmentStore, ss SecretStore) ([]*Secret, error)
Secrets returns the secrets that are associated to this Operation.
func (*Operation) ShieldsIoStatusColorAndParams ¶
func (*Operation) Successful ¶
func (*Operation) Task ¶
Task returns the task which is used for running this operation.
If the operation is not associated with a task, nil is returned. Any errors returned are from store.
func (*Operation) UuidBigInt ¶
type OperationParameters ¶
type OperationParameters struct { // Checkout is a map of repository uuids to git references // that should be checked out before running an operation. Checkout map[string]string `json:"checkout"` // Reason is the reason for why this operation was triggered. Reason OperationTriggerReason `json:"reason"` // Username is the name of the user who triggered the // operation. Username string `json:"username,omitempty"` // UserUuid is the uuid of the user who triggered the // operation. UserUuid string `json:"userUuid,omitempty"` // ScheduleDescription is the description of the schedule which triggered // this operation. ScheduleDescription string `json:"scheduleDescription,omitempty"` // ScheduleUuid is the uuid of the schedule that triggered the // operation. ScheduleUuid string `json:"scheduleUuid,omitempty"` // TriggeredByDelivery is the uuid of the delivery that // triggered this operation. TriggeredByDelivery string `json:"triggeredByDelivery"` // TriggeredByGitTrigger is the uuid of the Git trigger that // triggered this operation. TriggeredByGitTrigger string `json:"triggeredByGitTrigger"` // GitTriggerName is the name of the Git trigger that // triggered this operation. GitTriggerName string `json:"gitTriggerName"` // TriggeredByNotificationRule is the uuid of the notification // rule that triggered this operation. TriggeredByNotificationRule string `json:"triggeredByNotificationRule"` // TriggeredByActivityId is the id of the activity that // triggered this operation. TriggeredByActivityId int `json:"triggeredByActivityId"` // Environment specifies a new environment that should be used // instead of the one specified by the job. Environment *Environment `json:"environment"` // Task specifies a new task that should be used instead of // the one specified by the job. Task *Task `json:"task"` // Secrets specifies new secrets that should be used instead // of the ones specified by the environment. Secrets []*OperationSecret `json:"secrets"` }
func NewOperationParameters ¶
func NewOperationParameters() *OperationParameters
func (*OperationParameters) AddSecret ¶
func (self *OperationParameters) AddSecret(name, value string) *OperationParameters
func (*OperationParameters) Init ¶
func (self *OperationParameters) Init() *OperationParameters
func (*OperationParameters) Scan ¶
func (self *OperationParameters) Scan(from interface{}) error
type OperationSecret ¶
type OperationSetupScriptCtxt ¶
type OperationSetupScriptCtxt struct { // Operation is the operation for which this script runs Operation *Operation // Keys is a list of SSH key pairs that need to be present in the // workspace for cloning any repositories before running an operation. Keys []*keyPair // Repositories is the list of repositories that are related to this // operation. Repositories []*Repository SshConfigs []*sshConfig // Parameters are operation-specific parameters that change // the state in which an operation runs. Parameters *OperationParameters // PreviousOperation is the last completed operation that ran // before this operation. This can be nil if there is no such // operation. PreviousOperation *Operation // WebhookBody is the body of the request that triggered this // operation via a webhook. If this operation has not been // triggered through a webhook, WebhookBody is nil. WebhookBody []byte // If the related repositories should be cloned. If false, only the // deploy keys will be written. ShouldCloneRepos bool // Environment is the environment in which the operation runs. This // value is used to define and export any necessary environment // variables before running the operation's user script. Environment *Environment // Secrets holds the EnvironmentSecrets for this job. They are being // exported as environment variables as well. Secrets []*EnvironmentSecret // WsbiName is the name of the docker workspace base image. // Operations are run in a docker container using this image. WsbiName string // WsbiRepository is the url of the git repository from where // the workspace base image can be obtained with "git clone". WsbiRepository string // WsbiPath is the path to change to within the repository for // workspace base images before invoking "make" to build the image. WsbiPath string }
func (*OperationSetupScriptCtxt) AddKey ¶
func (vars *OperationSetupScriptCtxt) AddKey(belongsTo, name, private, public string) *OperationSetupScriptCtxt
func (*OperationSetupScriptCtxt) AddSshConfig ¶
func (vars *OperationSetupScriptCtxt) AddSshConfig(repository *Repository, repostioryCredential *RepositoryCredential) *OperationSetupScriptCtxt
func (*OperationSetupScriptCtxt) LoadPreviousOperation ¶
func (self *OperationSetupScriptCtxt) LoadPreviousOperation(operations OperationStore) error
func (*OperationSetupScriptCtxt) LoadWebhookBody ¶
func (self *OperationSetupScriptCtxt) LoadWebhookBody(deliveries DeliveryStore) error
type OperationStore ¶
type OperationTriggerReason ¶
type OperationTriggerReason string
const ( OperationTriggeredByWebhook OperationTriggerReason = "webhook" OperationTriggeredBySchedule OperationTriggerReason = "schedule" OperationTriggeredByUser OperationTriggerReason = "user" OperationTriggeredByGitTrigger OperationTriggerReason = "git-trigger" OperationTriggeredByNotificationRule OperationTriggerReason = "notification-rule" )
func (OperationTriggerReason) String ¶
func (self OperationTriggerReason) String() string
type Organization ¶
type Organization struct { Uuid string `json:"uuid"` Name string `json:"name"` GithubLogin string `json:"githubLogin" db:"github_login"` Public bool `json:"public"` CreatedAt time.Time `json:"createdAt" db:"created_at"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` // contains filtered or unexported fields }
func (*Organization) AuthorizationName ¶
func (self *Organization) AuthorizationName() string
func (*Organization) CreationDate ¶
func (self *Organization) CreationDate() time.Time
CreationDate returns the date on which this organization was created.
func (*Organization) DeletionDate ¶
func (self *Organization) DeletionDate() time.Time
func (*Organization) FindOrganization ¶
func (self *Organization) FindOrganization(store OrganizationStore) (*Organization, error)
func (*Organization) FindProject ¶
func (self *Organization) FindProject(store ProjectStore) (*Project, error)
func (*Organization) Id ¶
func (self *Organization) Id() string
func (*Organization) NewBillingEvent ¶
func (self *Organization) NewBillingEvent(data BillingEventData) *BillingEvent
func (*Organization) OwnUrl ¶
func (self *Organization) OwnUrl(requestScheme, requestBaseUri string) string
type OrganizationMember ¶
type OrganizationMember struct { *User MembershipType string `json:"type" db:"membership_type"` OrganizationUuid string `json:"organizationUuid" db:"organization_uuid"` // contains filtered or unexported fields }
OrganizationMember augments the data from user with information about a user's membership with a given organization.
func NewOrganizationMember ¶
func NewOrganizationMember(user *User, membership *OrganizationMembership) *OrganizationMember
func (*OrganizationMember) AuthorizationName ¶
func (self *OrganizationMember) AuthorizationName() string
func (*OrganizationMember) Capabilities ¶
func (self *OrganizationMember) Capabilities() []string
func (*OrganizationMember) FindOrganization ¶
func (self *OrganizationMember) FindOrganization(organizations OrganizationStore) (*Organization, error)
FindOrganization satisfies authz.BelongsToOrganization by finding the organizing this member belongs to.
func (*OrganizationMember) FindUser ¶
func (self *OrganizationMember) FindUser(users UserStore) (*User, error)
func (*OrganizationMember) OwnUrl ¶
func (self *OrganizationMember) OwnUrl(requestScheme, requestBase string) string
func (*OrganizationMember) OwnedBy ¶
func (self *OrganizationMember) OwnedBy(user *User) bool
type OrganizationMembership ¶
type OrganizationMembership struct { OrganizationUuid string `json:"organizationUuid" db:"organization_uuid"` UserUuid string `json:"userUuid" db:"user_uuid"` Type string `json:"type"` CreatedAt time.Time `json:"createdAt" db:"created_at"` // contains filtered or unexported fields }
func (*OrganizationMembership) AuthorizationName ¶
func (self *OrganizationMembership) AuthorizationName() string
func (*OrganizationMembership) FindOrganization ¶
func (self *OrganizationMembership) FindOrganization(organizations OrganizationStore) (*Organization, error)
func (*OrganizationMembership) FindUser ¶
func (self *OrganizationMembership) FindUser(users UserStore) (*User, error)
func (*OrganizationMembership) OwnUrl ¶
func (self *OrganizationMembership) OwnUrl(requestScheme, requestBaseUri string) string
func (*OrganizationMembership) OwnedBy ¶
func (self *OrganizationMembership) OwnedBy(user *User) bool
type OrganizationStore ¶
type OrganizationStore interface { FindByUuid(uuid string) (*Organization, error) FindByProjectUuid(uuid string) (*Organization, error) }
OrganizationStore defines all the operations that are necessary for the domain to fetch associated organization objects.
type PrivilegedEnvironmentSecret ¶
type PrivilegedEnvironmentSecret struct { *UnprivilegedEnvironmentSecret Value string `json:"value"` }
PrivilegedEnvironmentSecret is meant for transport to privileged clients (i.e. project owners), and contains the Value
type PrivilegedSshSecret ¶
type PrivilegedSshSecret struct { *UnprivilegedSshSecret PrivateKey string `json:"privateKey"` }
PrivilegedSshSecret is meant for transport to privileged clients (i.e. project owners), and decodes both public and private keys
type Project ¶
type Project struct { Uuid string `json:"uuid"` OrganizationUuid string `json:"organizationUuid" db:"organization_uuid"` Name string `json:"name"` Public bool `json:"public"` CreatedAt time.Time `json:"createdAt" db:"created_at"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` // contains filtered or unexported fields }
func (*Project) AuthorizationName ¶
func (*Project) CreationDate ¶
func (*Project) DeletionDate ¶
func (*Project) FindOrganization ¶
func (self *Project) FindOrganization(store OrganizationStore) (*Organization, error)
FindOrganization satisfies authz.BelongsToOrganization in order to determine authorization.
func (*Project) FindProject ¶
func (self *Project) FindProject(store ProjectStore) (*Project, error)
FindProject satisfies authz.BelongsToProject in order to determine authorization.
func (*Project) NewDefaultEnvironment ¶
func (self *Project) NewDefaultEnvironment() *Environment
func (*Project) NewEmailNotifier ¶
func (self *Project) NewEmailNotifier(recipient, urlHost string) *EmailNotifier
NewEmailNotifier returns a new email notifier for the given recipient address and url host in this project.
func (*Project) NewEnvironment ¶
func (self *Project) NewEnvironment(name string) *Environment
NewEnvironment constructs a new environment object for this project.
func (*Project) NewGitTrigger ¶
func (self *Project) NewGitTrigger(name, creatorUuid, jobUuid string) *GitTrigger
NewGitTrigger returns a new git trigger in this project which fires on changes to master.
func (*Project) NewInvitationToHarrow ¶
func (self *Project) NewInvitationToHarrow(name, email, message string, membership string) *Invitation
NewInvitationToHarrow returns an invitation object suitable for inviting someone to join Harrow and become part of this project. See NewInvitationForUser for the meaning of the membership parameter.
func (*Project) NewInvitationToUser ¶
func (self *Project) NewInvitationToUser(message string, membership string, recipient *User) *Invitation
NewInvitationForUser returns an invitation object suitable for inviting the given Harrow user to the given project. Membership indicates the desired project membership level, i.e. whether the invited user should be considered a "guest" or "member", etc of the project, should she accept. Valid values for membership are defined by the various MembershipType* constants.
func (*Project) NewJob ¶
NewJob constructs a new job for the given task and environment in this project.
func (*Project) NewMembership ¶
func (self *Project) NewMembership(member *User, membershipType string) *ProjectMembership
NewMembership constructs a new project membership for this project and the given user.
func (*Project) NewNotificationRule ¶
func (self *Project) NewNotificationRule(notifierType, notifierUuid, jobUuid, matchActivities string) *NotificationRule
NewNotificationRule ...
func (*Project) NewRepository ¶
func (self *Project) NewRepository(name, url string) *Repository
NewRepository constructs a new repository for this project.
type ProjectCard ¶
type ProjectCard struct { LastActivitySeenAt time.Time ProjectUuid string `json:"projectUuid" db:"project_uuid"` ProjectName string `json:"projectName" db:"project_name"` LastTaskUuid string `json:"lastTaskUuid" db:"last_task_uuid"` LastTaskName string `json:"lastTaskName" db:"last_task_name"` LastTaskRunAt *time.Time `json:"lastTaskRunAt" db:"last_task_run_at"` LastTaskStatus string `json:"lastTaskStatus" db:"last_task_status"` // contains filtered or unexported fields }
func NewProjectCard ¶
func NewProjectCard(project *Project, environment *Environment, task *Task, mostRecentOperation *Operation) *ProjectCard
func (*ProjectCard) AuthorizationName ¶
func (self *ProjectCard) AuthorizationName() string
func (*ProjectCard) FindOrganization ¶
func (self *ProjectCard) FindOrganization(organizations OrganizationStore) (*Organization, error)
func (*ProjectCard) FindProject ¶
func (self *ProjectCard) FindProject(projects ProjectStore) (*Project, error)
func (*ProjectCard) OwnUrl ¶
func (self *ProjectCard) OwnUrl(requestScheme, requestBase string) string
type ProjectMember ¶
type ProjectMember struct { *User CreatedAt time.Time `json:"createdAt" db:"-"` MembershipType string `json:"type" db:"membership_type"` MembershipUuid *string `json:"membershipUuid" db:"membership_uuid"` ProjectUuid string `json:"projectUuid" db:"project_uuid"` // contains filtered or unexported fields }
ProjectMember augments User with project specific data.
func NewProjectMember ¶
func NewProjectMember(user *User, project *Project, projectMembership *ProjectMembership, organizationMembership *OrganizationMembership) *ProjectMember
func (*ProjectMember) AddMember ¶
func (self *ProjectMember) AddMember(userUuid string, membershipType string, projectMemberships ProjectMembershipCreator) (string, error)
func (*ProjectMember) AuthorizationName ¶
func (self *ProjectMember) AuthorizationName() string
func (*ProjectMember) Capabilities ¶
func (self *ProjectMember) Capabilities() []string
Capabilities satisfies authz.Role by returning a list of all capabilities the member has in its project.
func (*ProjectMember) FindProject ¶
func (self *ProjectMember) FindProject(projects ProjectStore) (*Project, error)
func (*ProjectMember) FindUser ¶
func (self *ProjectMember) FindUser(users UserStore) (*User, error)
func (*ProjectMember) OwnUrl ¶
func (self *ProjectMember) OwnUrl(requestScheme, requestBaseUri string) string
func (*ProjectMember) OwnedBy ¶
func (self *ProjectMember) OwnedBy(user *User) bool
func (*ProjectMember) Promote ¶
func (self *ProjectMember) Promote(other *ProjectMember) error
func (*ProjectMember) Remove ¶
func (self *ProjectMember) Remove(other *ProjectMember, projectMemberships Archiver) error
func (*ProjectMember) ToMembership ¶
func (self *ProjectMember) ToMembership() *ProjectMembership
type ProjectMembership ¶
type ProjectMembership struct { Uuid string `json:"uuid" db:"uuid"` ProjectUuid string `json:"projectUuid" db:"project_uuid"` UserUuid string `json:"userUuid" db:"user_uuid"` MembershipType string `json:"membershipType" db:"membership_type"` CreatedAt time.Time `json:"createdAt" db:"created_at"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` // contains filtered or unexported fields }
func (*ProjectMembership) AuthorizationName ¶
func (self *ProjectMembership) AuthorizationName() string
func (*ProjectMembership) FindProject ¶
func (self *ProjectMembership) FindProject(project ProjectStore) (*Project, error)
func (*ProjectMembership) FindUser ¶
func (self *ProjectMembership) FindUser(users UserStore) (*User, error)
func (*ProjectMembership) OwnUrl ¶
func (self *ProjectMembership) OwnUrl(requestScheme, requestUri string) string
func (*ProjectMembership) OwnedBy ¶
func (self *ProjectMembership) OwnedBy(user *User) bool
type ProjectMembershipCreator ¶
type ProjectMembershipCreator interface {
Create(membership *ProjectMembership) (string, error)
}
type ProjectStore ¶
type ProjectStore interface { FindByUuid(uuid string) (*Project, error) FindByMemberUuid(uuid string) (*Project, error) FindByOrganizationUuid(uuid string) (*Project, error) FindByNotifierUuid(uuid, notifierType string) (*Project, error) FindByJobUuid(uuid string) (*Project, error) FindByTaskUuid(uuid string) (*Project, error) FindByRepositoryUuid(uuid string) (*Project, error) FindByEnvironmentUuid(uuid string) (*Project, error) FindByWebhookUuid(uuid string) (*Project, error) FindByNotificationRule(notifierType string, notifierUuid string) (*Project, error) }
ProjectStore defines all operations that are necessary for the domain objects to work properly.
type RecentOperations ¶
type RepositoriesByName ¶
type RepositoriesByName interface {
FindAllByProjectUuidAndRepositoryName(projectUuid, name string) ([]*Repository, error)
}
type Repository ¶
type Repository struct { Uuid string `json:"uuid"` Url string `json:"url"` Name string `json:"name"` Accessible bool `json:"accessible"` VisibleTo string `json:"-" db:"visible_to"` ProjectUuid string `json:"projectUuid" db:"project_uuid"` GithubImported bool `json:"githubImported" db:"github_imported"` GithubLogin string `json:"githubLogin" db:"github_login"` GithubRepo string `json:"githubRepo" db:"github_repo"` CreatedAt time.Time `json:"createdAt" db:"created_at"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` MetadataUpdatedAt *time.Time `json:"metadataUpdatedAt" db:"metadata_updated_at"` Metadata *RepositoryMetaData `json:"metadata" db:"metadata"` ConnectedSuccessfully *bool `json:"connectedSuccessfully,omitempty" db:"connected_successfully"` // contains filtered or unexported fields }
func (*Repository) AuthorizationName ¶
func (self *Repository) AuthorizationName() string
func (*Repository) CloneURL ¶
func (self *Repository) CloneURL() string
CloneURL returns the URL to use for cloning the repository. This url can include sensitive informaiton (usernames, passwords).
func (*Repository) ClonedGit ¶
func (self *Repository) ClonedGit(OS git.System, credentials RepositoryCredentialStore) (*git.ClonedRepository, error)
func (*Repository) FindProject ¶
func (self *Repository) FindProject(store ProjectStore) (*Project, error)
FindProject satisfies authz.BelongsToProject in order to determine authorization.
func (*Repository) Git ¶
func (self *Repository) Git() (*git.Repository, error)
func (*Repository) NewMetadataUpdateOperation ¶
func (self *Repository) NewMetadataUpdateOperation() *Operation
NewMetadataUpdateOperation returns an operation for updating this repository's metadata.
func (*Repository) OwnUrl ¶
func (self *Repository) OwnUrl(requestScheme, requestBaseUri string) string
func (*Repository) PublicURL ¶
func (self *Repository) PublicURL() string
PublicURL returns the URL used for cloning this repository with all sensitive information removed.
func (*Repository) SetCredential ¶
func (self *Repository) SetCredential(credential *RepositoryCredential) *Repository
type RepositoryCheckout ¶
type RepositoryCheckouts ¶
type RepositoryCheckouts struct {
Refs map[string][]*RepositoryCheckout `json:"refs"`
}
func NewRepositoryCheckouts ¶
func NewRepositoryCheckouts() *RepositoryCheckouts
func (*RepositoryCheckouts) HandleEvent ¶
func (self *RepositoryCheckouts) HandleEvent(payload EventPayload)
func (*RepositoryCheckouts) Hash ¶
func (self *RepositoryCheckouts) Hash(repositoryUuid string) string
func (*RepositoryCheckouts) Ref ¶
func (self *RepositoryCheckouts) Ref(repositoryUuid string) string
func (*RepositoryCheckouts) Scan ¶
func (self *RepositoryCheckouts) Scan(data interface{}) error
type RepositoryCredential ¶
type RepositoryCredential struct { Uuid string `json:"uuid"` Name string `json:"name"` RepositoryUuid string `json:"repositoryUuid" db:"repository_uuid"` Type RepositoryCredentialType `json:"type"` Status RepositoryCredentialStatus `json:"status"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` SecretBytes []byte `json:"-" db:"-"` Key []byte `json:"-" db:"key"` PublicKey string `json:"publicKey,omitempty"` // contains filtered or unexported fields }
func (*RepositoryCredential) AuthorizationName ¶
func (self *RepositoryCredential) AuthorizationName() string
authz.Subject
func (*RepositoryCredential) FindProject ¶
func (self *RepositoryCredential) FindProject(store ProjectStore) (*Project, error)
authz.BelongsToProject
func (*RepositoryCredential) IsBasic ¶
func (self *RepositoryCredential) IsBasic() bool
func (*RepositoryCredential) IsPending ¶
func (self *RepositoryCredential) IsPending() bool
func (*RepositoryCredential) IsSsh ¶
func (self *RepositoryCredential) IsSsh() bool
func (*RepositoryCredential) Links ¶
func (self *RepositoryCredential) Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string
domain.Subject
func (*RepositoryCredential) OwnUrl ¶
func (self *RepositoryCredential) OwnUrl(requestScheme, requestBaseUri string) string
domain.Subject
type RepositoryCredentialStatus ¶
type RepositoryCredentialStatus string
var ( RepositoryCredentialPending RepositoryCredentialStatus = "pending" RepositoryCredentialPresent RepositoryCredentialStatus = "present" )
func (*RepositoryCredentialStatus) Scan ¶
func (self *RepositoryCredentialStatus) Scan(value interface{}) error
driver.Scanner
type RepositoryCredentialStore ¶
type RepositoryCredentialStore interface { FindByRepositoryUuid(repositoryUuid string) (*RepositoryCredential, error) FindByRepositoryUuidAndType(repositoryUuid string, credentialType RepositoryCredentialType) (*RepositoryCredential, error) }
RepositoryCredentialStore defines all the operations that are necessary for domain objects to fetch associated repository credential objects.
type RepositoryCredentialType ¶
type RepositoryCredentialType string
var ( RepositoryCredentialSsh RepositoryCredentialType = "ssh" RepositoryCredentialBasic RepositoryCredentialType = "basic" )
func (*RepositoryCredentialType) Scan ¶
func (self *RepositoryCredentialType) Scan(value interface{}) error
driver.Scanner
type RepositoryCredentialTypeError ¶
type RepositoryCredentialTypeError struct { ExpectedType RepositoryCredentialType `json:"expectedType"` ActualType RepositoryCredentialType `json:"actualType"` }
func NewRepositoryCredentialTypeError ¶
func NewRepositoryCredentialTypeError(actual, expected RepositoryCredentialType) *RepositoryCredentialTypeError
func (*RepositoryCredentialTypeError) Error ¶
func (self *RepositoryCredentialTypeError) Error() string
type RepositoryMetaData ¶
type RepositoryMetaData struct { Contributors map[string]*Person `json:"contributors"` Refs map[string]string `json:"refs"` }
func NewRepositoryMetaData ¶
func NewRepositoryMetaData() *RepositoryMetaData
func (*RepositoryMetaData) Changes ¶
func (self *RepositoryMetaData) Changes(newVersion *RepositoryMetaData) *RepositoryMetaDataChanges
Changes returns the changes between this repository metadata and the new version provided as an argument.
func (*RepositoryMetaData) IsEmpty ¶
func (self *RepositoryMetaData) IsEmpty() bool
IsEmpty returns true if there are no refs contained in this instance.
func (*RepositoryMetaData) Scan ¶
func (self *RepositoryMetaData) Scan(value interface{}) error
func (*RepositoryMetaData) WithRef ¶
func (self *RepositoryMetaData) WithRef(symbolic, hash string) *RepositoryMetaData
WithRef adds a symbolic ref pointing to a given hash to this metadata object.
type RepositoryMetaDataChanges ¶
type RepositoryMetaDataChanges struct { AddedRefs []*RepositoryRef `json:"addedRefs"` RemovedRefs []*RepositoryRef `json:"removedRefs"` ChangedRefs []*ChangedRepositoryRef `json:"changedRefs"` }
func NewRepositoryMetaDataChanges ¶
func NewRepositoryMetaDataChanges() *RepositoryMetaDataChanges
func (*RepositoryMetaDataChanges) Add ¶
func (self *RepositoryMetaDataChanges) Add(ref *RepositoryRef) *RepositoryMetaDataChanges
Add marks ref as a ref that has been introduced with this set of changes.
func (*RepositoryMetaDataChanges) Added ¶
func (self *RepositoryMetaDataChanges) Added() []*RepositoryRef
Added returns the list of refs that have been added with this change. It never returns nil.
func (*RepositoryMetaDataChanges) Change ¶
func (self *RepositoryMetaDataChanges) Change(symbolic, oldHash, newHash string) *RepositoryMetaDataChanges
Change marks that ref's old hash has been changed to new with this set of changes.
func (*RepositoryMetaDataChanges) Changed ¶
func (self *RepositoryMetaDataChanges) Changed() []*ChangedRepositoryRef
Changed returns the list of refs that are pointing to a different hash with this set of changes. It never returns nil.
func (*RepositoryMetaDataChanges) Remove ¶
func (self *RepositoryMetaDataChanges) Remove(ref *RepositoryRef) *RepositoryMetaDataChanges
Remove marks ref as a ref that has been removed with this set of changes. The ref's hash points to the last known hash.
func (*RepositoryMetaDataChanges) Removed ¶
func (self *RepositoryMetaDataChanges) Removed() []*RepositoryRef
Removed returns the list of refs that have been removed with this change. It never returns nil.
type RepositoryOperationVars ¶
type RepositoryOperationVars struct { // Url is the URL pointing to the repository to which this // operation applies. Url string }
RepositoryOperationVars hold the necessary information for the template production the shell script to run a repository operation.
type RepositoryRef ¶
type RepositoryRef struct { RepositoryUuid string `json:"repositoryUuid"` Symbolic string `json:"symbolic"` Hash string `json:"hash"` }
func NewRepositoryRef ¶
func NewRepositoryRef(symbolic, hash string) *RepositoryRef
func (*RepositoryRef) FindProject ¶
func (self *RepositoryRef) FindProject(projects ProjectStore) (*Project, error)
type RepositoryStore ¶
type RepositoryStore interface { FindByUuid(repositoryUuid string) (*Repository, error) FindAllByJobUuid(jobUuid string) ([]*Repository, error) MarkAsAccessible(repositoryUuid string, accessible bool) error }
RepositoryStore defines all the operations that are necessary for domain objects to fetch associated repository objects.
type Schedulable ¶
type Schedulable interface { // NextOperation determines the next time an operation should // run. If now is non nil, the value it points to is used // instead of time.Now(). A zero time return value means, that no // next operation is scheduled. An error is returned when // invalid scheduling information is used for determining the // time of the next operation. // // The time returned is in the timezone specified by this // Schedulable. NextOperation(now *time.Time) (time.Time, error) // Validate tests whether the schedule is in valid state. If it // isn't, it returns an error of type (*ValidationError). // Validate may modify the internal state of the schedule to // pool, make it valid (if possible). Validate() error // Id returns the UUID of the schedule. This information is // required for managing the pool of live schedules. Id() string // JobId returns the UUID of the job to execute by this // Schedulable. JobId() string // IsRecurring is used by the Scheduler (and possibly others) // to determine whether to add this to the watch pool // or schedule it for immediate execution IsRecurring() bool // IsDisabled returns true or false based on the presense of a non // empty string in Disabled IsDisabled() bool OperationParameters() *OperationParameters // We echo the interface of domain.Subject in order to // be able to render Schedulables to the API as JSON // Url returns the URL referencing the subject itself OwnUrl(requestScheme, requestBaseUri string) string // Links fills in the _links object in the HAL response Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string }
func NewSchedulable ¶
func NewSchedulable(s *Schedule) (Schedulable, error)
TODO: This actually changes s via setupOneTime, but the name does not give that fact away. This method should probably be defined on a non-pointer, make a copy of s, or RunOnceAt should be a method so we don't need setupOneTime.
type Schedule ¶
type Schedule struct { Uuid string `json:"uuid"` UserUuid string `json:"userUuid" db:"user_uuid"` JobUuid string `json:"jobUuid" db:"job_uuid"` Cronspec *string `json:"cronspec"` Description string `json:"description"` CreatedAt time.Time `json:"createdAt" db:"created_at"` Timespec *string `json:"timespec,omitempty"` TimezoneName string `json:"location" db:"location"` Parameters *OperationParameters `json:"parameters" db:"parameters"` NextExecutions []*ScheduledExecution `json:"nextExecutions,omitempty", db:"-"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` // Disabled is an enum describing the reason this Schedule is disabled // If it is nil, the Schedule is enabled. Disabled *string `json:"disabled" db:"disabled"` // DisabledBecause describes the error in case of ScheduleDisabledInternalError DisabledBecause *string `json:"-" db:"disabled_because"` // RunOnceAt contains the result of parsing a timespec by at(1). // It is necessary to cache this value in the database, because // evaluating a timespec by at(1) can depend on the current time. // Repeatedly evaluating 'now + 2 minutes' for example yields a // different time everytime it is evaluated. RunOnceAt *time.Time `json:"runOnceAt,omitempty" db:"run_once_at"` // contains filtered or unexported fields }
func (*Schedule) AuthorizationName ¶
func (*Schedule) FindProject ¶
func (self *Schedule) FindProject(store ProjectStore) (*Project, error)
FindProject satisfies authz.BelongsToProject in order to determine authorization.
func (*Schedule) FindUser ¶
FindUser satisies authz.BelongsToUser in order to determine authorization.
func (*Schedule) OperationParameters ¶
func (self *Schedule) OperationParameters() *OperationParameters
type ScheduledExecution ¶
type ScheduledExecution struct { Time time.Time `json:"time"` JobUuid string `json:"jobUuid"` Spec string `json:"spec"` Description string `json:"description"` // contains filtered or unexported fields }
func ExecutionsBetween ¶
func NewScheduledExecution ¶
func NewScheduledExecution(time time.Time, jobUuid, spec, description string) *ScheduledExecution
func (*ScheduledExecution) AuthorizationName ¶
func (self *ScheduledExecution) AuthorizationName() string
func (*ScheduledExecution) Embedded ¶
func (self *ScheduledExecution) Embedded() map[string][]Subject
func (*ScheduledExecution) OwnUrl ¶
func (self *ScheduledExecution) OwnUrl(requestScheme, requestBaseUri string) string
type ScriptCard ¶
type ScriptCard struct { ProjectUuid string `json:"projectUuid" db:"project_uuid"` ScriptUuid string `json:"scriptUuid" db:"script_uuid"` ScriptName string `json:"scriptName" db:"script_name"` LastOperation *Operation `json:"lastOperation" db:"last_operation"` EnabledEnvironments []*Environment `json:"enabledEnvironments"` RecentOperationStatusByEnvironmentUuid map[string][]string `json:"recentOperationStatusByEnvironmentUuid"` // contains filtered or unexported fields }
func (*ScriptCard) AuthorizationName ¶
func (self *ScriptCard) AuthorizationName() string
func (*ScriptCard) FindProject ¶
func (self *ScriptCard) FindProject(projects ProjectStore) (*Project, error)
type Secret ¶
type Secret struct { Uuid string `json:"uuid"` Name string `json:"name"` EnvironmentUuid string `json:"environmentUuid" db:"environment_uuid"` Type SecretType `json:"type"` Status SecretStatus `json:"status"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` Key []byte `json:"-" db:"key"` SecretBytes []byte `json:"-" db:"-"` // contains filtered or unexported fields }
func (*Secret) FindProject ¶
func (self *Secret) FindProject(store ProjectStore) (*Project, error)
authz.BelongsToProject
func (*Secret) IsEnvOverride ¶
type SecretStatus ¶
type SecretStatus string
var ( SecretPending SecretStatus = "pending" SecretPresent SecretStatus = "present" )
type SecretStore ¶
SecretStore defines all the operations that are necessary for domain objects to fetch associated secret objects
type SecretType ¶
type SecretType string
var ( SecretEnv SecretType = "env" SecretEnvOverride SecretType = "env-override" SecretSsh SecretType = "ssh" )
type Session ¶
type Session struct { Uuid string `json:"uuid"` UserUuid string `json:"userUuid" db:"user_uuid"` EndedAt time.Time `json:"-" db:"ended_at"` LoadedAt time.Time `json:"loadedAt" db:"loaded_at"` ExpiresAt time.Time `json:"expiresAt" db:"expires_at"` CreatedAt time.Time `json:"createdAt" db:"created_at"` ValidatedAt time.Time `json:"validatedAt" db:"validated_at"` LoggedOutAt *time.Time `json:"loggedOutAt" db:"logged_out_at"` InvalidatedAt *time.Time `json:"invalidatedAt" db:"invalidated_at"` Valid bool `json:"valid" db:"-"` UserAgent string `json:"userAgent" db:"user_agent"` ClientAddress string `json:"clientAddress" db:"client_address"` // contains filtered or unexported fields }
func (*Session) AuthorizationName ¶
func (*Session) IsInvalidated ¶
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
type SlackNotifier ¶
type SlackNotifier struct { Uuid string `json:"uuid" db:"uuid"` Name string `json:"name" db:"name"` WebhookURL string `json:"webhookURL" db:"webhook_url"` UrlHost string `json:"urlHost" db:"url_host"` ProjectUuid string `json:"projectUuid" db:"project_uuid"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` // contains filtered or unexported fields }
func (*SlackNotifier) AuthorizationName ¶
func (self *SlackNotifier) AuthorizationName() string
func (*SlackNotifier) FindProject ¶
func (self *SlackNotifier) FindProject(projects ProjectStore) (*Project, error)
func (*SlackNotifier) OwnUrl ¶
func (self *SlackNotifier) OwnUrl(requestScheme, requestBase string) string
func (*SlackNotifier) Validate ¶
func (self *SlackNotifier) Validate() error
type SshRepositoryCredential ¶
type SshRepositoryCredential struct { *RepositoryCredential `json:"-"` PrivateKey, PublicKey string }
func AsSshRepositoryCredential ¶
func AsSshRepositoryCredential(rc *RepositoryCredential) (*SshRepositoryCredential, error)
func (*SshRepositoryCredential) AsRepositoryCredential ¶
func (self *SshRepositoryCredential) AsRepositoryCredential() (*RepositoryCredential, error)
type SshSecret ¶
func AsSshSecret ¶
func (*SshSecret) AsPrivileged ¶
func (self *SshSecret) AsPrivileged() (*PrivilegedSshSecret, error)
func (*SshSecret) AsUnprivileged ¶
func (self *SshSecret) AsUnprivileged() (*UnprivilegedSshSecret, error)
type StatusLogEntry ¶
type StatusLogEntry struct { OccurredOn time.Time `json:"occurredOn"` Type string `json:"type"` Subject string `json:"subject"` Body string `json:"body"` }
func NewStatusLogEntry ¶
func NewStatusLogEntry(entryType string) *StatusLogEntry
NewStatusLogEntry returns a new empty status log entry of the given type.
type StatusLogs ¶
type StatusLogs struct {
Entries []*StatusLogEntry `json:"entries"`
}
func NewStatusLogs ¶
func NewStatusLogs() *StatusLogs
NewStatusLogs returns an empty list of status logs.
func (*StatusLogs) HandleEvent ¶
func (self *StatusLogs) HandleEvent(payload EventPayload)
HandleEvent adds new entries to the logs
func (*StatusLogs) Len ¶
func (self *StatusLogs) Len() int
func (*StatusLogs) Less ¶
func (self *StatusLogs) Less(i, j int) bool
Less compares status log entries by occurrence date, ascending.
func (*StatusLogs) Log ¶
func (self *StatusLogs) Log(entry *StatusLogEntry) *StatusLogs
Log adds entry to the end of this log and sorts entries by ocurrence date.
func (*StatusLogs) Newest ¶
func (self *StatusLogs) Newest() *StatusLogEntry
Newest returns the newest entry in this log going by the entries' occurrence date.
func (*StatusLogs) Scan ¶
func (self *StatusLogs) Scan(data interface{}) error
Scan deserializes value as a JSON array.
func (*StatusLogs) Swap ¶
func (self *StatusLogs) Swap(i, j int)
type Stencil ¶
type Stencil struct { Id string `json:"id"` ProjectUuid string `json:"projectUuid,omitempty"` UserUuid string `json:"userUuid,omitempty"` NotifyViaEmail string `json:"notifyViaEmail,omitempty"` UrlHost string `json:"urlHost,omitempty"` // contains filtered or unexported fields }
func (*Stencil) AuthorizationName ¶
func (*Stencil) FindProject ¶
func (self *Stencil) FindProject(projects ProjectStore) (*Project, error)
type Subject ¶
type Subject interface { // Url returns the URL referencing the subject itself OwnUrl(requestScheme, requestBaseUri string) string // Links fills in the _links object in the HAL response Links(response map[string]map[string]string, requestScheme, requestBaseUri string) map[string]map[string]string // Embedded is used for embedding relations Embedded() map[string][]Subject }
Subject defines the methods necessary for creating a JSON-HAL compliant response object.
type Subscription ¶
type Subscription struct { Uuid string `json:"uuid" db:"uuid"` UserUuid string `json:"userUuid" db:"user_uuid"` WatchableUuid string `json:"watchableUuid" db:"watchable_uuid"` WatchableType string `json:"watchableType" db:"watchable_type"` EventName string `json:"eventName" db:"event_name"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` CreatedAt *time.Time `json:"createdAt" db:"created_at"` }
func NewSubscription ¶
func NewSubscription(watchable Watchable, event, userUuid string) *Subscription
func (*Subscription) AuthorizationName ¶
func (self *Subscription) AuthorizationName() string
func (*Subscription) OwnedBy ¶
func (self *Subscription) OwnedBy(user *User) bool
type SubscriptionStore ¶
type Subscriptions ¶
type Subscriptions struct { WatcherUuid string `json:"watcherUuid"` WatchableUuid string `json:"watchableUuid"` WatchableType string `json:"watchableType"` Subscribed map[string]bool `json:"subscribed"` // contains filtered or unexported fields }
Subscriptions is aggregates all event subscriptions of a single user on a given watchable.
func (*Subscriptions) AuthorizationName ¶
func (self *Subscriptions) AuthorizationName() string
func (*Subscriptions) FindUser ¶
func (self *Subscriptions) FindUser(users UserStore) (*User, error)
func (*Subscriptions) OwnUrl ¶
func (self *Subscriptions) OwnUrl(requestScheme, requestBase string) string
func (*Subscriptions) OwnedBy ¶
func (self *Subscriptions) OwnedBy(user *User) bool
type Target ¶
type Target struct { Uuid string `json:"uuid"` CreatedAt time.Time `json:"createdAt" db:"created_at"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` AccessibeSince *time.Time `json:"accessibeSince" db:"accessibe_since"` EnvironmentUuid string `json:"EnvironmentUuid" db:"environment_uuid"` Identifier string `json:"identifier"` ProjectUuid string `json:"projectUuid" db:"project_uuid"` Secret string `json:"secret"` Type string `json:"type"` Url string `json:"url"` // contains filtered or unexported fields }
func (*Target) AuthorizationName ¶
func (*Target) FindProject ¶
func (self *Target) FindProject(projects ProjectStore) (*Project, error)
type Task ¶
type Task struct { Uuid string `json:"uuid"` Body string `json:"body"` CreatedAt time.Time `json:"createdAt" db:"created_at"` Name string `json:"name"` ProjectUuid string `json:"projectUuid" db:"project_uuid"` Type string `json:"type"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` // contains filtered or unexported fields }
func (*Task) AuthorizationName ¶
func (*Task) CreationDate ¶
func (*Task) FindProject ¶
func (self *Task) FindProject(store ProjectStore) (*Project, error)
FindProject satisfies authz.BelongsToProject in order to determine authorization.
func (*Task) NewJob ¶
func (self *Task) NewJob(environment *Environment) *Job
NewJob constructs a new job for this task in the given environment
type TaskStore ¶
TaskStore defines all the operations that are necessary for domain objects to fetch associated task objects.
type TotpToken ¶
TotpToken defines the methods necessary for verifying time-based one-time password tokens.
type TotpTokenWithClock ¶
TotpTokenWithClock implements a TotpToken which does not depend on the time package but uses the domain clock instead.
func NewTotpTokenWithClock ¶
func NewTotpTokenWithClock(secretB32 string) (*TotpTokenWithClock, error)
func (*TotpTokenWithClock) FromNow ¶
func (totp *TotpTokenWithClock) FromNow(periods int64) int32
type UnprivilegedEnvironmentSecret ¶
type UnprivilegedEnvironmentSecret struct {
*Secret
}
UnprivilegedEnvironmentSecret is meant for transport to unprivileged clients (i.e. project members), and doesn't containt the Value
type UnprivilegedSshSecret ¶
UnprivilegedSshSecret is meant for transport to unprivileged clients (i.e. project members), and only decodes the public key
type User ¶
type User struct { Uuid string `json:"uuid"` Email string `json:"email"` GhUsername *string `json:"ghUsername" db:"gh_username"` Name string `json:"name"` Password string `json:"password,omitempty"` Token string `json:"-" db:"token"` // If true, the user has no password. They can change user details without // providing a password (Name, Email) and cannot log in with username+password // This is true for example for users created as result of a OAuth login in WithoutPassword bool `json:"withoutPassword" db:"without_password"` CreatedAt time.Time `json:"createdAt" db:"created_at"` TotpSecret string `json:"-" db:"totp_secret"` TotpEnabledAt *time.Time `json:"totpEnabledAt" db:"totp_enabled_at"` PasswordHash string `json:"-" db:"password_hash"` // TODO(paul): unused, remove? PasswordResetToken string `json:"passwordResetToken,omitempty" db:"password_reset_token"` UrlHost string `json:"urlHost" db:"url_host"` SignupParameters Dictionary `json:"signupParameters" db:"signup_parameters"` // contains filtered or unexported fields }
User is a basic type representing users in the system, the JSON marshalling of this type is intentionally disabled for private and public members as they should never be marshalled directly, everything should go through presentation.User marshaller.
func (*User) AuthorizationName ¶
func (*User) Capabilities ¶
func (*User) CurrentTotpToken ¶
func (*User) DisableTotp ¶
func (*User) EnableTotp ¶
func (*User) FindProject ¶
func (self *User) FindProject(store ProjectStore) (*Project, error)
func (*User) GenerateTotpSecret ¶
func (self *User) GenerateTotpSecret()
func (*User) InvitedTo ¶
func (self *User) InvitedTo(project *Project, invitations InvitationStore) (bool, error)
func (*User) IsSubscribedTo ¶
func (*User) IsValidTotpToken ¶
func (*User) NewSession ¶
func (*User) SubscribeTo ¶
func (self *User) SubscribeTo(watchable Watchable, event string, subscriptions SubscriptionStore) error
func (*User) SubscriptionsFor ¶
func (self *User) SubscriptionsFor(watchable Watchable, allSubscriptions SubscriptionStore) (*Subscriptions, error)
func (*User) TotpEnabled ¶
func (*User) UnsubscribeFrom ¶
func (self *User) UnsubscribeFrom(watchable Watchable, event string, subscriptions SubscriptionStore) error
type UserBlock ¶
type UserBlock struct { Uuid string `json:"uuid" db:"uuid"` UserUuid string `json:"userUuid" db:"user_uuid"` Reason string `json:"reason" db:"reason"` ValidFrom *time.Time `json:"validFrom" db:"valid_from"` ValidTo *time.Time `json:"validTo" db:"valid_to"` // contains filtered or unexported fields }
func (*UserBlock) BlockForever ¶
type UserHistory ¶
type UserHistory struct {
// contains filtered or unexported fields
}
func NewUserHistory ¶
func NewUserHistory(userUuid string, today time.Time) *UserHistory
func (*UserHistory) HandleActivity ¶
func (self *UserHistory) HandleActivity(activity *Activity) error
HandleActivity updates the history for this user.
func (*UserHistory) IsActive ¶
func (self *UserHistory) IsActive() bool
IsActive returns whether this user has been reported as active today already.
func (*UserHistory) PreviousSegment ¶
func (self *UserHistory) PreviousSegment() string
PreviousSegment returns the segment the user was in previously, according to segment-entered and segment-left activities. If no such activities exist for a user, SegmentLimbo is returned.
func (*UserHistory) Segment ¶
func (self *UserHistory) Segment() string
Segment returns the KPI segment the user is in. See the various Segment variables for which user falls into which segment.
func (*UserHistory) VerificationEmailsRequestedToday ¶
func (self *UserHistory) VerificationEmailsRequestedToday() int
VerificationEmailsRequestedToday returns the number verification emails that have been requested for this user today.
type UserStore ¶
type UserStore interface { FindByUuid(uuid string) (*User, error) FindAllSubscribers(watchableId, event string) ([]*User, error) }
UserStore defines all the operations that are necessary for the domain to fetch associated user objects.
type ValidationError ¶
type ValidationError struct { Errors map[string][]string `json:"errors"` Originals map[string]error `json:"-"` }
func EmptyValidationError ¶
func EmptyValidationError() *ValidationError
func NewValidationError ¶
func NewValidationError(key, value string) *ValidationError
func (*ValidationError) Add ¶
func (ve *ValidationError) Add(key, err string) *ValidationError
func (*ValidationError) Error ¶
func (ve *ValidationError) Error() string
func (*ValidationError) Get ¶
func (ve *ValidationError) Get(key string) string
func (*ValidationError) ToError ¶
func (ve *ValidationError) ToError() error
type Webhook ¶
type Webhook struct { Uuid string `json:"uuid" db:"uuid"` ProjectUuid string `json:"projectUuid" db:"project_uuid"` CreatorUuid string `json:"creatorUuid" db:"creator_uuid"` JobUuid string `json:"jobUuid" db:"job_uuid"` Name string `json:"name" db:"name"` Slug string `json:"slug" db:"slug"` CreatedAt time.Time `json:"createdAt" db:"created_at"` ArchivedAt *time.Time `json:"archivedAt" db:"archived_at"` // contains filtered or unexported fields }
func NewWebhook ¶
func (*Webhook) AuthorizationName ¶
func (*Webhook) FindProject ¶
func (self *Webhook) FindProject(projects ProjectStore) (*Project, error)
func (*Webhook) GenerateSlug ¶
func (self *Webhook) GenerateSlug()
func (*Webhook) IsInternal ¶
IsInternal returns true if the webhook has been created internally by Harrow (e.g. for supporting job notifiers).
type WorkspaceBaseImage ¶
type WorkspaceBaseImage struct { Uuid string `json:"uuid" db:"uuid"` Name string `json:"name" db:"name"` Type string `json:"type" db:"type"` Path string `json:"path" db:"path"` Ref string `json:"ref" db:"ref"` Repository string `json:"repository" db:"repository"` CreatedAt time.Time `json:"createdAt" db:"created_at"` // contains filtered or unexported fields }
func (*WorkspaceBaseImage) AuthorizationName ¶
func (self *WorkspaceBaseImage) AuthorizationName() string
type WorkspaceBaseImageStore ¶
type WorkspaceBaseImageStore interface {
FindByUuid(uuid string) (*WorkspaceBaseImage, error)
}
WorkspaceBaseImageStore defines all the operations that are necessary for domain objects to fetch associated workspace base images.
Source Files ¶
- activity.go
- activity_on_stream.go
- basic_repository_credential.go
- billing_event.go
- billing_history.go
- billing_plan.go
- capabilities.go
- capability_list.go
- credit_card.go
- delivered_request.go
- delivery.go
- dependencies.go
- dictionary.go
- domain.go
- email_notifier.go
- environment.go
- environment_secret.go
- errors.go
- events.go
- feature.go
- git_logs.go
- git_trigger.go
- gravatar_url.go
- invitation.go
- iso_date.go
- job.go
- job_notifier.go
- limits.go
- loggable.go
- map_payload.go
- membership_type.go
- money.go
- notification_rule.go
- oauth_token.go
- operation.go
- operation_type.go
- organization.go
- organization_member.go
- organization_membership.go
- project.go
- project_card.go
- project_member.go
- project_membership.go
- repository.go
- repository_checkouts.go
- repository_credential.go
- repository_metadata.go
- repository_metadata_changes.go
- schedule.go
- scheduled_execution.go
- script_card.go
- secret.go
- session.go
- slack_notifier.go
- ssh_repository_credential.go
- ssh_secret.go
- status_logs.go
- stencil.go
- subject.go
- subscription.go
- subscriptions.go
- target.go
- task.go
- task_type.go
- totp_token.go
- user.go
- user_block.go
- user_history.go
- watchable.go
- webhook.go
- workspace_base_image.go
- workspace_base_image_type.go