db

package
v0.0.0-...-2694588 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UpdateOption = options.FindOneAndUpdate().SetReturnDocument(options.After)
)

Functions

func Connect

func Connect(URI, databaseName, username, password string) (*mongo.Client, *mongo.Database, error)

func SelectedMediaTypes

func SelectedMediaTypes(mediaTypes []string) map[string]bool

Types

type HistoriesDisplay

type HistoriesDisplay struct {
	Histories  [][]History
	Owner      string
	Types      map[string]bool
	Categories map[string]bool
	Exclusive  bool
	Version    string
	Page       int
	Pages      int
	Count      int
	Error      error
}

func (HistoriesDisplay) Query

func (historiesDisplay HistoriesDisplay) Query(value string) template.URL

type History

type History struct {
	ID         string    `bson:"_id" json:"-"`
	U_ID       string    `bson:"U_ID" json:"-"`
	URLs       []string  `bson:"urls" json:"urls"`
	Type       string    `bson:"type" json:"type"`
	Owner      string    `bson:"owner" json:"owner"`
	Post       string    `bson:"post" json:"post"`
	Date       time.Time `bson:"date" json:"date"`
	Incognito  bool      `bson:"incognito" json:"incognito"`
	Categories []string  `bson:"categories" json:"categories"`
}

type HistoryDisplay

type HistoryDisplay struct {
	History
	SelectedCategories map[string]bool
	Errors             []error
	Version            string
}

func (HistoryDisplay) HistoryQuery

func (historyDisplay HistoryDisplay) HistoryQuery() template.URL

type User

type User struct {
	ID          primitive.ObjectID    `bson:"_id" json:"-"`
	Username    string                `bson:"username" json:"-"`
	Hash        string                `bson:"hash" json:"-"`
	Credentials []webauthn.Credential `bson:"credentials" json:"-"`
	Session     webauthn.SessionData  `bson:"session" json:"-"`
	Instagram   struct {
		FBSR      string `bson:"fbsr" json:"-"`
		SessionID string `bson:"session_id" json:"-"`
		UserID    string `bson:"user_id" json:"-"`
	} `bson:"instagram" json:"-"`
	TikTok struct {
		SessionID      string `bson:"session_id" json:"-"`
		SessionIDGuard string `bson:"session_id_guard" json:"-"`
		ChainToken     string `bson:"chain_token" json:"-"`
	} `bson:"tiktok" json:"-"`
	Joined     time.Time `bson:"joined" json:"-"`
	Network    string    `bson:"network" json:"-"`
	Categories []string  `bson:"categories" json:"-"`
}

func (*User) OpenInstagram

func (user *User) OpenInstagram(password string) (fbsr, sessionID, userID string, err error)

func (*User) OpenTikTok

func (user *User) OpenTikTok(password string) (string, error)

func (*User) SelectedCategories

func (user *User) SelectedCategories(categories []string) map[string]bool

func (User) WebAuthnCredentials

func (user User) WebAuthnCredentials() []webauthn.Credential

func (User) WebAuthnDisplayName

func (user User) WebAuthnDisplayName() string

func (User) WebAuthnID

func (user User) WebAuthnID() []byte

func (User) WebAuthnIcon

func (user User) WebAuthnIcon() string

func (User) WebAuthnName

func (user User) WebAuthnName() string

type UserCategoryDisplay

type UserCategoryDisplay struct {
	Username     string
	Categories   []string
	HistoryQuery template.URL
	Version      string
}

Jump to

Keyboard shortcuts

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