Documentation
¶
Index ¶
Constants ¶
View Source
const Endpoint = "https://api.shimo.im"
View Source
const TokenTTL = time.Hour
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
Opts
// contains filtered or unexported fields
}
Cache cache request data
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a way to interact with Shimo.im using such credentials
func NewClient ¶
func NewClient(clientId string, clientSecret string, username string, password string, scope string) *Client
NewClient initializes a new Client
func (*Client) AppendFileFromAPI ¶
func (*Client) GetFileWithOpts ¶
GetFileWithOpts gets a file from shimo.im with the specified fileID and Opts. It returns the response io.Reader which can be used to stream responses. The one using this method SHOULD cache the file content response from this method due to the limitation of shimo.im's API.
type Opts ¶
type Opts struct {
SheetName string `json:"sheet_name"`
EndRow int `json:"end_row"`
EndCol string `json:"end_col"`
// the suffix in the header to be removed
HeaderSuffix string `json:"header_suffix"`
CacheTTL time.Duration `json:"cache_ttl"`
}
Opts provide options for getting sheet data
type WriteObj ¶
type WriteObj interface {
Values() []interface{}
}
Because the map data is unordered, you need to customize the order in which the fields are stored
type WriteOpts ¶
type WriteOpts struct {
Range string `json:"range"`
Resource *WriteResource `json:"resource"`
}
func NewWriteOpts ¶
type WriteResource ¶
type WriteResource struct {
Values [][]interface{} `json:"values"`
}
Click to show internal directories.
Click to hide internal directories.