account

package
v1.26.15 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AccountKindHuman = AccountKind{accountKindHuman}
	AccountKindBot   = AccountKind{accountKindBot}
)
View Source
var (
	VerifiedStatusNone          = VerifiedStatus{verifiedStatusNone}
	VerifiedStatusVerifiedEmail = VerifiedStatus{verifiedStatusVerifiedEmail}
	VerifiedStatusManual        = VerifiedStatus{verifiedStatusManual}
)

Functions

func ValidateHandle

func ValidateHandle(ctx context.Context, handle string) error

ValidateHandle checks if a handle meets the requirements: - Must be a valid slug (lowercase, letters, numbers, hyphens, underscores) - Must be 30 characters or less

Types

type Account

type Account struct {
	ID        AccountID
	CreatedAt time.Time
	UpdatedAt time.Time

	Handle         string
	Name           string
	Bio            datagraph.Content
	Signature      opt.Optional[datagraph.Content]
	Kind           AccountKind
	VerifiedStatus VerifiedStatus
	Roles          held.Roles
	Admin          bool
	Metadata       map[string]any

	DeletedAt opt.Optional[time.Time]
	IndexedAt opt.Optional[time.Time]
}

func MapRef

func MapRef(a *ent.Account) (*Account, error)

func (*Account) IsSuspended

func (a *Account) IsSuspended() bool

func (*Account) RejectSuspended

func (a *Account) RejectSuspended() error

type AccountID

type AccountID = account_ref.ID

type AccountKind

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

func NewAccountKind

func NewAccountKind(__iNpUt__ string) (AccountKind, error)

func (AccountKind) Format

func (r AccountKind) Format(f fmt.State, verb rune)

func (AccountKind) MarshalText

func (r AccountKind) MarshalText() ([]byte, error)

func (*AccountKind) Scan

func (r *AccountKind) Scan(__iNpUt__ any) error

func (AccountKind) String

func (r AccountKind) String() string

func (*AccountKind) UnmarshalText

func (r *AccountKind) UnmarshalText(__iNpUt__ []byte) error

func (AccountKind) Value

func (r AccountKind) Value() (driver.Value, error)

type AccountWithEdges

type AccountWithEdges struct {
	Account
	Auths          []string
	EmailAddresses []*EmailAddress
	InvitedBy      opt.Optional[Account]
	ExternalLinks  []ExternalLink
}

func MapAccount

func MapAccount(a *ent.Account) (*AccountWithEdges, error)

type Accounts

type Accounts []*Account

type EmailAddress

type EmailAddress struct {
	ID       xid.ID
	Email    mail.Address
	Verified bool
}

func MapEmail

func MapEmail(in *ent.Email) *EmailAddress
type ExternalLink struct {
	Text string
	URL  url.URL
}
func MapExternalLink(e schema.ExternalLink) (ExternalLink, error)

type Lookup

type Lookup map[xid.ID]*ent.Account

func NewAccountLookup

func NewAccountLookup(in []*ent.Account) Lookup

type VerifiedStatus

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

func NewVerifiedStatus

func NewVerifiedStatus(__iNpUt__ string) (VerifiedStatus, error)

func (VerifiedStatus) Format

func (r VerifiedStatus) Format(f fmt.State, verb rune)

func (VerifiedStatus) MarshalText

func (r VerifiedStatus) MarshalText() ([]byte, error)

func (*VerifiedStatus) Scan

func (r *VerifiedStatus) Scan(__iNpUt__ any) error

func (VerifiedStatus) String

func (r VerifiedStatus) String() string

func (*VerifiedStatus) UnmarshalText

func (r *VerifiedStatus) UnmarshalText(__iNpUt__ []byte) error

func (VerifiedStatus) Value

func (r VerifiedStatus) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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