models

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2016 License: MIT Imports: 4 Imported by: 0

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

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"`
	BotName   string `sql:"bot_name"`
	Key       string `sql:"key"`
}

func FetchBot

func FetchBot(id string) (Bot, error)

Public Methods

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