database

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConflict = errors.New("duplicate key value violates unique constraint")

Functions

This section is empty.

Types

type Bridge

type Bridge interface {
	FindUser(ctx context.Context, userID uuid.UUID) (User, error)
	CreateUser(ctx context.Context, arg UserParams) (User, error)
	GetUsers(ctx context.Context, arg GetUsersParams) (int64, []User, error)
	DeleteUser(ctx context.Context, userID uuid.UUID) error
	UpdateUser(ctx context.Context, userID uuid.UUID, arg UserParams) (User, error)
	SetUserActive(ctx context.Context, userID uuid.UUID, active bool) error

	FindGroup(ctx context.Context, groupID uuid.UUID) (Group, error)
	CreateGroup(ctx context.Context, displayName string) (Group, error)
	GetGroups(ctx context.Context, limit int32, offset int32) (int64, []Group, error)
	GetGroupMembership(ctx context.Context, groupID uuid.UUID) ([]GroupMembership, error)
	DeleteGroup(ctx context.Context, groupID uuid.UUID) error
	PatchGroup(ctx context.Context, groupID uuid.UUID, operations []payloads.GroupPatchOperation) error
}

type GetUsersParams

type GetUsersParams struct {
	Filters []filters.Filter
	Offset  int32
	Limit   int32
}

type Group

type Group struct {
	ID          uuid.UUID
	DisplayName string
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type GroupMembership

type GroupMembership struct {
	GroupID  uuid.UUID
	UserID   uuid.UUID
	Username sql.NullString
}

type User

type User struct {
	ID          uuid.UUID
	Username    string
	ExternalID  sql.NullString
	Name        map[string]string
	DisplayName sql.NullString
	Locale      sql.NullString
	Active      bool
	Emails      []payloads.UserEmail
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type UserParams

type UserParams struct {
	Username    string
	Name        map[string]string
	DisplayName string
	Emails      []payloads.UserEmail
	Active      bool
	Locale      string
	ExternalID  string
}

Jump to

Keyboard shortcuts

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