types

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

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIv0

type APIv0 struct {
	RouterPath   string
	EnforceHTTPS bool
	APIDomain    string
	Routes       func(fiber.Router)
	Auth         *Auth
}

type Auth

type Auth struct {
	ServerURL  string
	SessionKey string
}

type Claims

type Claims struct {
	Email            string `json:"email,omitempty"`
	Username         string `json:"username,omitempty"`
	ULID             string `json:"ulid,omitempty"`
	IdentityProvider string `json:"identity_provider,omitempty"`
	jwt.RegisteredClaims
}

Claims are custom claims extending default ones

type Database

type Database struct {
	DB     *sql.DB
	Flavor sqlbuilder.Flavor
}

type EmailArgs

type EmailArgs struct {
	Subject  string // Subject of email
	To       string // Email address of recipient (to user)
	Nickname string // Nickname of sender (i.e. this server)
}

type MailConfig

type MailConfig struct {
	Enabled  bool
	Port     int
	Server   string
	Username string
	Password string
}

type Pages

type Pages struct {
	RouterPath     string
	ServerURL      string
	APIURL         string
	ServerName     string
	PrimaryWebsite string
	Routes         func(fiber.Router)
	Auth           *Auth
}

type Provider

type Provider struct {
	AccountEndpoint string
	UsernameKey     string
	EmailKey        string
	OAuthConfig     *oauth2.Config
}

type State

type State struct {
	Redirect string `json:"redirect,omitempty"`
	jwt.RegisteredClaims
}

type User

type User struct {
	ID       string // ulid
	Username string
	Password string // scrypt
	Email    string
	State    bitfield.Bitfield8 // bitfield
}

func (*User) String

func (u *User) String() string

Jump to

Keyboard shortcuts

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