entities

package
v0.169.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOrganizationNameFromHeader added in v0.165.0

func GetOrganizationNameFromHeader(ctx context.Context) (string, error)

func GetRawToken added in v0.165.0

func GetRawToken(ctx context.Context) (string, error)

GetRawToken takes whatever Bearer token is in the request

func WithCurrentAPIToken

func WithCurrentAPIToken(ctx context.Context, token *APIToken) context.Context

func WithCurrentOrg

func WithCurrentOrg(ctx context.Context, org *Org) context.Context

func WithCurrentUser

func WithCurrentUser(ctx context.Context, user *User) context.Context

Types

type APIToken

type APIToken struct {
	ID        string
	CreatedAt *time.Time
	Token     string
}

func CurrentAPIToken

func CurrentAPIToken(ctx context.Context) *APIToken

type Org

type Org struct {
	ID, Name  string
	CreatedAt *time.Time
}

func CurrentOrg

func CurrentOrg(ctx context.Context) *Org

type User

type User struct {
	Email, ID string
	CreatedAt *time.Time
}

Utils to get and set information from context

func CurrentUser

func CurrentUser(ctx context.Context) *User

RequestID tries to retrieve requestID from the given context. If it doesn't exist, an empty string is returned.

Jump to

Keyboard shortcuts

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