db

package
v0.0.0-...-fa9e147 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Database *sql.DB

Functions

func AddFeedback

func AddFeedback(feedback Feedback) error

func AddInboxMessage

func AddInboxMessage(user, sender, message string) (int64, error)

func Create

func Create() (*sql.DB, error)

func DeleteChal

func DeleteChal(wallet string) error

func GetAdminChal

func GetAdminChal() (string, error)

func GetInboxCount

func GetInboxCount(user string) (int, error)

func InsertUserKey

func InsertUserKey(wallet string, key string) (string, error)

func RemoveInboxMessage

func RemoveInboxMessage(user string, messageIds []int64) error

func ResetAdminChal

func ResetAdminChal() error

func SetAdminChal

func SetAdminChal() (string, error)

func SetNewChal

func SetNewChal(wallet string) (string, error)

func UpdateFeedbackDone

func UpdateFeedbackDone(id int, done bool) error

Types

type Feedback

type Feedback struct {
	Type    string
	Wallet  string
	Target  string
	Content string
	Done    bool
}

func GetAllFeedback

func GetAllFeedback() ([]Feedback, error)

func GetFeedbackByID

func GetFeedbackByID(id int) (Feedback, error)

func GetFeedbackByWallet

func GetFeedbackByWallet(wallet string) ([]Feedback, error)

type InboxMessage

type InboxMessage struct {
	ID        int64     `json:"id"`
	User      string    `json:"user"`
	Sender    string    `json:"sender"`
	Message   string    `json:"message"`
	Timestamp time.Time `json:"timestamp"`
}

func GetInboxMessages

func GetInboxMessages(user string) ([]InboxMessage, error)

type UserKey

type UserKey struct {
	ID       int    `json:"id"`
	WalletID string `json:"wallet"`
	Key      string `json:"key"`
	Chal     string `json:"chal"`
}

func GetUserKey

func GetUserKey(wallet string) (UserKey, error)

Jump to

Keyboard shortcuts

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