Documentation ¶
Index ¶
- Constants
- func RequestID() string
- func TimestampStr() string
- type APIClient
- func (c *APIClient) AddPrinter(machineCode, msign string) (apiResp *APIResponse, err error)
- func (c *APIClient) Authorize() (err error)
- func (c *APIClient) DeletePrinter(machineCode string) (apiResp *APIResponse, err error)
- func (c *APIClient) GetPrinterStatus(machineCode string) (apiResp *APIResponse, err error)
- func (c *APIClient) PostForm(url string, data url.Values) (apiResp *APIResponse, err error)
- func (c *APIClient) Print(machineCode, content string) (apiResp *APIResponse, err error)
- func (c *APIClient) Sign(timestamp string) string
- type APIResponse
- type GormModel
- type GormStore
- type MemoryStore
- type TokenStore
Constants ¶
View Source
const ( PrinterStatusOffline = "0" PrinterStatusOnline = "1" PrinterStatusOutofpaper = "2" )
Variables ¶
This section is empty.
Functions ¶
func TimestampStr ¶
func TimestampStr() string
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
func NewAPIClient ¶
func NewAPIClient(clientID, clientSecret string, tokenStore TokenStore) *APIClient
func (*APIClient) AddPrinter ¶
func (c *APIClient) AddPrinter(machineCode, msign string) (apiResp *APIResponse, err error)
func (*APIClient) DeletePrinter ¶
func (c *APIClient) DeletePrinter(machineCode string) (apiResp *APIResponse, err error)
func (*APIClient) GetPrinterStatus ¶
func (c *APIClient) GetPrinterStatus(machineCode string) (apiResp *APIResponse, err error)
type APIResponse ¶
type APIResponse struct { Error string `json:"error"` ErrorDescription string `json:"error_description"` Body json.RawMessage `json:"body"` }
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
func (*MemoryStore) Set ¶
func (s *MemoryStore) Set(clientID, token string) (err error)
Click to show internal directories.
Click to hide internal directories.