Documentation
¶
Index ¶
- Constants
- Variables
- type Credential
- type CredentialLogin
- type CredentialShell
- type Environment
- type EnvironmentSecret
- type EnvironmentValue
- type Event
- type EventAction
- type EventType
- type Execution
- type ExecutionStatus
- type Group
- type GroupProject
- type GroupProjectParams
- type Inventory
- type ListParams
- type Output
- type Project
- type Repository
- type Runner
- type Schedule
- type Template
- type TemplateSurvey
- type TemplateValue
- type TemplateVault
- type User
- type UserAuth
- type UserGroup
- type UserGroupParams
- type UserProject
- type UserProjectParams
- type UserToken
- type UserTokenKind
Constants ¶
const ( // GroupProjectOwnerPerm defines the permission for an owner on group projects. GroupProjectOwnerPerm = OwnerPerm // GroupProjectAdminPerm defines the permission for an admin on group projects. GroupProjectAdminPerm = AdminPerm // GroupProjectUserPerm defines the permission for an user on group projects. GroupProjectUserPerm = UserPerm )
const ( // OwnerPerm defines the general permission for an owner. OwnerPerm = "owner" // AdminPerm defines the general permission for an admin. AdminPerm = "admin" // UserPerm defines the general permission for an user. UserPerm = "user" )
const ( // UserGroupOwnerPerm defines the permission for an owner on user groups. UserGroupOwnerPerm = OwnerPerm // UserGroupAdminPerm defines the permission for an admin on user groups. UserGroupAdminPerm = AdminPerm // UserGroupUserPerm defines the permission for an user on user groups. UserGroupUserPerm = UserPerm )
const ( // UserProjectOwnerPerm defines the permission for an owner on user projects. UserProjectOwnerPerm = OwnerPerm // UserProjectAdminPerm defines the permission for an admin on user projects. UserProjectAdminPerm = AdminPerm // UserProjectUserPerm defines the permission for an user on user projects. UserProjectUserPerm = UserPerm )
Variables ¶
var ( // ErrWrongEncryptionPassphrase defines the error if it fails to validate the encryption passphrase. ErrWrongEncryptionPassphrase = fmt.Errorf("wrong encryption passphrase") )
Functions ¶
This section is empty.
Types ¶
type Credential ¶
type Credential struct {
bun.BaseModel `bun:"table:credentials"`
ID string `bun:",pk,type:varchar(20)"`
ProjectID string `bun:"type:varchar(20)"`
Project *Project `bun:"rel:belongs-to,join:project_id=id"`
Slug string `bun:"type:varchar(255)"`
Name string `bun:"type:varchar(255)"`
Kind string `bun:"type:varchar(255)"`
Override bool `bun:"type:bool"`
Shell CredentialShell `bun:"embed:shell_"`
Login CredentialLogin `bun:"embed:login_"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
Credential defines the model for credentials table.
func (*Credential) BeforeAppendModel ¶
BeforeAppendModel implements the bun hook interface.
func (*Credential) DeserializeSecret ¶
func (m *Credential) DeserializeSecret(passphrase string) error
DeserializeSecret ensures to decrypt all related secrets stored on the database.
func (*Credential) SerializeSecret ¶
func (m *Credential) SerializeSecret(passphrase string) error
SerializeSecret ensures to encrypt all related secrets stored on the database.
type CredentialLogin ¶
type CredentialLogin struct {
Username string `bun:"type:varchar(255)"`
Password string `bun:"type:varchar(255)"`
}
CredentialLogin represents credentials for logins.
func (*CredentialLogin) DeserializeSecret ¶
func (m *CredentialLogin) DeserializeSecret(passphrase string) error
DeserializeSecret ensures to decrypt all related secrets stored on the database.
func (*CredentialLogin) SerializeSecret ¶
func (m *CredentialLogin) SerializeSecret(passphrase string) error
SerializeSecret ensures to encrypt all related secrets stored on the database.
type CredentialShell ¶
type CredentialShell struct {
Username string `bun:"type:varchar(255)"`
Password string `bun:"type:varchar(255)"`
PrivateKey string `bun:"type:text"`
}
CredentialShell represents credentials for shells.
func (*CredentialShell) DeserializeSecret ¶
func (m *CredentialShell) DeserializeSecret(passphrase string) error
DeserializeSecret ensures to decrypt all related secrets stored on the database.
func (*CredentialShell) SerializeSecret ¶
func (m *CredentialShell) SerializeSecret(passphrase string) error
SerializeSecret ensures to encrypt all related secrets stored on the database.
type Environment ¶
type Environment struct {
bun.BaseModel `bun:"table:environments"`
ID string `bun:",pk,type:varchar(20)"`
ProjectID string `bun:"type:varchar(20)"`
Project *Project `bun:"rel:belongs-to,join:project_id=id"`
Slug string `bun:"type:varchar(255)"`
Name string `bun:"type:varchar(255)"`
Secrets []*EnvironmentSecret `bun:"rel:has-many,join:id=environment_id"`
Values []*EnvironmentValue `bun:"rel:has-many,join:id=environment_id"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
Environment defines the model for environments table.
func (*Environment) BeforeAppendModel ¶
BeforeAppendModel implements the bun hook interface.
func (*Environment) DeserializeSecret ¶
func (m *Environment) DeserializeSecret(passphrase string) error
DeserializeSecret ensures to decrypt all related secrets stored on the database.
func (*Environment) SerializeSecret ¶
func (m *Environment) SerializeSecret(passphrase string) error
SerializeSecret ensures to encrypt all related secrets stored on the database.
type EnvironmentSecret ¶
type EnvironmentSecret struct {
bun.BaseModel `bun:"table:environment_secrets"`
ID string `bun:",pk,type:varchar(20)"`
EnvironmentID string `bun:"type:varchar(20)"`
Kind string `bun:"type:varchar(255)"`
Name string `bun:"type:varchar(255)"`
Content string `bun:"type:text"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
EnvironmentSecret defines the model for environment_secrets table.
func (*EnvironmentSecret) BeforeAppendModel ¶
BeforeAppendModel implements the bun hook interface.
func (*EnvironmentSecret) DeserializeSecret ¶
func (m *EnvironmentSecret) DeserializeSecret(passphrase string) error
DeserializeSecret ensures to decrypt all related secrets stored on the database.
func (*EnvironmentSecret) SerializeSecret ¶
func (m *EnvironmentSecret) SerializeSecret(passphrase string) error
SerializeSecret ensures to encrypt all related secrets stored on the database.
type EnvironmentValue ¶
type EnvironmentValue struct {
bun.BaseModel `bun:"table:environment_values"`
ID string `bun:",pk,type:varchar(20)"`
EnvironmentID string `bun:"type:varchar(20)"`
Kind string `bun:"type:varchar(255)"`
Name string `bun:"type:varchar(255)"`
Content string `bun:"type:text"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
EnvironmentValue defines the model for environment_values table.
func (*EnvironmentValue) BeforeAppendModel ¶
BeforeAppendModel implements the bun hook interface.
func (*EnvironmentValue) DeserializeSecret ¶
func (m *EnvironmentValue) DeserializeSecret(passphrase string) error
DeserializeSecret ensures to decrypt all related secrets stored on the database.
func (*EnvironmentValue) SerializeSecret ¶
func (m *EnvironmentValue) SerializeSecret(passphrase string) error
SerializeSecret ensures to encrypt all related secrets stored on the database.
type Event ¶
type Event struct {
bun.BaseModel `bun:"table:events"`
ID string `bun:",pk,type:varchar(20)"`
UserID string `bun:"type:varchar(20)"`
UserHandle string `bun:"type:varchar(255)"`
UserDisplay string `bun:"type:varchar(255)"`
ProjectID string `bun:"type:varchar(20)"`
ProjectDisplay string `bun:"type:varchar(255)"`
ObjectID string `bun:"type:varchar(20)"`
ObjectDisplay string `bun:"type:varchar(255)"`
ObjectType EventType `bun:"type:varchar(255)"`
Action EventAction `bun:"type:varchar(255)"`
Attrs map[string]interface{} `bun:"-"`
RawAttrs string `bun:"attrs,nullzero,type:text"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
Event defines the model for events table.
func PrepareEvent ¶
PrepareEvent prefills the event model with principal information if available.
func (*Event) AfterScanRow ¶
AfterScanRow implements the bun hook interface.
func (*Event) BeforeAppendModel ¶
BeforeAppendModel implements the bun hook interface.
func (*Event) DeserializeSecret ¶
DeserializeSecret ensures to decrypt all related secrets stored on the database.
func (*Event) SerializeSecret ¶
SerializeSecret ensures to encrypt all related secrets stored on the database.
type EventAction ¶
type EventAction string
EventAction defines a custom type for event actions.
const ( // EventActionCreate defines the action create. EventActionCreate EventAction = "create" // EventActionUpdate defines the action update. EventActionUpdate EventAction = "update" // EventActionDelete defines the action delete. EventActionDelete EventAction = "delete" )
type EventType ¶
type EventType string
EventType defines a custom type for event types.
const ( // EventTypeUser defines event type for users. EventTypeUser EventType = "user" // EventTypeUserGroup defines event type for user groups. EventTypeUserGroup EventType = "user_group" // EventTypeUserProject defines event type for user projects. EventTypeUserProject EventType = "user_project" // EventTypeGroup defines event type for groups. EventTypeGroup EventType = "group" // EventTypeGroupUser defines event type for group users. EventTypeGroupUser EventType = "group_user" // EventTypeGroupProject defines event type for group projects. EventTypeGroupProject EventType = "group_project" // EventTypeProject defines event type for projects. EventTypeProject EventType = "project" // EventTypeProjectUser defines event type for project users. EventTypeProjectUser EventType = "project_user" // EventTypeProjectGroup defines event type for project groups. EventTypeProjectGroup EventType = "project_group" // EventTypeRunner defines event type for runners. EventTypeRunner EventType = "runner" // EventTypeCredential defines event type for credentials. EventTypeCredential EventType = "credential" // EventTypeRepository defines event type for repositories. EventTypeRepository EventType = "repository" // EventTypeInventory defines event type for inventories. EventTypeInventory EventType = "inventory" // EventTypeEnvironment defines event type for environments. EventTypeEnvironment EventType = "environment" // EventTypeEnvironmentSecret defines event type for environment secrets. EventTypeEnvironmentSecret EventType = "environment_secret" // EventTypeEnvironmentValue defines event type for environment vaules. EventTypeEnvironmentValue EventType = "environment_value" // EventTypeTemplate defines event type for templates. EventTypeTemplate EventType = "template" // EventTypeTemplateSurvey defines event type for template surveys. EventTypeTemplateSurvey EventType = "template_survey" // EventTypeTemplateVault defines event type for template vaults. EventTypeTemplateVault EventType = "template_vault" // EventTypeSchedule defines event type for schedules. EventTypeSchedule EventType = "schedule" // EventTypeExecution defines event type for executions. EventTypeExecution EventType = "execution" // EventTypeOutput defines event type for outputs. EventTypeOutput EventType = "output" )
type Execution ¶
type Execution struct {
bun.BaseModel `bun:"table:executions"`
ID string `bun:",pk,type:varchar(20)"`
ProjectID string `bun:"type:varchar(20)"`
Project *Project `bun:"rel:belongs-to,join:project_id=id"`
TemplateID string `bun:"type:varchar(20)"`
Template *Template `bun:"rel:belongs-to,join:template_id=id"`
Name string `bun:"-"`
Status ExecutionStatus `bun:"type:varchar(255)"`
Path string `bun:"type:varchar(255)"`
Environment string `bun:"type:varchar(255)"`
Secret string `bun:"type:varchar(255)"`
Limit string `bun:"type:varchar(255)"`
Branch string `bun:"type:varchar(255)"`
Debug bool `bun:"type:bool"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
Execution defines the model for executions table.
func (*Execution) AfterScanRow ¶
AfterScanRow implements the bun hook interface.
func (*Execution) BeforeAppendModel ¶
BeforeAppendModel implements the bun hook interface.
func (*Execution) DeserializeSecret ¶
DeserializeSecret ensures to decrypt all related secrets stored on the database.
func (*Execution) SerializeSecret ¶
SerializeSecret ensures to encrypt all related secrets stored on the database.
type ExecutionStatus ¶
type ExecutionStatus string
ExecutionStatus defines a custom type for execution status.
const ( // ExecutionStatusWaiting defines the status waiting. ExecutionStatusWaiting ExecutionStatus = "waiting" // ExecutionStatusStarting defines the status starting. ExecutionStatusStarting ExecutionStatus = "starting" // ExecutionStatusConfirm defines the status confirm. ExecutionStatusConfirm ExecutionStatus = "confirm" // ExecutionStatusConfirmed defines the status confirmed. ExecutionStatusConfirmed ExecutionStatus = "confirmed" // ExecutionStatusRejected defines the status rejected. ExecutionStatusRejected ExecutionStatus = "rejected" // ExecutionStatusRunning defines the status running. ExecutionStatusRunning ExecutionStatus = "running" // ExecutionStatusStopping defines the status stopping. ExecutionStatusStopping ExecutionStatus = "stopping" // ExecutionStatusStopped defines the status stopped. ExecutionStatusStopped ExecutionStatus = "stopped" // ExecutionStatusSuccess defines the status success. ExecutionStatusSuccess ExecutionStatus = "success" // ExecutionStatusFailure defines the status failure. ExecutionStatusFailure ExecutionStatus = "failure" )
type Group ¶
type Group struct {
bun.BaseModel `bun:"table:groups"`
ID string `bun:",pk,type:varchar(20)"`
Scim string `bun:"type:varchar(255)"`
Slug string `bun:",unique,type:varchar(255)"`
Name string `bun:"type:varchar(255)"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
Users []*UserGroup `bun:"rel:has-many,join:id=group_id"`
Projects []*GroupProject `bun:"rel:has-many,join:id=group_id"`
}
Group defines the model for groups table.
type GroupProject ¶
type GroupProject struct {
bun.BaseModel `bun:"table:group_projects"`
GroupID string `bun:",pk,type:varchar(20)"`
Group *Group `bun:"rel:belongs-to,join:group_id=id"`
ProjectID string `bun:",pk,type:varchar(20)"`
Project *Project `bun:"rel:belongs-to,join:project_id=id"`
Perm string `bun:"type:varchar(32)"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
GroupProject defines the model for group_projects table.
func (*GroupProject) BeforeAppendModel ¶
BeforeAppendModel implements the bun hook interface.
type GroupProjectParams ¶
type GroupProjectParams struct {
ListParams
GroupID string
ProjectID string
Perm string
}
GroupProjectParams defines parameters for group projects.
type Inventory ¶
type Inventory struct {
bun.BaseModel `bun:"table:inventories"`
ID string `bun:",pk,type:varchar(20)"`
ProjectID string `bun:"type:varchar(20)"`
Project *Project `bun:"rel:belongs-to,join:project_id=id"`
RepositoryID string `bun:",nullzero,type:varchar(20)"`
Repository *Repository `bun:"rel:belongs-to,join:repository_id=id"`
CredentialID string `bun:",nullzero,type:varchar(20)"`
Credential *Credential `bun:"rel:belongs-to,join:credential_id=id"`
BecomeID string `bun:",nullzero,type:varchar(20)"`
Become *Credential `bun:"rel:belongs-to,join:become_id=id"`
Slug string `bun:"type:varchar(255)"`
Name string `bun:"type:varchar(255)"`
Kind string `bun:"type:varchar(255)"`
Content string `bun:"type:text"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
Inventory defines the model for inventories table.
func (*Inventory) BeforeAppendModel ¶
BeforeAppendModel implements the bun hook interface.
func (*Inventory) DeserializeSecret ¶
DeserializeSecret ensures to decrypt all related secrets stored on the database.
func (*Inventory) SerializeSecret ¶
SerializeSecret ensures to encrypt all related secrets stored on the database.
type ListParams ¶
ListParams defines optional list attributes.
type Output ¶
type Output struct {
bun.BaseModel `bun:"table:outputs"`
ID string `bun:",pk,type:varchar(20)"`
ExecutionID string `bun:"type:varchar(20)"`
Execution *Execution `bun:"rel:belongs-to,join:execution_id=id"`
Content string `bun:"type:text"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
Output defines the model for outputs table.
type Project ¶
type Project struct {
bun.BaseModel `bun:"table:projects"`
ID string `bun:",pk,type:varchar(20)"`
Demo bool `bun:"-"`
Slug string `bun:",unique,type:varchar(255)"`
Name string `bun:"type:varchar(255)"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
Groups []*GroupProject `bun:"rel:has-many,join:id=project_id"`
Users []*UserProject `bun:"rel:has-many,join:id=project_id"`
}
Project defines the model for projects table.
type Repository ¶
type Repository struct {
bun.BaseModel `bun:"table:repositories"`
ID string `bun:",pk,type:varchar(20)"`
ProjectID string `bun:"type:varchar(20)"`
Project *Project `bun:"rel:belongs-to,join:project_id=id"`
CredentialID string `bun:",nullzero,type:varchar(20)"`
Credential *Credential `bun:"rel:belongs-to,join:credential_id=id"`
Slug string `bun:"type:varchar(255)"`
Name string `bun:"type:varchar(255)"`
URL string `bun:"type:text"`
Branch string `bun:"type:varchar(255)"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
Repository defines the model for repositories table.
func (*Repository) BeforeAppendModel ¶
BeforeAppendModel implements the bun hook interface.
func (*Repository) DeserializeSecret ¶
func (m *Repository) DeserializeSecret(passphrase string) error
DeserializeSecret ensures to decrypt all related secrets stored on the database.
func (*Repository) SerializeSecret ¶
func (m *Repository) SerializeSecret(passphrase string) error
SerializeSecret ensures to encrypt all related secrets stored on the database.
type Runner ¶
type Runner struct {
bun.BaseModel `bun:"table:runners"`
ID string `bun:",pk,type:varchar(20)"`
ProjectID string `bun:",nullzero,type:varchar(20)"`
Project *Project `bun:"rel:belongs-to,join:project_id=id"`
Slug string `bun:"type:varchar(255)"`
Name string `bun:"type:varchar(255)"`
Token string `bun:"type:varchar(255)"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
Runner defines the model for runners table.
func (*Runner) BeforeAppendModel ¶
BeforeAppendModel implements the bun hook interface.
func (*Runner) DeserializeSecret ¶
DeserializeSecret ensures to decrypt all related secrets stored on the database.
func (*Runner) SerializeSecret ¶
SerializeSecret ensures to encrypt all related secrets stored on the database.
type Schedule ¶
type Schedule struct {
bun.BaseModel `bun:"table:schedules"`
ID string `bun:",pk,type:varchar(20)"`
ProjectID string `bun:"type:varchar(20)"`
Project *Project `bun:"rel:belongs-to,join:project_id=id"`
TemplateID string `bun:"type:varchar(20)"`
Template *Template `bun:"rel:belongs-to,join:template_id=id"`
Slug string `bun:"type:varchar(255)"`
Name string `bun:"type:varchar(255)"`
Cron string `bun:"type:varchar(255)"`
Active bool `bun:"type:bool"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
Schedule defines the model for schedules table.
func (*Schedule) BeforeAppendModel ¶
BeforeAppendModel implements the bun hook interface.
func (*Schedule) DeserializeSecret ¶
DeserializeSecret ensures to decrypt all related secrets stored on the database.
func (*Schedule) SerializeSecret ¶
SerializeSecret ensures to encrypt all related secrets stored on the database.
type Template ¶
type Template struct {
bun.BaseModel `bun:"table:templates"`
ID string `bun:",pk,type:varchar(20)"`
ProjectID string `bun:"type:varchar(20)"`
Project *Project `bun:"rel:belongs-to,join:project_id=id"`
RepositoryID string `bun:",nullzero,type:varchar(20)"`
Repository *Repository `bun:"rel:belongs-to,join:repository_id=id"`
InventoryID string `bun:",nullzero,type:varchar(20)"`
Inventory *Inventory `bun:"rel:belongs-to,join:inventory_id=id"`
EnvironmentID string `bun:",nullzero,type:varchar(20)"`
Environment *Environment `bun:"rel:belongs-to,join:environment_id=id"`
Slug string `bun:"type:varchar(255)"`
Name string `bun:"type:varchar(255)"`
Description string `bun:"type:text"`
Path string `bun:"type:varchar(255)"`
Arguments string `bun:"type:varchar(255)"`
Limit string `bun:"type:varchar(255)"`
Executor string `bun:"type:varchar(255)"`
Branch string `bun:"type:varchar(255)"`
Override bool `bun:"type:bool"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
Surveys []*TemplateSurvey `bun:"rel:has-many,join:id=template_id"`
Vaults []*TemplateVault `bun:"rel:has-many,join:id=template_id"`
}
Template defines the model for templates table.
func (*Template) BeforeAppendModel ¶
BeforeAppendModel implements the bun hook interface.
func (*Template) DeserializeSecret ¶
DeserializeSecret ensures to decrypt all related secrets stored on the database.
func (*Template) SerializeSecret ¶
SerializeSecret ensures to encrypt all related secrets stored on the database.
type TemplateSurvey ¶
type TemplateSurvey struct {
bun.BaseModel `bun:"table:template_surveys"`
ID string `bun:",pk,type:varchar(20)"`
TemplateID string `bun:"type:varchar(20)"`
Name string `bun:"type:varchar(255)"`
Title string `bun:"type:varchar(255)"`
Description string `bun:"type:text"`
Kind string `bun:"type:varchar(255)"`
Required bool `bun:"type:bool"`
Values []*TemplateValue `bun:"rel:has-many,join:id=survey_id"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
TemplateSurvey defines the model for template_surveys table.
func (*TemplateSurvey) BeforeAppendModel ¶
BeforeAppendModel implements the bun hook interface.
func (*TemplateSurvey) DeserializeSecret ¶
func (m *TemplateSurvey) DeserializeSecret(passphrase string) error
DeserializeSecret ensures to decrypt all related secrets stored on the database.
func (*TemplateSurvey) SerializeSecret ¶
func (m *TemplateSurvey) SerializeSecret(passphrase string) error
SerializeSecret ensures to encrypt all related secrets stored on the database.
type TemplateValue ¶
type TemplateValue struct {
bun.BaseModel `bun:"table:template_values"`
ID string `bun:",pk,type:varchar(20)"`
SurveyID string `bun:"type:varchar(20)"`
Name string `bun:"type:varchar(255)"`
Value string `bun:"type:text"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
TemplateValue defines the model for template:values table.
func (*TemplateValue) BeforeAppendModel ¶
BeforeAppendModel implements the bun hook interface.
func (*TemplateValue) DeserializeSecret ¶
func (m *TemplateValue) DeserializeSecret(_ string) error
DeserializeSecret ensures to decrypt all related secrets stored on the database.
func (*TemplateValue) SerializeSecret ¶
func (m *TemplateValue) SerializeSecret(_ string) error
SerializeSecret ensures to encrypt all related secrets stored on the database.
type TemplateVault ¶
type TemplateVault struct {
bun.BaseModel `bun:"table:template_vaults"`
ID string `bun:",pk,type:varchar(20)"`
TemplateID string `bun:"type:varchar(20)"`
CredentialID string `bun:",nullzero,type:varchar(20)"`
Credential *Credential `bun:"rel:belongs-to,join:credential_id=id"`
Name string `bun:"type:varchar(255)"`
Kind string `bun:"type:varchar(255)"`
Script string `bun:"type:text"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
TemplateVault defines the model for template_vaults table.
func (*TemplateVault) BeforeAppendModel ¶
BeforeAppendModel implements the bun hook interface.
func (*TemplateVault) DeserializeSecret ¶
func (m *TemplateVault) DeserializeSecret(_ string) error
DeserializeSecret ensures to decrypt all related secrets stored on the database.
func (*TemplateVault) SerializeSecret ¶
func (m *TemplateVault) SerializeSecret(_ string) error
SerializeSecret ensures to encrypt all related secrets stored on the database.
type User ¶
type User struct {
bun.BaseModel `bun:"table:users"`
ID string `bun:",pk,type:varchar(20)"`
Scim string `bun:"type:varchar(255)"`
Username string `bun:",unique,type:varchar(255)"`
Password string `bun:"-"`
Hashword string `bun:"type:varchar(255)"`
Email string `bun:"type:varchar(255)"`
Fullname string `bun:"type:varchar(255)"`
Profile string `bun:"-"`
Active bool `bun:"default:false"`
Admin bool `bun:"default:false"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
Auths []*UserAuth `bun:"rel:has-many,join:id=user_id"`
Groups []*UserGroup `bun:"rel:has-many,join:id=user_id"`
Projects []*UserProject `bun:"rel:has-many,join:id=user_id"`
}
User defines the model for users table.
type UserAuth ¶
type UserAuth struct {
bun.BaseModel `bun:"table:user_auths"`
ID string `bun:",pk,type:varchar(20)"`
UserID string `bun:"type:varchar(20)"`
User *User `bun:"rel:belongs-to,join:user_id=id"`
Provider string `bun:"type:varchar(255)"`
Ref string `bun:"type:varchar(255)"`
Login string `bun:"type:varchar(255)"`
Email string `bun:"type:varchar(255)"`
Name string `bun:"type:varchar(255)"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
UserAuth defines the model for user_auths table.
type UserGroup ¶
type UserGroup struct {
bun.BaseModel `bun:"table:user_groups"`
UserID string `bun:",pk,type:varchar(20)"`
User *User `bun:"rel:belongs-to,join:user_id=id"`
GroupID string `bun:",pk,type:varchar(20)"`
Group *Group `bun:"rel:belongs-to,join:group_id=id"`
Perm string `bun:"type:varchar(32)"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
UserGroup defines the model for user_groups table.
type UserGroupParams ¶
type UserGroupParams struct {
ListParams
UserID string
GroupID string
Perm string
}
UserGroupParams defines parameters for user groups.
type UserProject ¶
type UserProject struct {
bun.BaseModel `bun:"table:user_projects"`
UserID string `bun:",pk,type:varchar(20)"`
User *User `bun:"rel:belongs-to,join:user_id=id"`
ProjectID string `bun:",pk,type:varchar(20)"`
Project *Project `bun:"rel:belongs-to,join:project_id=id"`
Perm string `bun:"type:varchar(32)"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
UserProject defines the model for user_projects table.
func (*UserProject) BeforeAppendModel ¶
BeforeAppendModel implements the bun hook interface.
type UserProjectParams ¶
type UserProjectParams struct {
ListParams
UserID string
ProjectID string
Perm string
}
UserProjectParams defines parameters for user projects.
type UserToken ¶
type UserToken struct {
bun.BaseModel `bun:"table:user_tokens"`
ID string `bun:",pk,type:varchar(20)"`
UserID string `bun:"type:varchar(20)"`
User *User `bun:"rel:belongs-to,join:user_id=id"`
Kind UserTokenKind `bun:"type:varchar(128)"`
Token string `bun:",unique,type:varchar(128)"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
UserToken defines the model for user_tokens table.
type UserTokenKind ¶
type UserTokenKind string
UserTokenKind is the custom type for kind of tokens.
const ( // UserTokenKindRedirect defines the kind used for redirects. UserTokenKindRedirect UserTokenKind = "redirect" )
Source Files
¶
- credential.go
- credential_login.go
- credential_shell.go
- encrypt.go
- environment.go
- environment_secret.go
- environment_value.go
- event.go
- execution.go
- group.go
- group_project.go
- inventory.go
- output.go
- params.go
- perm.go
- project.go
- repository.go
- runner.go
- schedule.go
- template.go
- template_survey.go
- template_value.go
- template_vault.go
- user.go
- user_auth.go
- user_group.go
- user_project.go
- user_token.go