models

package
v0.0.0-...-0f594a8 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID        int64     `validate:"-" bun:"id,pk,autoincrement"`
	CreatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"`
	UpdatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"`

	Username          string    `validate:"-" bun:",nullzero,notnull"`
	InstanceAccountID string    `validate:"-" bun:",nullzero"`
	InstanceID        int64     `validate:"-" bun:",nullzero,notnull"`
	Instance          *Instance `validate:"-" bun:"rel:belongs-to,join:instance_id=id"`
	LogInCount        int64     `validate:"-" bun:",notnull"`
	LogInLast         time.Time `validate:"-" bun:",nullzero"`
	IsAdmin           bool      `validate:"-" bun:",notnull"`
	IsMod             bool      `validate:"-" bun:",notnull"`
	IsVoter           bool      `validate:"-" bun:",notnull"`
	IsBlocked         bool      `validate:"-" bun:",notnull"`
}

Account represents an account.

type Instance

type Instance struct {
	ID        int64     `validate:"-" bun:",pk,autoincrement,nullzero,notnull,unique"`
	CreatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"`
	UpdatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"`

	Domain            string `validate:"required,fqdn" bun:",nullzero,notnull,unique"`
	ObfuscatedDomain  string `validate:"-" bun:",nullzero"`
	Software          string `validate:"-" bun:",nullzero"`
	OAuthClientID     string `validate:"-" bun:",nullzero"`
	OAuthClientSecret string `validate:"-" bun:",nullzero"`
}

Instance represents a instance.

func (*Instance) GetOAuthClientSecret

func (i *Instance) GetOAuthClientSecret() (string, error)

GetOAuthClientSecret returns unencrypted client secret.

func (*Instance) SetOAuthClientSecret

func (i *Instance) SetOAuthClientSecret(clientSecret string) error

SetOAuthClientSecret sets encrypted client secret.

func (*Instance) UnicodeDomain

func (i *Instance) UnicodeDomain() string

UnicodeDomain returns a unicode representation of the domain.

type Tag

type Tag struct {
	ID        int64     `validate:"-" bun:"id,pk,autoincrement"`
	CreatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"`
	UpdatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"`

	Name        string `validate:"-" bun:",nullzero,notnull"`
	Description string `validate:"-" bun:",nullzero"`
}

Tag represents an account.

Jump to

Keyboard shortcuts

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