gomsglog

package
v0.0.0-...-247d41d Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Archive

func Archive(id int)

func AutoMigrate

func AutoMigrate()

func DeleteMessage

func DeleteMessage(messageID int) bool

func GetBinary

func GetBinary() string

func GetBuildDate

func GetBuildDate() string

func GetDB

func GetDB() *gorm.DB

func GetVersion

func GetVersion() string

func SetBinaryInfo

func SetBinaryInfo(b string)

func SetBuildDateInfo

func SetBuildDateInfo(b string)

func SetVersionInfo

func SetVersionInfo(v string)

func Update

func Update(id int, message parsers.Message)

Types

type AttributeSet

type AttributeSet struct {
	gorm.Model
	MessageRef  uint
	Slug        string `grom:"index:slug"`
	ScreenName  string
	Type        string `grom:"index:type"`
	DateValue   time.Time
	IntValue    int64
	FloatValue  float64
	StringValue string `grom:"index:string_value"`
	BoolValue   bool
}

func (*AttributeSet) String

func (a *AttributeSet) String() string

type MessageModel

type MessageModel struct {
	gorm.Model
	Original     string
	HTML         string
	Created      time.Time
	Archived     bool
	Tags         []TagModel     `gorm:"ForeignKey:MessageRef"`
	RelatedUsers []UserModel    `gorm:"ForeignKey:MessageRef"`
	Attributes   []AttributeSet `gorm:"ForeignKey:MessageRef"`
	URLs         []URLModel     `gorm:"ForeignKey:MessageRef"`
}

func LoadMessage

func LoadMessage(messageID int) (MessageModel, bool)

func LoadMessages

func LoadMessages(limit int, offset int, tags []string, users []string, attrs []string, archived bool) []MessageModel

func Persist

func Persist(message parsers.Message) *MessageModel

func (*MessageModel) HasTagsOrRelatedUsers

func (m *MessageModel) HasTagsOrRelatedUsers() bool

type MessagesQuery

type MessagesQuery struct {
	Limit    int
	Offest   int
	Tags     []string
	Users    []string
	Attrs    []string
	Archived bool
}

func NewMessagesQuery

func NewMessagesQuery() MessagesQuery

type TagModel

type TagModel struct {
	gorm.Model
	MessageRef uint
	Slug       string
	ScreenName string
}

type TagSet

type TagSet struct {
	Slug       string `gorm:"slug"`
	ScreenName string `gorm:"screenname"`
}

func LoadTags

func LoadTags() []TagSet

type URLModel

type URLModel struct {
	gorm.Model
	MessageRef uint
	URL        string
	Scheme     string
	Domain     string
	Path       string
	Params     string
}

type UserModel

type UserModel struct {
	gorm.Model
	MessageRef uint
	Slug       string
	ScreenName string
}

type UserSet

type UserSet struct {
	Slug       string `gorm:"slug"`
	ScreenName string `gorm:"screenname"`
}

func LoadUsers

func LoadUsers() []UserSet

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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