models

package
v0.0.0-...-a915469 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptedTermsURL

type AcceptedTermsURL struct {
	ID        int64     `bun:"id,pk,autoincrement"`
	CreatedAt time.Time `bun:",nullzero,notnull"`
	UpdatedAt time.Time `bun:",nullzero,notnull"`

	AccountID int64    `bun:",nullzero,notnull"`
	Account   *Account `bun:"rel:belongs-to,join:account_id=id"`
	URL       string   `bun:",nullzero,notnull"`
}

type Account

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

	UserID         string `bun:",nullzero,notnull"`
	ConsentVersion string `bun:",nullzero"`
}

type EphemeralPublicKey

type EphemeralPublicKey struct {
	ID        int64     `bun:"id,pk,autoincrement"`
	CreatedAt time.Time `bun:",nullzero,notnull"`
	UpdatedAt time.Time `bun:",nullzero,notnull"`

	PublicKey   string    `bun:",nullzero,notnull"`
	VerifyCount int64     `bun:",notnull"`
	Persistence time.Time `bun:",nullzero"`
}

type GlobalThreepidAssociation

type GlobalThreepidAssociation struct {
	ID        int64     `bun:"id,pk,autoincrement"`
	CreatedAt time.Time `bun:",nullzero,notnull"`
	UpdatedAt time.Time `bun:",nullzero,notnull"`

	Medium       string    `bun:",nullzero,notnull"`
	Address      string    `bun:",nullzero,notnull"`
	MXID         string    `bun:",nullzero,notnull"`
	LookupHash   string    `bun:",nullzero,notnull"`
	NotBefore    time.Time `bun:",nullzero,notnull"`
	NotAfter     time.Time `bun:",nullzero,notnull"`
	OriginServer string    `bun:",nullzero,notnull"`
	OriginID     int64     `bun:",nullzero,notnull"`
	SGAssoc      string    `bun:",nullzero,notnull"`
}

type HashingMetadata

type HashingMetadata struct {
	ID        int64     `bun:"id,pk,autoincrement"`
	CreatedAt time.Time `bun:",nullzero,notnull"`
	UpdatedAt time.Time `bun:",nullzero,notnull"`

	LookupPepper string `bun:",nullzero"`
}

type InviteToken

type InviteToken struct {
	ID        int64     `bun:"id,pk,autoincrement"`
	CreatedAt time.Time `bun:",nullzero,notnull"`
	UpdatedAt time.Time `bun:",nullzero,notnull"`

	Medium   string    `bun:",nullzero,notnull"`
	Address  string    `bun:",nullzero,notnull"`
	RoomID   string    `bun:",nullzero,notnull"`
	Sender   string    `bun:",nullzero,notnull"`
	Token    string    `bun:",nullzero,notnull"`
	Received time.Time `bun:",nullzero"`
	Sent     time.Time `bun:",nullzero"`
}

type LocalThreepidAssociation

type LocalThreepidAssociation struct {
	ID        int64     `bun:"id,pk,autoincrement"`
	CreatedAt time.Time `bun:",nullzero,notnull"`
	UpdatedAt time.Time `bun:",nullzero,notnull"`

	Medium     string    `bun:",nullzero,notnull"`
	Address    string    `bun:",nullzero,notnull"`
	MXID       string    `bun:",nullzero,notnull"`
	LookupHash string    `bun:",nullzero,notnull"`
	NotBefore  time.Time `bun:",nullzero,notnull"`
	NotAfter   time.Time `bun:",nullzero,notnull"`
}

type Peer

type Peer struct {
	ID        int64     `bun:"id,pk,autoincrement"`
	CreatedAt time.Time `bun:",nullzero,notnull"`
	UpdatedAt time.Time `bun:",nullzero,notnull"`

	Name                string `bun:",nullzero,notnull"`
	Port                int    `bun:",nullzero"`
	LastSentVersion     int    `bun:",nullzero"`
	LastPokeSucceededAt int    `bun:",nullzero"`
	Active              bool   `bun:",notnull"`
}

type PeerKey

type PeerKey struct {
	ID        int64     `bun:"id,pk,autoincrement"`
	CreatedAt time.Time `bun:",nullzero,notnull"`
	UpdatedAt time.Time `bun:",nullzero,notnull"`

	PeerID    int64  `bun:",nullzero,notnull"`
	Peer      *Peer  `bun:"rel:belongs-to,join:peer_id=id"`
	Algo      string `bun:",nullzero,notnull"`
	PublicKey string `bun:",nullzero,notnull"`
}

type Terms

type Terms struct {
	MasterVersion string                   `json:"-"`
	Policies      map[string]TermsPolicies `json:"policies"`
}

func (*Terms) GetURLs

func (t *Terms) GetURLs() []string

func (*Terms) IsFullyAgreed

func (t *Terms) IsFullyAgreed(userAccepts []string) bool

type TermsPolicies

type TermsPolicies map[string]interface{}

func (TermsPolicies) HasURL

func (tp TermsPolicies) HasURL(url string) bool

type ThreePIDTokenAuth

type ThreePIDTokenAuth struct {
	ID        int64     `bun:"id,pk,autoincrement"`
	CreatedAt time.Time `bun:",nullzero,notnull"`
	UpdatedAt time.Time `bun:",nullzero,notnull"`

	ValidationSession int64  `bun:",nullzero,notnull"`
	Token             string `bun:",nullzero,notnull"`
	SendAttemptNumber int64  `bun:",nullzero,notnull"`
}

type Token

type Token struct {
	ID        int64     `bun:"id,pk,autoincrement"`
	CreatedAt time.Time `bun:",nullzero,notnull"`

	Token     string   `bun:",nullzero"`
	AccountID int64    `bun:",nullzero,notnull"`
	Account   *Account `bun:"rel:belongs-to,join:account_id=id"`
}

Jump to

Keyboard shortcuts

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