model

package
v0.0.0-...-aeca8d2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewModel

func NewModel(db *sqlx.DB) *model

Types

type Database

type Database interface {
	AddMessage(msg *Message) (string, error)
	GetMessage(id string) (*Message, error)
	UpdateMessagePendingStatus(id string, pending bool) (err error)
	GetAcceptedMessages() ([]*Message, error)
	SetDiscordMessageID(id string, discordMsgId string) (err error)
}

type Message

type Message struct {
	ID               string    `json:"id,string" db:"id"`
	UUID             string    `json:"-" db:"uuid"`
	TwitterName      string    `json:"twitter" db:"twitter_name"`
	Name             string    `json:"name" db:"name"`
	Location         string    `json:"location" db:"location"`
	Message          string    `json:"message" db:"message"`
	Image            string    `json:"image,omitempty" db:"image"`
	Avatar           int       `json:"pfp" db:"avatar"`
	Pending          bool      `json:"-" db:"is_pending"`
	CreatedAt        time.Time `json:"created_at,omitempty" db:"created_at"`
	DiscordMessageID string    `json:"-" db:"discord_message_id"`
}

Jump to

Keyboard shortcuts

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