autohosterdb

package module
v0.0.0-...-ea9932c Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: GPL-3.0 Imports: 5 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               int
	Username         string
	Email            string
	AccountCreated   time.Time
	LastSeen         time.Time
	Terminated       bool
	EmailConfirmed   *time.Time
	AllowHostRequest bool
	BypasssISPBan    bool `db:"bypass_ispban"`
	DisplayName      *string
	LastReport       time.Time
	LastRequest      time.Time
}

func GetAccounts

func GetAccounts(ctx context.Context, db *pgxpool.Pool) ([]*Account, error)

type Announcement

type Announcement struct {
	ID         int
	Title      string
	Content    template.HTML
	WhenPosted time.Time
	Color      string
}

func AddAnnouncement

func AddAnnouncement(ctx context.Context, db *pgxpool.Pool) ([]*Announcement, error)

func GetAnnouncements

func GetAnnouncements(ctx context.Context, db *pgxpool.Pool) ([]*Announcement, error)

func GetLastAnnouncements

func GetLastAnnouncements(ctx context.Context, db *pgxpool.Pool, n int) ([]*Announcement, error)

type Identity

type Identity struct {
	ID      int
	Name    string
	Pkey    []byte
	Hash    string
	Account int
}

func GetIdentities

func GetIdentities(ctx context.Context, db *pgxpool.Pool) ([]*Identity, error)

func GetUserIdentities

func GetUserIdentities(ctx context.Context, db *pgxpool.Pool, userID int) ([]*Identity, error)

Jump to

Keyboard shortcuts

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