api

package
v3.14.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2017 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Actions = &ActionCache{M: make(map[int]*Action)}
View Source
var Users = &UsersCache{M: make(map[string][]*User)}

Functions

func GetUsers

func GetUsers(teams string) map[string]*User

func LinkToSMS

func LinkToSMS(content string) (string, error)

func ParseTeams

func ParseTeams(teams string) ([]string, []string)

return phones, emails

Types

type Action

type Action struct {
	Id                 int    `json:"id"`
	Uic                string `json:"uic"`
	Url                string `json:"url"`
	Callback           int    `json:"callback"`
	BeforeCallbackSms  int    `json:"before_callback_sms"`
	BeforeCallbackMail int    `json:"before_callback_mail"`
	AfterCallbackSms   int    `json:"after_callback_sms"`
	AfterCallbackMail  int    `json:"after_callback_mail"`
}

func CurlAction

func CurlAction(id int) *Action

func GetAction

func GetAction(id int) *Action

type ActionCache

type ActionCache struct {
	sync.RWMutex
	M map[int]*Action
}

func (*ActionCache) Get

func (this *ActionCache) Get(id int) *Action

func (*ActionCache) Set

func (this *ActionCache) Set(id int, action *Action)

type ActionWrap

type ActionWrap struct {
	Msg  string  `json:"msg"`
	Data *Action `json:"data"`
}

type User

type User struct {
	Name  string `json:"name"`
	Email string `json:"email"`
	Phone string `json:"phone"`
	IM    string `json:"im"`
}

func CurlUic

func CurlUic(team string) []*User

func UsersOf

func UsersOf(team string) []*User

type UsersCache

type UsersCache struct {
	sync.RWMutex
	M map[string][]*User
}

func (*UsersCache) Get

func (this *UsersCache) Get(team string) []*User

func (*UsersCache) Set

func (this *UsersCache) Set(team string, users []*User)

type UsersWrap

type UsersWrap struct {
	Msg   string  `json:"msg"`
	Users []*User `json:"users"`
}

Jump to

Keyboard shortcuts

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