api

package
v0.0.0-...-a9119a5 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0, Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ActionsCache     = cache.New(g.CacheTTl, g.CacheTTl)
	EndTplGroupCache = cache.New(g.CacheTTl, g.CacheTTl)
	EndTagsCache     = cache.New(g.CacheTTl, g.CacheTTl)
	OtherCache       = cache.New(g.CacheTTl, g.CacheTTl)
)

var Actions = &ActionCache{M: make(map[int]*Action)}

View Source
var UserCache = cache.New(g.CacheTTl, g.CacheTTl)

cache : key team name ,value []*users

View Source
var Users = &UsersCache{M: make(map[string][]*uic.User)}

Functions

func CurlUic

func CurlUic(team string) []*uic.User

func GetAmsTag

func GetAmsTag(endpoint string) string

func GetEndpointTplGroups

func GetEndpointTplGroups(tplId int, endpoint string) (grps string)

func GetUsers

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

func HttpCurlUic

func HttpCurlUic(team string) []*uic.User

func HttpGetEndpointTplGroups

func HttpGetEndpointTplGroups(tplId int, endpoint string) (grps string)

func HttpGetTag

func HttpGetTag(endpoint string) string
func HttpLink(content string) (string, error)

func LinkToSMS

func LinkToSMS(content string) (string, error)

func ParseTeams

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

return phones, emails, IM

func ParseTeamsForLarkGroup

func ParseTeamsForLarkGroup(teams, LarkGroupId string) ([]string, []string)

return phones, emails, IM

func UsersOf

func UsersOf(team string) []*uic.User

Types

type APIGetTeamOutput

type APIGetTeamOutput struct {
	uic.Team
	Users       []*uic.User `json:"users"`
	TeamCreator string      `json:"creator_name"`
}

type Action

type Action struct {
	Id                 int    `json:"id"`
	Uic                string `json:"uic"`
	LarkGroupId        string `json:"lark_group_id"`
	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"`
}

TODO:use api/app/model/falcon_portal/action.go

func CurlAction

func CurlAction(id int) *Action

func GetAction

func GetAction(id int) *Action

func HttpGetAction

func HttpGetAction(id int) *Action

type ActionCache

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

type AmsOwner

type AmsOwner struct {
	Response Owners `json:"response"`
}

start set byte wenxudong

type HostGroups

type HostGroups struct {
	Name string `json:"grp_name" gorm:"column:grp_name"`
	Id   int64  `json:"grp_id" gorm:"column:grp_id"`
}

type Owners

type Owners struct {
	Owners     []string `json:"owner"`
	OwnerGroup []string `json:"owner_group"`
}

type UsersCache

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

func (*UsersCache) Get

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

func (*UsersCache) Set

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

Jump to

Keyboard shortcuts

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