models

package
v0.0.0-...-eb23ef5 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: GPL-3.0 Imports: 2 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"`
	ActorURI            string                `validate:"url" bun:",nullzero,notnull"`
	Username            string                `validate:"-" bun:",unique:unique_fedi_user,nullzero,notnull"`
	InstanceID          int64                 `validate:"-" bun:",unique:unique_fedi_user,nullzero,notnull"`
	Instance            *Instance             `validate:"-" bun:"rel:belongs-to,join:instance_id=id"`
	DisplayName         string                `validate:"-" bun:",nullzero"`
	LastFinger          time.Time             `validate:"-" bun:",notnull"`
	LogInCount          int64                 `validate:"-" bun:",notnull"`
	LogInLast           time.Time             `validate:"-" bun:",nullzero"`
	Groups              []*GroupMembership    `validate:"-" bun:"rel:has-many,join:id=account_id"`
	InstanceMemberships []*InstanceTeamMember `validate:"-" bun:"rel:has-many,join:id=account_id"`
}

Account represents a federated social account.

type GroupMembership

type GroupMembership struct {
	ID        int64     `validate:"-" bun:"id,pk,autoincrement"`
	CreatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"`
	AccountID int64     `validate:"min=1" bun:",unique:groupmembership,notnull,nullzero"`
	Account   *Account  `validate:"-" bun:"rel:belongs-to,join:account_id=id"`
	Group     int64     `validate:"min=1" bun:",unique:groupmembership,notnull,nullzero"`
}

GroupMembership represents a user's membership in a group

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"`
	ServerHostname    string                `validate:"required,fqdn" bun:",nullzero,notnull,unique"`
	Software          string                `validate:"-" bun:",nullzero"`
	PublicKey         *rsa.PublicKey        `validate:"-"`
	PrivateKey        string                `validate:"-" bun:",nullzero"`
	ActorIRI          string                `validate:"required,url" bun:",nullzero,notnull,unique"`
	InboxIRI          string                `validate:"required,url" bun:",nullzero,notnull,unique"`
	OAuthClientID     string                `validate:"-" bun:",nullzero"`
	OAuthClientSecret string                `validate:"-" bun:",nullzero"`
	Team              []*InstanceTeamMember `validate:"-" bun:"rel:has-many,join:id=instance_id"`
	S3IsEnabled       bool                  `validate:"-" bun:",notnull"`
	S3AccessKey       string                `validate:"-" bun:",nullzero"`
	S3SecretAccessKey string                `validate:"-" bun:",nullzero"`
	S3KeyCreationDate time.Time             `validate:"-" bun:",nullzero"`
}

Instance represents a federated social instance

type InstanceTeamMember

type InstanceTeamMember 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"`
	InstanceID int64     `validate:"min=1" bun:",unique:instance_team_membership,notnull,nullzero"`
	Instance   *Instance `validate:"-" bun:"rel:belongs-to,join:instance_id=id"`
	AccountID  int64     `validate:"min=1" bun:",unique:instance_team_membership,notnull,nullzero"`
	Account    *Account  `validate:"-" bun:"rel:belongs-to,join:account_id=id"`
	IsOwner    bool      `validate:"-" bun:",notnull"`
}

InstanceTeamMember represents a membership in an instance's team

Jump to

Keyboard shortcuts

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