models

package
v2.3.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2018 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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"`
}

func FetchAction

func FetchAction(id int) (Action, error)

func FetchActions

func FetchActions(primary bool) ([]Action, error)

func (Action) IsImageType added in v1.0.1

func (a Action) IsImageType() bool

func (Action) IsURLType

func (a Action) IsURLType() 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 FetchBot

func FetchBot(id string) (Bot, error)

Public Methods

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)

Jump to

Keyboard shortcuts

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