usersyncsql

package
v0.0.0-...-ef7f4e4 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 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 CreateLogEntryParams

type CreateLogEntryParams struct {
	Action       UsersyncLogEntryAction
	UserID       uuid.UUID
	UserName     string
	UserEmail    string
	OldUserName  *string
	OldUserEmail *string
	RoleName     *string
}

type CreateParams

type CreateParams 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 ListLogEntriesParams

type ListLogEntriesParams struct {
	Offset int32
	Limit  int32
}

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 NullUsersyncLogEntryAction

type NullUsersyncLogEntryAction struct {
	UsersyncLogEntryAction UsersyncLogEntryAction
	Valid                  bool // Valid is true if UsersyncLogEntryAction is not NULL
}

func (*NullUsersyncLogEntryAction) Scan

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

Scan implements the Scanner interface.

func (NullUsersyncLogEntryAction) Value

Value implements the driver Valuer interface.

type Querier

type Querier interface {
	AssignGlobalRole(ctx context.Context, arg AssignGlobalRoleParams) error
	CountLogEntries(ctx context.Context) (int64, error)
	Create(ctx context.Context, arg CreateParams) (*User, error)
	CreateLogEntry(ctx context.Context, arg CreateLogEntryParams) error
	Delete(ctx context.Context, id uuid.UUID) error
	List(ctx context.Context) ([]*User, error)
	ListLogEntries(ctx context.Context, arg ListLogEntriesParams) ([]*UsersyncLogEntry, error)
	ListLogEntriesByIDs(ctx context.Context, ids []uuid.UUID) ([]*UsersyncLogEntry, 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) CountLogEntries

func (q *Queries) CountLogEntries(ctx context.Context) (int64, error)

func (*Queries) Create

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

func (*Queries) CreateLogEntry

func (q *Queries) CreateLogEntry(ctx context.Context, arg CreateLogEntryParams) 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) ListLogEntries

func (q *Queries) ListLogEntries(ctx context.Context, arg ListLogEntriesParams) ([]*UsersyncLogEntry, error)

func (*Queries) ListLogEntriesByIDs

func (q *Queries) ListLogEntriesByIDs(ctx context.Context, ids []uuid.UUID) ([]*UsersyncLogEntry, 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
	Email      string
	ExternalID string
	ID         uuid.UUID
}

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
}

type UsersyncLogEntry

type UsersyncLogEntry struct {
	ID           uuid.UUID
	CreatedAt    pgtype.Timestamptz
	Action       UsersyncLogEntryAction
	UserID       uuid.UUID
	UserName     string
	UserEmail    string
	OldUserName  *string
	OldUserEmail *string
	RoleName     *string
}

type UsersyncLogEntryAction

type UsersyncLogEntryAction string
const (
	UsersyncLogEntryActionCreateUser UsersyncLogEntryAction = "create_user"
	UsersyncLogEntryActionUpdateUser UsersyncLogEntryAction = "update_user"
	UsersyncLogEntryActionDeleteUser UsersyncLogEntryAction = "delete_user"
	UsersyncLogEntryActionAssignRole UsersyncLogEntryAction = "assign_role"
	UsersyncLogEntryActionRevokeRole UsersyncLogEntryAction = "revoke_role"
)

func AllUsersyncLogEntryActionValues

func AllUsersyncLogEntryActionValues() []UsersyncLogEntryAction

func (*UsersyncLogEntryAction) Scan

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

func (UsersyncLogEntryAction) Valid

func (e UsersyncLogEntryAction) Valid() bool

Jump to

Keyboard shortcuts

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