models

package
v0.0.0-...-41cd4ca Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2022 License: AGPL-3.0 Imports: 12 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:",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"`
	InstanceID int64     `validate:"-" bun:",nullzero,notnull"`
	Instance   *Instance `validate:"-" bun:"rel:belongs-to,join:instance_id=id"`
	UserID     int64     `validate:"-" bun:",nullzero,notnull"`
	User       *User     `validate:"-" bun:"rel:belongs-to,join:user_id=id"`
}

Account represents an account.

type GeminiIdentity

type GeminiIdentity struct {
	ID        int64     `validate:"-" bun:",pk,autoincrement"`
	CreatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"`
	UpdatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"`
	Hash      string    `validate:"-" bun:",nullzero,notnull,unique"`
	AdoptedOn time.Time `validate:"-" bun:",nullzero"`
	UserID    int64     `validate:"-" bun:",nullzero,notnull"`
	USer      *Instance `validate:"-" bun:"rel:belongs-to,join:user_id=id"`
}

GeminiIdentity represents a gemini identity.

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"`
	PublicKey  string    `validate:"-" bun:",nullzero"`
	PrivateKey string    `validate:"-" bun:",nullzero"`
}

func (*Instance) GetPrivateKey

func (i *Instance) GetPrivateKey() (*rsa.PrivateKey, error)

func (*Instance) GetPublicKey

func (i *Instance) GetPublicKey() (*rsa.PublicKey, error)

func (*Instance) IsPunycode

func (i *Instance) IsPunycode() bool

func (*Instance) PublicKeyPEM

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

func (*Instance) SetPrivateKey

func (i *Instance) SetPrivateKey(key *rsa.PrivateKey) error

func (*Instance) SetPublicKey

func (i *Instance) SetPublicKey(key *rsa.PublicKey) error

func (*Instance) String

func (i *Instance) String() string

func (*Instance) UnicodeDomain

func (i *Instance) UnicodeDomain() string

type User

type User struct {
	ID               int64             `validate:"-" bun:",pk,autoincrement"`
	CreatedAt        time.Time         `validate:"-" bun:",nullzero,notnull,default:current_timestamp"`
	UpdatedAt        time.Time         `validate:"-" bun:",nullzero,notnull,default:current_timestamp"`
	GeminiIdentities []*GeminiIdentity `validate:"-" bun:"rel:has-many,join:id=user_id"`
}

User represents a durian user.

Jump to

Keyboard shortcuts

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