Documentation ¶
Index ¶
- Constants
- func ValidateAccessTokenAlt(token string) (bool, error)
- type AccessTokenLocal
- type AccessTokenServer
- type Client
- func (c *Client) AddUserUac(groupId int, userId int) (User, error)
- func (c *Client) DeleteGroup(groupId int) (bool, error)
- func (c *Client) Device(deviceId int) (Device, error)
- func (c *Client) Group(groupId int) (UAC, error)
- func (c *Client) Groups(filter ...map[string]string) ([]UAC, error)
- func (c *Client) Location() (location, error)
- func (c *Client) Member(groupId int, userId int) (User, error)
- func (c *Client) Members(groupId int, filter ...map[string]string) ([]User, error)
- func (c *Client) ModifyGroup(groupId int, name string, showName string) (UAC, error)
- func (c *Client) NewGroup(name string, showName string) (UAC, error)
- func (c *Client) NewIntercom(msg string) *Intercom
- func (c *Client) NewPageAccessToken(pem ...string) (string, error)
- func (c *Client) PushGroup(groupId int, msg string) (bool, error)
- func (c *Client) PushUser(userId int, msg string) (bool, error)
- func (c *Client) RemoveUserUac(groupId int, userId int) (bool, error)
- func (c *Client) SetLocation(location int) *Client
- func (c *Client) SetSecret(secret string) *Client
- func (c *Client) SetTapp(tapp int) *Client
- func (c *Client) User(userId int) (User, error)
- func (c *Client) UserDevice(userId int, deviceId int) (Device, error)
- func (c *Client) UserDevices(userId int, filter ...map[string]string) ([]Device, error)
- func (c *Client) UserUAC(userId int, filter ...map[string]string) ([]UAC, error)
- func (c *Client) Users(filter ...map[string]string) ([]User, error)
- func (c *Client) ValidateAccessToken(token string, uac ...int) (AccessTokenServer, error)
- type Device
- type Intercom
- func (i *Intercom) AddGroup(groupId ...int) *Intercom
- func (i *Intercom) AddImage(url ...string) *Intercom
- func (i *Intercom) AddLocation(locationId ...int) *Intercom
- func (i *Intercom) AddUser(userId ...int) *Intercom
- func (i *Intercom) Send() (bool, error)
- func (i *Intercom) SetAccessToken(token string) *Intercom
- func (i *Intercom) SetGroupChat(group bool) *Intercom
- func (i *Intercom) SetThreadName(name string) *Intercom
- type UAC
- type User
Constants ¶
const ( BASE_URL = "https://api.chayns.net/" VERSION = "v2.0" )
Variables ¶
This section is empty.
Functions ¶
func ValidateAccessTokenAlt ¶ added in v0.5.0
Types ¶
type AccessTokenLocal ¶ added in v0.6.0
type AccessTokenLocal struct { Jti string `json:"jti,omitempty"` Sub string `json:"sub,omitempty"` Type int `json:"type,omitempty"` Exp time.Time `json:"exp,omitempty"` Iat time.Time `json:"iat,omitempty"` LocationID int `json:"LocationID,omitempty"` SiteID string `json:"SiteID,omitempty"` IsAdmin bool `json:"IsAdmin,omitempty"` TobitUserID int `json:"TobitUserID,omitempty"` PersonID string `json:"PersonID,omitempty"` FirstName string `json:"FirstName,omitempty"` LastName string `json:"LastName,omitempty"` Prov int `json:"prov,omitempty"` }
func InspectAccesstoken ¶ added in v0.6.0
func InspectAccesstoken(token string) (AccessTokenLocal, error)
type AccessTokenServer ¶ added in v0.6.0
type AccessTokenServer struct { LocationID int `json:"locationId"` DeveloperID int `json:"developerId"` TappID int `json:"tappId"` Permissions []string `json:"permissions"` UserID int `json:"userId"` FacebookUserID string `json:"facevookUserId"` PersonID string `json:"personId"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Expires time.Time `json:"expires"` TokenType struct { Type int `json:"type"` Name string `json:"name"` } `json:"tokenType"` }
type Client ¶ added in v0.5.0
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddUserUac ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Group-Member#add-user-to-uac-group
func (*Client) DeleteGroup ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Group#delete-uac-group
func (*Client) Device ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Device
func (*Client) Group ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Group#get-uac-group
func (*Client) Groups ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Group#get-all-uac-groups
func (*Client) Location ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Location
func (*Client) Member ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Group-Member#get-uac-member
func (*Client) Members ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Group-Member#get-all-uac-members
func (*Client) ModifyGroup ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Group#modify-uac-group
func (*Client) NewGroup ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Group#create-uac-group
func (*Client) NewIntercom ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Intercom
func (*Client) NewPageAccessToken ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Authorization
func (*Client) PushGroup ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Push#push-to-uac-group
func (*Client) PushUser ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Push#push-to-user
func (*Client) RemoveUserUac ¶ added in v0.5.0
func (*Client) SetLocation ¶ added in v0.5.0
func (*Client) User ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-User#get-user
func (*Client) UserDevice ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-User#get-device-from-user
func (*Client) UserDevices ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-User#get-all-devices-from-user
func (*Client) UserUAC ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-User#get-uac-groups
func (*Client) Users ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-User#get-all-users
func (*Client) ValidateAccessToken ¶ added in v0.5.0
func (c *Client) ValidateAccessToken(token string, uac ...int) (AccessTokenServer, error)
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-AccessToken#read-accesstoken
type Intercom ¶
type Intercom struct { Message string `json:"Message"` UacIds []int `json:"UacIds,omitempty"` UserIds []int `json:"UserIds,omitempty"` ReceiverLocationIds []int `json:"ReceiverLocationIds,omitempty"` ThreadName string `json:"ThreadName,omitempty"` UseGroupChat bool `json:"UseGroupChat"` UserAccessToken string `json:"UserAccessToken,omitempty"` Images []image `json:"Images,omitempty"` // contains filtered or unexported fields }
func (*Intercom) AddGroup ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Intercom
func (*Intercom) AddImage ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Intercom
func (*Intercom) AddLocation ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Intercom
func (*Intercom) AddUser ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Intercom
func (*Intercom) Send ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Intercom
func (*Intercom) SetAccessToken ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Intercom
func (*Intercom) SetGroupChat ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Intercom
func (*Intercom) SetThreadName ¶ added in v0.5.0
https://github.com/TobitSoftware/chayns-backend/wiki/Reference-Intercom