Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is used to interact with the Attach.as API.
func NewClient ¶
NewClient creates a new API client. All requests must be authenticated, so you should supply a user access token returned from the Write.as API library (github.com/writeas/go-writeas/v2)
wc := writeas.NewClient()
u, err := wc.LogIn("username", "password")
if err != nil {
// Handle error...
}
sc := attachas.NewClient(u.AccessToken)
func NewClientWith ¶
func NewClientWith(cfg *as.ClientConfig, token string) *Client
NewClientWith builds a new API client with the provided configuration.
func NewDevClient ¶
NewDevClient creates a new API client for development and testing. It will communicate with our development servers, and SHOULD NOT be used in production.
func (*Client) UploadFile ¶
func (c *Client) UploadFile(sp *FileParams) (*File, error)
UploadFile uploads a photo, and returns an Attach.as File.
type File ¶
type File struct {
ID string `json:"id"`
Created time.Time `json:"created"`
Filename string `json:"filename"`
Size int64 `json:"size"`
URL string `json:"url"`
}
File represents a photo on Snap.as.
type FileParams ¶
type FileParams struct {
FileName string
Body string
// OrgAlias is the alias of the organization to upload to.
OrgAlias string
}
FileParams holds valid values for uploading files.
Click to show internal directories.
Click to hide internal directories.