database

package
v0.0.0-...-f11dbed Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckInviteExpires

func CheckInviteExpires(id int) (bool, error)

func CreateLog

func CreateLog(inviteId int, userId, ip string) error

func IncrementInviteUses

func IncrementInviteUses(id int) error

func InitDB

func InitDB()

func SetInviteActive

func SetInviteActive(id int, active bool) error

Types

type Invite

type Invite struct {
	ID          int    `json:"id"`
	CreatedAt   int64  `json:"created_at"`
	InviteCode  string `json:"invite_code"`
	ExpireTime  int64  `json:"expire_time"`
	ExpireUses  int    `json:"expire_uses"`
	CurrentUses int    `json:"current_uses"`
	CreatedBy   string `json:"created_by"`
	Active      bool   `json:"active"`
}

func CreateInvite

func CreateInvite(inv Invite) (Invite, error)

func GetInviteByCode

func GetInviteByCode(code string) (Invite, error)

func GetInviteByID

func GetInviteByID(id int) (Invite, error)

type Log

type Log struct {
	ID        int    `json:"id"`
	InviteID  int    `json:"invite_id"`
	UserID    string `json:"user_id"`
	Timestamp int64  `json:"timestamp"`
	IP        string `json:"ip"`
}

Jump to

Keyboard shortcuts

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