usersyncsql

package
v0.0.0-...-10dfb09 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignGlobalRoleParams

type AssignGlobalRoleParams struct {
	UserID   uuid.UUID
	RoleName RoleName
}

type CreateParams

type CreateParams struct {
	Name       string
	ExternalID string
	Email      string
}

type CreateRunParams

type CreateRunParams struct {
	ID         uuid.UUID
	StartedAt  pgtype.Timestamptz
	FinishedAt pgtype.Timestamptz
	Error      *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 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 {
	AssignGlobalRole(ctx context.Context, arg AssignGlobalRoleParams) error
	Create(ctx context.Context, arg CreateParams) (*User, error)
	CreateRun(ctx context.Context, arg CreateRunParams) error
	Delete(ctx context.Context, id uuid.UUID) error
	List(ctx context.Context) ([]*User, error)
	ListRoles(ctx context.Context) ([]*UserRole, error)
	RevokeGlobalRole(ctx context.Context, arg RevokeGlobalRoleParams) error
	Update(ctx context.Context, arg UpdateParams) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AssignGlobalRole

func (q *Queries) AssignGlobalRole(ctx context.Context, arg AssignGlobalRoleParams) error

func (*Queries) Create

func (q *Queries) Create(ctx context.Context, arg CreateParams) (*User, error)

func (*Queries) CreateRun

func (q *Queries) CreateRun(ctx context.Context, arg CreateRunParams) error

func (*Queries) Delete

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

func (*Queries) List

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

func (*Queries) ListRoles

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

func (*Queries) RevokeGlobalRole

func (q *Queries) RevokeGlobalRole(ctx context.Context, arg RevokeGlobalRoleParams) error

func (*Queries) Update

func (q *Queries) Update(ctx context.Context, arg UpdateParams) error

func (*Queries) WithTx

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

type RevokeGlobalRoleParams

type RevokeGlobalRoleParams 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 UpdateParams

type UpdateParams 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