models

package
v2.13.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	ContentType     string  `sql:"type"`
	Content         string  `sql:"content"`
	DataPath        *string `sql:"data_path"`
	Pattern         *string `sql:"pattern"`
	FallbackAction  *int    `sql:"fallback_action"`
	Primary         bool    `sql:"main"`
	Priority        int     `sql:"priority"`
	ID              int     `sql:"id"`
	PostText        *string `sql:"post_text"`
	Description     *string `sql:"description"`
	NoteProcessMode int     `sql:"note_process_mode"`
}

func (Action) IsImageType added in v1.0.1

func (a Action) IsImageType() bool

func (Action) IsTriggerType

func (a Action) IsTriggerType() bool

func (Action) IsURLPostType

func (a Action) IsURLPostType() bool

func (Action) IsURLType

func (a Action) IsURLType() bool

func (Action) WantsImmediateNote

func (a Action) WantsImmediateNote() bool

func (Action) WantsPostingNote

func (a Action) WantsPostingNote() bool

type Bot

type Bot struct {
	GroupName     string `sql:"group_name"`
	GroupID       string `sql:"group_id"`
	BotNameString string `sql:"bot_name"`
	Key           string `sql:"key"`
}

func (Bot) BotNames

func (b Bot) BotNames() []string

func (Bot) SanitizedBotNames

func (b Bot) SanitizedBotNames() []string

type ByID added in v1.1.0

type ByID []Action

func (ByID) Len added in v1.1.0

func (b ByID) Len() int

func (ByID) Less added in v1.1.0

func (b ByID) Less(i, j int) bool

func (ByID) Swap added in v1.1.0

func (b ByID) Swap(i, j int)

type ByPriority

type ByPriority []Action

func (ByPriority) Len

func (b ByPriority) Len() int

func (ByPriority) Less

func (b ByPriority) Less(i, j int) bool

func (ByPriority) Swap

func (b ByPriority) Swap(i, j int)

type Repo

type Repo interface {
	FetchBot(id string) (Bot, error)
	FetchActions(primary bool, includeTriggers bool) ([]Action, error)
	FetchAction(id int) (Action, error)
}

func PostGresRepo

func PostGresRepo() Repo

Jump to

Keyboard shortcuts

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