user

package
v0.0.0-...-f8970bf Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListGCPGroupsForUser

func ListGCPGroupsForUser(ctx context.Context, userID uuid.UUID) ([]string, error)

func NewIdent

func NewIdent(uid uuid.UUID) ident.Ident

func NewLoaderContext

func NewLoaderContext(ctx context.Context, dbConn *pgxpool.Pool) context.Context

Types

type AuthenticatedUser

type AuthenticatedUser interface {
	GetID() uuid.UUID
	Identity() string
	IsServiceAccount() bool
}

type ErrNotFound

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

func (*ErrNotFound) As

func (e *ErrNotFound) As(v any) bool

func (ErrNotFound) Error

func (e ErrNotFound) Error() string

func (ErrNotFound) GraphError

func (e ErrNotFound) GraphError() string

func (*ErrNotFound) Is

func (e *ErrNotFound) Is(v error) bool

type User

type User struct {
	UUID       uuid.UUID `json:"-"`
	Email      string    `json:"email"`
	Name       string    `json:"name"`
	ExternalID string    `json:"externalId"`
}

func Create

func Create(ctx context.Context, name, email, externalID string) (*User, error)

func Get

func Get(ctx context.Context, userID uuid.UUID) (*User, error)

func GetByEmail

func GetByEmail(ctx context.Context, email string) (*User, error)

func GetByIdent

func GetByIdent(ctx context.Context, ident ident.Ident) (*User, error)

func (*User) GetID

func (u *User) GetID() uuid.UUID

func (User) ID

func (u User) ID() ident.Ident

func (*User) Identity

func (u *User) Identity() string

func (User) IsNode

func (User) IsNode()

func (*User) IsServiceAccount

func (u *User) IsServiceAccount() bool

type UserConnection

type UserConnection = pagination.Connection[*User]

func List

func List(ctx context.Context, page *pagination.Pagination, orderBy *UserOrder) (*UserConnection, error)

type UserEdge

type UserEdge = pagination.Edge[*User]

type UserOrder

type UserOrder struct {
	Field     UserOrderField       `json:"field"`
	Direction model.OrderDirection `json:"direction"`
}

func (*UserOrder) String

func (o *UserOrder) String() string

type UserOrderField

type UserOrderField string
const (
	UserOrderFieldName  UserOrderField = "NAME"
	UserOrderFieldEmail UserOrderField = "EMAIL"
)

func (UserOrderField) IsValid

func (e UserOrderField) IsValid() bool

func (UserOrderField) MarshalGQL

func (e UserOrderField) MarshalGQL(w io.Writer)

func (UserOrderField) String

func (e UserOrderField) String() string

func (*UserOrderField) UnmarshalGQL

func (e *UserOrderField) UnmarshalGQL(v interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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