sqlc

package
v0.0.0-...-96f7096 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddReconcilerOptOutParams

type AddReconcilerOptOutParams struct {
	TeamSlug       slug.Slug
	UserID         uuid.UUID
	ReconcilerName ReconcilerName
}

type ApiKey

type ApiKey struct {
	ApiKey           string
	ServiceAccountID uuid.UUID
}

type AssignGlobalRoleToServiceAccountParams

type AssignGlobalRoleToServiceAccountParams struct {
	ServiceAccountID uuid.UUID
	RoleName         RoleName
}

type AssignGlobalRoleToUserParams

type AssignGlobalRoleToUserParams struct {
	UserID   uuid.UUID
	RoleName RoleName
}

type AssignTeamRoleToServiceAccountParams

type AssignTeamRoleToServiceAccountParams struct {
	ServiceAccountID uuid.UUID
	RoleName         RoleName
	TargetTeamSlug   *slug.Slug
}

type AssignTeamRoleToUserParams

type AssignTeamRoleToUserParams struct {
	UserID         uuid.UUID
	RoleName       RoleName
	TargetTeamSlug *slug.Slug
}

type AuditLog

type AuditLog struct {
	ID               uuid.UUID
	CreatedAt        time.Time
	CorrelationID    uuid.UUID
	ComponentName    string
	Actor            *string
	Action           string
	Message          string
	TargetType       string
	TargetIdentifier string
}

type ClearReconcilerErrorsForTeamParams

type ClearReconcilerErrorsForTeamParams struct {
	TeamSlug   slug.Slug
	Reconciler ReconcilerName
}

type ConfigureReconcilerParams

type ConfigureReconcilerParams struct {
	Reconciler ReconcilerName
	Key        ReconcilerConfigKey
	Value      string
}

type CreateAPIKeyParams

type CreateAPIKeyParams struct {
	ApiKey           string
	ServiceAccountID uuid.UUID
}

type CreateAuditLogParams

type CreateAuditLogParams struct {
	CorrelationID    uuid.UUID
	Actor            *string
	ComponentName    string
	TargetType       string
	TargetIdentifier string
	Action           string
	Message          string
}

type CreateRepositoryAuthorizationParams

type CreateRepositoryAuthorizationParams struct {
	TeamSlug                string
	GithubRepository        string
	RepositoryAuthorization RepositoryAuthorizationEnum
}

type CreateSessionParams

type CreateSessionParams struct {
	UserID  uuid.UUID
	Expires time.Time
}

type CreateTeamDeleteKeyParams

type CreateTeamDeleteKeyParams struct {
	TeamSlug  slug.Slug
	CreatedBy uuid.UUID
}

type CreateTeamParams

type CreateTeamParams struct {
	Slug         slug.Slug
	Purpose      string
	SlackChannel string
}

type CreateUserParams

type CreateUserParams struct {
	Name       string
	Email      string
	ExternalID string
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type DangerousGetReconcilerConfigValuesRow

type DangerousGetReconcilerConfigValuesRow struct {
	Key   ReconcilerConfigKey
	Value string
}

type FirstRun

type FirstRun struct {
	FirstRun bool
}

type GetReconcilerConfigRow

type GetReconcilerConfigRow struct {
	Reconciler  ReconcilerName
	Key         ReconcilerConfigKey
	DisplayName string
	Description string
	Configured  bool
	Value       *string
	Secret      bool
}

type GetReconcilerStateForTeamParams

type GetReconcilerStateForTeamParams struct {
	Reconciler ReconcilerName
	TeamSlug   slug.Slug
}

type GetRepositoryAuthorizationsParams

type GetRepositoryAuthorizationsParams struct {
	TeamSlug         string
	GithubRepository string
}

type GetTeamMemberOptOutsParams

type GetTeamMemberOptOutsParams struct {
	UserID   uuid.UUID
	TeamSlug slug.Slug
}

type GetTeamMemberOptOutsRow

type GetTeamMemberOptOutsRow struct {
	Name    ReconcilerName
	Enabled bool
}

type GetTeamMemberParams

type GetTeamMemberParams struct {
	TargetTeamSlug *slug.Slug
	ID             uuid.UUID
}

type GetTeamMembersForReconcilerParams

type GetTeamMembersForReconcilerParams struct {
	TargetTeamSlug *slug.Slug
	ReconcilerName ReconcilerName
}

type NullReconcilerConfigKey

type NullReconcilerConfigKey struct {
	ReconcilerConfigKey ReconcilerConfigKey
	Valid               bool // Valid is true if ReconcilerConfigKey is not NULL
}

func (*NullReconcilerConfigKey) Scan

func (ns *NullReconcilerConfigKey) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullReconcilerConfigKey) Value

func (ns NullReconcilerConfigKey) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullReconcilerName

type NullReconcilerName struct {
	ReconcilerName ReconcilerName
	Valid          bool // Valid is true if ReconcilerName is not NULL
}

func (*NullReconcilerName) Scan

func (ns *NullReconcilerName) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullReconcilerName) Value

func (ns NullReconcilerName) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullRepositoryAuthorizationEnum

type NullRepositoryAuthorizationEnum struct {
	RepositoryAuthorizationEnum RepositoryAuthorizationEnum
	Valid                       bool // Valid is true if RepositoryAuthorizationEnum is not NULL
}

func (*NullRepositoryAuthorizationEnum) Scan

func (ns *NullRepositoryAuthorizationEnum) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullRepositoryAuthorizationEnum) Value

Value implements the driver Valuer interface.

type NullRoleName

type NullRoleName struct {
	RoleName RoleName
	Valid    bool // Valid is true if RoleName is not NULL
}

func (*NullRoleName) Scan

func (ns *NullRoleName) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullRoleName) Value

func (ns NullRoleName) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Querier

type Querier interface {
	AddReconcilerOptOut(ctx context.Context, arg AddReconcilerOptOutParams) error
	AssignGlobalRoleToServiceAccount(ctx context.Context, arg AssignGlobalRoleToServiceAccountParams) error
	AssignGlobalRoleToUser(ctx context.Context, arg AssignGlobalRoleToUserParams) error
	AssignTeamRoleToServiceAccount(ctx context.Context, arg AssignTeamRoleToServiceAccountParams) error
	AssignTeamRoleToUser(ctx context.Context, arg AssignTeamRoleToUserParams) error
	ClearReconcilerErrorsForTeam(ctx context.Context, arg ClearReconcilerErrorsForTeamParams) error
	ConfigureReconciler(ctx context.Context, arg ConfigureReconcilerParams) error
	ConfirmTeamDeleteKey(ctx context.Context, key uuid.UUID) error
	CreateAPIKey(ctx context.Context, arg CreateAPIKeyParams) error
	CreateAuditLog(ctx context.Context, arg CreateAuditLogParams) error
	CreateRepositoryAuthorization(ctx context.Context, arg CreateRepositoryAuthorizationParams) error
	CreateServiceAccount(ctx context.Context, name string) (*ServiceAccount, error)
	CreateSession(ctx context.Context, arg CreateSessionParams) (*Session, error)
	CreateTeam(ctx context.Context, arg CreateTeamParams) (*Team, error)
	CreateTeamDeleteKey(ctx context.Context, arg CreateTeamDeleteKeyParams) (*TeamDeleteKey, error)
	CreateUser(ctx context.Context, arg CreateUserParams) (*User, error)
	DangerousGetReconcilerConfigValues(ctx context.Context, reconciler ReconcilerName) ([]*DangerousGetReconcilerConfigValuesRow, error)
	DeleteServiceAccount(ctx context.Context, id uuid.UUID) error
	DeleteSession(ctx context.Context, id uuid.UUID) error
	DeleteTeam(ctx context.Context, argSlug slug.Slug) error
	DeleteUser(ctx context.Context, id uuid.UUID) error
	DisableReconciler(ctx context.Context, name ReconcilerName) (*Reconciler, error)
	EnableReconciler(ctx context.Context, name ReconcilerName) (*Reconciler, error)
	FirstRunComplete(ctx context.Context) error
	GetActiveTeamBySlug(ctx context.Context, argSlug slug.Slug) (*Team, error)
	GetActiveTeams(ctx context.Context) ([]*Team, error)
	GetAllUserRoles(ctx context.Context) ([]*UserRole, error)
	GetAuditLogsForCorrelationID(ctx context.Context, correlationID uuid.UUID) ([]*AuditLog, error)
	GetAuditLogsForReconciler(ctx context.Context, targetIdentifier string) ([]*AuditLog, error)
	GetAuditLogsForTeam(ctx context.Context, targetIdentifier string) ([]*AuditLog, error)
	GetEnabledReconcilers(ctx context.Context) ([]*Reconciler, error)
	GetReconciler(ctx context.Context, name ReconcilerName) (*Reconciler, error)
	GetReconcilerConfig(ctx context.Context, reconciler ReconcilerName) ([]*GetReconcilerConfigRow, error)
	GetReconcilerStateForTeam(ctx context.Context, arg GetReconcilerStateForTeamParams) (*ReconcilerState, error)
	GetReconcilers(ctx context.Context) ([]*Reconciler, error)
	GetRepositoryAuthorizations(ctx context.Context, arg GetRepositoryAuthorizationsParams) ([]RepositoryAuthorizationEnum, error)
	GetServiceAccountByApiKey(ctx context.Context, apiKey string) (*ServiceAccount, error)
	GetServiceAccountByName(ctx context.Context, name string) (*ServiceAccount, error)
	GetServiceAccountRoles(ctx context.Context, serviceAccountID uuid.UUID) ([]*ServiceAccountRole, error)
	GetServiceAccounts(ctx context.Context) ([]*ServiceAccount, error)
	GetSessionByID(ctx context.Context, id uuid.UUID) (*Session, error)
	GetSlackAlertsChannels(ctx context.Context, teamSlug slug.Slug) ([]*SlackAlertsChannel, error)
	GetTeamBySlug(ctx context.Context, argSlug slug.Slug) (*Team, error)
	GetTeamDeleteKey(ctx context.Context, key uuid.UUID) (*TeamDeleteKey, error)
	GetTeamMember(ctx context.Context, arg GetTeamMemberParams) (*User, error)
	GetTeamMemberOptOuts(ctx context.Context, arg GetTeamMemberOptOutsParams) ([]*GetTeamMemberOptOutsRow, error)
	GetTeamMembers(ctx context.Context, targetTeamSlug *slug.Slug) ([]*User, error)
	GetTeamMembersForReconciler(ctx context.Context, arg GetTeamMembersForReconcilerParams) ([]*User, error)
	GetTeamReconcilerErrors(ctx context.Context, teamSlug slug.Slug) ([]*ReconcilerError, error)
	GetTeams(ctx context.Context) ([]*Team, error)
	GetTeamsWithPermissionInGitHubRepo(ctx context.Context, state pgtype.JSONB) ([]*Team, error)
	GetUserByEmail(ctx context.Context, email string) (*User, error)
	GetUserByExternalID(ctx context.Context, externalID string) (*User, error)
	GetUserByID(ctx context.Context, id uuid.UUID) (*User, error)
	GetUserRoles(ctx context.Context, userID uuid.UUID) ([]*UserRole, error)
	GetUserTeams(ctx context.Context, userID uuid.UUID) ([]*Team, error)
	GetUsers(ctx context.Context) ([]*User, error)
	GetUsersWithGloballyAssignedRole(ctx context.Context, roleName RoleName) ([]*User, error)
	IsFirstRun(ctx context.Context) (bool, error)
	RemoveAllServiceAccountRoles(ctx context.Context, serviceAccountID uuid.UUID) error
	RemoveApiKeysFromServiceAccount(ctx context.Context, serviceAccountID uuid.UUID) error
	RemoveReconcilerOptOut(ctx context.Context, arg RemoveReconcilerOptOutParams) error
	RemoveReconcilerStateForTeam(ctx context.Context, arg RemoveReconcilerStateForTeamParams) error
	RemoveRepositoryAuthorization(ctx context.Context, arg RemoveRepositoryAuthorizationParams) error
	RemoveSlackAlertsChannel(ctx context.Context, arg RemoveSlackAlertsChannelParams) error
	RemoveUserFromTeam(ctx context.Context, arg RemoveUserFromTeamParams) error
	ResetReconcilerConfig(ctx context.Context, reconciler ReconcilerName) error
	RevokeGlobalUserRole(ctx context.Context, arg RevokeGlobalUserRoleParams) error
	SetLastSuccessfulSyncForTeam(ctx context.Context, argSlug slug.Slug) error
	SetReconcilerErrorForTeam(ctx context.Context, arg SetReconcilerErrorForTeamParams) error
	SetReconcilerStateForTeam(ctx context.Context, arg SetReconcilerStateForTeamParams) error
	SetSessionExpires(ctx context.Context, arg SetSessionExpiresParams) (*Session, error)
	SetSlackAlertsChannel(ctx context.Context, arg SetSlackAlertsChannelParams) error
	UpdateTeam(ctx context.Context, arg UpdateTeamParams) (*Team, error)
	UpdateUser(ctx context.Context, arg UpdateUserParams) (*User, error)
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) AddReconcilerOptOut

func (q *Queries) AddReconcilerOptOut(ctx context.Context, arg AddReconcilerOptOutParams) error

func (*Queries) AssignGlobalRoleToServiceAccount

func (q *Queries) AssignGlobalRoleToServiceAccount(ctx context.Context, arg AssignGlobalRoleToServiceAccountParams) error

func (*Queries) AssignGlobalRoleToUser

func (q *Queries) AssignGlobalRoleToUser(ctx context.Context, arg AssignGlobalRoleToUserParams) error

func (*Queries) AssignTeamRoleToServiceAccount

func (q *Queries) AssignTeamRoleToServiceAccount(ctx context.Context, arg AssignTeamRoleToServiceAccountParams) error

func (*Queries) AssignTeamRoleToUser

func (q *Queries) AssignTeamRoleToUser(ctx context.Context, arg AssignTeamRoleToUserParams) error

func (*Queries) ClearReconcilerErrorsForTeam

func (q *Queries) ClearReconcilerErrorsForTeam(ctx context.Context, arg ClearReconcilerErrorsForTeamParams) error

func (*Queries) ConfigureReconciler

func (q *Queries) ConfigureReconciler(ctx context.Context, arg ConfigureReconcilerParams) error

func (*Queries) ConfirmTeamDeleteKey

func (q *Queries) ConfirmTeamDeleteKey(ctx context.Context, key uuid.UUID) error

func (*Queries) CreateAPIKey

func (q *Queries) CreateAPIKey(ctx context.Context, arg CreateAPIKeyParams) error

func (*Queries) CreateAuditLog

func (q *Queries) CreateAuditLog(ctx context.Context, arg CreateAuditLogParams) error

func (*Queries) CreateRepositoryAuthorization

func (q *Queries) CreateRepositoryAuthorization(ctx context.Context, arg CreateRepositoryAuthorizationParams) error

func (*Queries) CreateServiceAccount

func (q *Queries) CreateServiceAccount(ctx context.Context, name string) (*ServiceAccount, error)

func (*Queries) CreateSession

func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (*Session, error)

func (*Queries) CreateTeam

func (q *Queries) CreateTeam(ctx context.Context, arg CreateTeamParams) (*Team, error)

func (*Queries) CreateTeamDeleteKey

func (q *Queries) CreateTeamDeleteKey(ctx context.Context, arg CreateTeamDeleteKeyParams) (*TeamDeleteKey, error)

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (*User, error)

func (*Queries) DangerousGetReconcilerConfigValues

func (q *Queries) DangerousGetReconcilerConfigValues(ctx context.Context, reconciler ReconcilerName) ([]*DangerousGetReconcilerConfigValuesRow, error)

func (*Queries) DeleteServiceAccount

func (q *Queries) DeleteServiceAccount(ctx context.Context, id uuid.UUID) error

func (*Queries) DeleteSession

func (q *Queries) DeleteSession(ctx context.Context, id uuid.UUID) error

func (*Queries) DeleteTeam

func (q *Queries) DeleteTeam(ctx context.Context, argSlug slug.Slug) error

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, id uuid.UUID) error

func (*Queries) DisableReconciler

func (q *Queries) DisableReconciler(ctx context.Context, name ReconcilerName) (*Reconciler, error)

func (*Queries) EnableReconciler

func (q *Queries) EnableReconciler(ctx context.Context, name ReconcilerName) (*Reconciler, error)

func (*Queries) FirstRunComplete

func (q *Queries) FirstRunComplete(ctx context.Context) error

func (*Queries) GetActiveTeamBySlug

func (q *Queries) GetActiveTeamBySlug(ctx context.Context, argSlug slug.Slug) (*Team, error)

func (*Queries) GetActiveTeams

func (q *Queries) GetActiveTeams(ctx context.Context) ([]*Team, error)

func (*Queries) GetAllUserRoles

func (q *Queries) GetAllUserRoles(ctx context.Context) ([]*UserRole, error)

func (*Queries) GetAuditLogsForCorrelationID

func (q *Queries) GetAuditLogsForCorrelationID(ctx context.Context, correlationID uuid.UUID) ([]*AuditLog, error)

func (*Queries) GetAuditLogsForReconciler

func (q *Queries) GetAuditLogsForReconciler(ctx context.Context, targetIdentifier string) ([]*AuditLog, error)

func (*Queries) GetAuditLogsForTeam

func (q *Queries) GetAuditLogsForTeam(ctx context.Context, targetIdentifier string) ([]*AuditLog, error)

func (*Queries) GetEnabledReconcilers

func (q *Queries) GetEnabledReconcilers(ctx context.Context) ([]*Reconciler, error)

func (*Queries) GetReconciler

func (q *Queries) GetReconciler(ctx context.Context, name ReconcilerName) (*Reconciler, error)

func (*Queries) GetReconcilerConfig

func (q *Queries) GetReconcilerConfig(ctx context.Context, reconciler ReconcilerName) ([]*GetReconcilerConfigRow, error)

func (*Queries) GetReconcilerStateForTeam

func (q *Queries) GetReconcilerStateForTeam(ctx context.Context, arg GetReconcilerStateForTeamParams) (*ReconcilerState, error)

func (*Queries) GetReconcilers

func (q *Queries) GetReconcilers(ctx context.Context) ([]*Reconciler, error)

func (*Queries) GetRepositoryAuthorizations

func (q *Queries) GetRepositoryAuthorizations(ctx context.Context, arg GetRepositoryAuthorizationsParams) ([]RepositoryAuthorizationEnum, error)

func (*Queries) GetServiceAccountByApiKey

func (q *Queries) GetServiceAccountByApiKey(ctx context.Context, apiKey string) (*ServiceAccount, error)

func (*Queries) GetServiceAccountByName

func (q *Queries) GetServiceAccountByName(ctx context.Context, name string) (*ServiceAccount, error)

func (*Queries) GetServiceAccountRoles

func (q *Queries) GetServiceAccountRoles(ctx context.Context, serviceAccountID uuid.UUID) ([]*ServiceAccountRole, error)

func (*Queries) GetServiceAccounts

func (q *Queries) GetServiceAccounts(ctx context.Context) ([]*ServiceAccount, error)

func (*Queries) GetSessionByID

func (q *Queries) GetSessionByID(ctx context.Context, id uuid.UUID) (*Session, error)

func (*Queries) GetSlackAlertsChannels

func (q *Queries) GetSlackAlertsChannels(ctx context.Context, teamSlug slug.Slug) ([]*SlackAlertsChannel, error)

func (*Queries) GetTeamBySlug

func (q *Queries) GetTeamBySlug(ctx context.Context, argSlug slug.Slug) (*Team, error)

func (*Queries) GetTeamDeleteKey

func (q *Queries) GetTeamDeleteKey(ctx context.Context, key uuid.UUID) (*TeamDeleteKey, error)

func (*Queries) GetTeamMember

func (q *Queries) GetTeamMember(ctx context.Context, arg GetTeamMemberParams) (*User, error)

func (*Queries) GetTeamMemberOptOuts

func (q *Queries) GetTeamMemberOptOuts(ctx context.Context, arg GetTeamMemberOptOutsParams) ([]*GetTeamMemberOptOutsRow, error)

func (*Queries) GetTeamMembers

func (q *Queries) GetTeamMembers(ctx context.Context, targetTeamSlug *slug.Slug) ([]*User, error)

func (*Queries) GetTeamMembersForReconciler

func (q *Queries) GetTeamMembersForReconciler(ctx context.Context, arg GetTeamMembersForReconcilerParams) ([]*User, error)

func (*Queries) GetTeamReconcilerErrors

func (q *Queries) GetTeamReconcilerErrors(ctx context.Context, teamSlug slug.Slug) ([]*ReconcilerError, error)

func (*Queries) GetTeams

func (q *Queries) GetTeams(ctx context.Context) ([]*Team, error)

func (*Queries) GetTeamsWithPermissionInGitHubRepo

func (q *Queries) GetTeamsWithPermissionInGitHubRepo(ctx context.Context, state pgtype.JSONB) ([]*Team, error)

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email string) (*User, error)

func (*Queries) GetUserByExternalID

func (q *Queries) GetUserByExternalID(ctx context.Context, externalID string) (*User, error)

func (*Queries) GetUserByID

func (q *Queries) GetUserByID(ctx context.Context, id uuid.UUID) (*User, error)

func (*Queries) GetUserRoles

func (q *Queries) GetUserRoles(ctx context.Context, userID uuid.UUID) ([]*UserRole, error)

func (*Queries) GetUserTeams

func (q *Queries) GetUserTeams(ctx context.Context, userID uuid.UUID) ([]*Team, error)

func (*Queries) GetUsers

func (q *Queries) GetUsers(ctx context.Context) ([]*User, error)

func (*Queries) GetUsersWithGloballyAssignedRole

func (q *Queries) GetUsersWithGloballyAssignedRole(ctx context.Context, roleName RoleName) ([]*User, error)

func (*Queries) IsFirstRun

func (q *Queries) IsFirstRun(ctx context.Context) (bool, error)

func (*Queries) RemoveAllServiceAccountRoles

func (q *Queries) RemoveAllServiceAccountRoles(ctx context.Context, serviceAccountID uuid.UUID) error

func (*Queries) RemoveApiKeysFromServiceAccount

func (q *Queries) RemoveApiKeysFromServiceAccount(ctx context.Context, serviceAccountID uuid.UUID) error

func (*Queries) RemoveReconcilerOptOut

func (q *Queries) RemoveReconcilerOptOut(ctx context.Context, arg RemoveReconcilerOptOutParams) error

func (*Queries) RemoveReconcilerStateForTeam

func (q *Queries) RemoveReconcilerStateForTeam(ctx context.Context, arg RemoveReconcilerStateForTeamParams) error

func (*Queries) RemoveRepositoryAuthorization

func (q *Queries) RemoveRepositoryAuthorization(ctx context.Context, arg RemoveRepositoryAuthorizationParams) error

func (*Queries) RemoveSlackAlertsChannel

func (q *Queries) RemoveSlackAlertsChannel(ctx context.Context, arg RemoveSlackAlertsChannelParams) error

func (*Queries) RemoveUserFromTeam

func (q *Queries) RemoveUserFromTeam(ctx context.Context, arg RemoveUserFromTeamParams) error

func (*Queries) ResetReconcilerConfig

func (q *Queries) ResetReconcilerConfig(ctx context.Context, reconciler ReconcilerName) error

func (*Queries) RevokeGlobalUserRole

func (q *Queries) RevokeGlobalUserRole(ctx context.Context, arg RevokeGlobalUserRoleParams) error

func (*Queries) SetLastSuccessfulSyncForTeam

func (q *Queries) SetLastSuccessfulSyncForTeam(ctx context.Context, argSlug slug.Slug) error

func (*Queries) SetReconcilerErrorForTeam

func (q *Queries) SetReconcilerErrorForTeam(ctx context.Context, arg SetReconcilerErrorForTeamParams) error

func (*Queries) SetReconcilerStateForTeam

func (q *Queries) SetReconcilerStateForTeam(ctx context.Context, arg SetReconcilerStateForTeamParams) error

func (*Queries) SetSessionExpires

func (q *Queries) SetSessionExpires(ctx context.Context, arg SetSessionExpiresParams) (*Session, error)

func (*Queries) SetSlackAlertsChannel

func (q *Queries) SetSlackAlertsChannel(ctx context.Context, arg SetSlackAlertsChannelParams) error

func (*Queries) UpdateTeam

func (q *Queries) UpdateTeam(ctx context.Context, arg UpdateTeamParams) (*Team, error)

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (*User, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Reconciler

type Reconciler struct {
	Name        ReconcilerName
	DisplayName string
	Description string
	Enabled     bool
	RunOrder    int32
}

type ReconcilerConfig

type ReconcilerConfig struct {
	Reconciler  ReconcilerName
	Key         ReconcilerConfigKey
	DisplayName string
	Description string
	Value       *string
	Secret      bool
}

type ReconcilerConfigKey

type ReconcilerConfigKey string
const (
	ReconcilerConfigKeyAzureClientID     ReconcilerConfigKey = "azure:client_id"
	ReconcilerConfigKeyAzureClientSecret ReconcilerConfigKey = "azure:client_secret"
	ReconcilerConfigKeyAzureTenantID     ReconcilerConfigKey = "azure:tenant_id"
)

func AllReconcilerConfigKeyValues

func AllReconcilerConfigKeyValues() []ReconcilerConfigKey

func (*ReconcilerConfigKey) Scan

func (e *ReconcilerConfigKey) Scan(src interface{}) error

func (ReconcilerConfigKey) Valid

func (e ReconcilerConfigKey) Valid() bool

type ReconcilerError

type ReconcilerError struct {
	ID            int64
	CorrelationID uuid.UUID
	Reconciler    ReconcilerName
	CreatedAt     time.Time
	ErrorMessage  string
	TeamSlug      slug.Slug
}

type ReconcilerName

type ReconcilerName string
const (
	ReconcilerNameAzureGroup           ReconcilerName = "azure:group"
	ReconcilerNameGithubTeam           ReconcilerName = "github:team"
	ReconcilerNameGoogleGcpGar         ReconcilerName = "google:gcp:gar"
	ReconcilerNameGoogleGcpProject     ReconcilerName = "google:gcp:project"
	ReconcilerNameGoogleWorkspaceAdmin ReconcilerName = "google:workspace-admin"
	ReconcilerNameNaisDependencytrack  ReconcilerName = "nais:dependencytrack"
	ReconcilerNameNaisDeploy           ReconcilerName = "nais:deploy"
	ReconcilerNameNaisNamespace        ReconcilerName = "nais:namespace"
)

func AllReconcilerNameValues

func AllReconcilerNameValues() []ReconcilerName

func (*ReconcilerName) Scan

func (e *ReconcilerName) Scan(src interface{}) error

func (ReconcilerName) Valid

func (e ReconcilerName) Valid() bool

type ReconcilerOptOut

type ReconcilerOptOut struct {
	TeamSlug       slug.Slug
	UserID         uuid.UUID
	ReconcilerName ReconcilerName
}

type ReconcilerState

type ReconcilerState struct {
	Reconciler ReconcilerName
	State      pgtype.JSONB
	TeamSlug   slug.Slug
}

type RemoveReconcilerOptOutParams

type RemoveReconcilerOptOutParams struct {
	TeamSlug       slug.Slug
	UserID         uuid.UUID
	ReconcilerName ReconcilerName
}

type RemoveReconcilerStateForTeamParams

type RemoveReconcilerStateForTeamParams struct {
	Reconciler ReconcilerName
	TeamSlug   slug.Slug
}

type RemoveRepositoryAuthorizationParams

type RemoveRepositoryAuthorizationParams struct {
	TeamSlug                string
	GithubRepository        string
	RepositoryAuthorization RepositoryAuthorizationEnum
}

type RemoveSlackAlertsChannelParams

type RemoveSlackAlertsChannelParams struct {
	TeamSlug    slug.Slug
	Environment string
}

type RemoveUserFromTeamParams

type RemoveUserFromTeamParams struct {
	UserID         uuid.UUID
	TargetTeamSlug *slug.Slug
}

type RepositoryAuthorization

type RepositoryAuthorization struct {
	TeamSlug                string
	GithubRepository        string
	RepositoryAuthorization RepositoryAuthorizationEnum
}

type RepositoryAuthorizationEnum

type RepositoryAuthorizationEnum string
const (
	RepositoryAuthorizationEnumDeploy RepositoryAuthorizationEnum = "deploy"
)

func AllRepositoryAuthorizationEnumValues

func AllRepositoryAuthorizationEnumValues() []RepositoryAuthorizationEnum

func (*RepositoryAuthorizationEnum) Scan

func (e *RepositoryAuthorizationEnum) Scan(src interface{}) error

func (RepositoryAuthorizationEnum) Valid

type RevokeGlobalUserRoleParams

type RevokeGlobalUserRoleParams struct {
	UserID   uuid.UUID
	RoleName RoleName
}

type RoleName

type RoleName string
const (
	RoleNameAdmin                 RoleName = "Admin"
	RoleNameDeploykeyviewer       RoleName = "Deploy key viewer"
	RoleNameServiceaccountcreator RoleName = "Service account creator"
	RoleNameServiceaccountowner   RoleName = "Service account owner"
	RoleNameSynchronizer          RoleName = "Synchronizer"
	RoleNameTeamcreator           RoleName = "Team creator"
	RoleNameTeammember            RoleName = "Team member"
	RoleNameTeamowner             RoleName = "Team owner"
	RoleNameTeamviewer            RoleName = "Team viewer"
	RoleNameUseradmin             RoleName = "User admin"
	RoleNameUserviewer            RoleName = "User viewer"
)

func AllRoleNameValues

func AllRoleNameValues() []RoleName

func (*RoleName) Scan

func (e *RoleName) Scan(src interface{}) error

func (RoleName) Valid

func (e RoleName) Valid() bool

type ServiceAccount

type ServiceAccount struct {
	ID   uuid.UUID
	Name string
}

type ServiceAccountRole

type ServiceAccountRole struct {
	ID                     int32
	RoleName               RoleName
	ServiceAccountID       uuid.UUID
	TargetTeamSlug         *slug.Slug
	TargetServiceAccountID *uuid.UUID
}

type Session

type Session struct {
	ID      uuid.UUID
	UserID  uuid.UUID
	Expires time.Time
}

type SetReconcilerErrorForTeamParams

type SetReconcilerErrorForTeamParams struct {
	CorrelationID uuid.UUID
	TeamSlug      slug.Slug
	Reconciler    ReconcilerName
	ErrorMessage  string
}

type SetReconcilerStateForTeamParams

type SetReconcilerStateForTeamParams struct {
	Reconciler ReconcilerName
	TeamSlug   slug.Slug
	State      pgtype.JSONB
}

type SetSessionExpiresParams

type SetSessionExpiresParams struct {
	Expires time.Time
	ID      uuid.UUID
}

type SetSlackAlertsChannelParams

type SetSlackAlertsChannelParams struct {
	TeamSlug    slug.Slug
	Environment string
	ChannelName string
}

type SlackAlertsChannel

type SlackAlertsChannel struct {
	TeamSlug    slug.Slug
	Environment string
	ChannelName string
}

type Team

type Team struct {
	Slug               slug.Slug
	Purpose            string
	LastSuccessfulSync *time.Time
	SlackChannel       string
}

type TeamDeleteKey

type TeamDeleteKey struct {
	Key         uuid.UUID
	TeamSlug    slug.Slug
	CreatedAt   time.Time
	CreatedBy   uuid.UUID
	ConfirmedAt *time.Time
}

type UpdateTeamParams

type UpdateTeamParams struct {
	Purpose      *string
	SlackChannel *string
	Slug         slug.Slug
}

type UpdateUserParams

type UpdateUserParams struct {
	Name       string
	ExternalID string
	ID         uuid.UUID
	Email      string
}

type User

type User struct {
	ID         uuid.UUID
	Email      string
	Name       string
	ExternalID string
}

type UserRole

type UserRole struct {
	ID                     int32
	RoleName               RoleName
	UserID                 uuid.UUID
	TargetTeamSlug         *slug.Slug
	TargetServiceAccountID *uuid.UUID
}

Jump to

Keyboard shortcuts

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