Documentation ¶
Index ¶
- Constants
- func ToJSON(o any) string
- func ToJSONIndent(o any) string
- type Attachment
- type Attachments
- type Date
- type Error
- type ErrorResult
- type FDK
- func (fdk *FDK) DoDelete(url string) error
- func (fdk *FDK) DoDownload(url string) (buf []byte, err error)
- func (fdk *FDK) DoDownloadNoAuth(url string) (buf []byte, err error)
- func (fdk *FDK) DoGet(url string, result any) error
- func (fdk *FDK) DoList(url string, lo ListOption, ap any) (next bool, err error)
- func (fdk *FDK) DoPost(url string, source, result any) error
- func (fdk *FDK) DoPut(url string, source, result any) error
- func (fdk *FDK) DoSaveFile(url string, path string) error
- func (fdk *FDK) DoSaveFileNoAuth(url string, path string) error
- func (fdk *FDK) Endpoint(format string, a ...any) string
- func (fdk *FDK) RetryForError(api func() error) (err error)
- type File
- type Files
- type ListOption
- type PageOption
- type Time
- type TimeSpent
- type Values
- func (vs Values) Encode() string
- func (vs Values) Map() map[string][]string
- func (vs Values) SetBool(name string, value bool)
- func (vs Values) SetDate(name string, value Date)
- func (vs Values) SetDatePtr(name string, value *Date)
- func (vs Values) SetInt(name string, value int)
- func (vs Values) SetInt64(name string, value int64)
- func (vs Values) SetInt64s(name string, value []int64)
- func (vs Values) SetInts(name string, value []int)
- func (vs Values) SetMap(name string, value map[string]any)
- func (vs Values) SetString(name string, value string)
- func (vs Values) SetStringMap(name string, value map[string]string)
- func (vs Values) SetStrings(name string, value []string)
- func (vs Values) SetTime(name string, value Time)
- func (vs Values) SetTimePtr(name string, value *Time)
- type WithFiles
Constants ¶
View Source
const ( DateFormat = "2006-01-02" TimeFormat = "2006-01-02T15:04:05Z" )
Variables ¶
This section is empty.
Functions ¶
func ToJSONIndent ¶ added in v1.0.10
Types ¶
type Attachment ¶
type Attachment struct { ID int64 `json:"id,omitempty"` Name string `json:"name,omitempty"` Size int `json:"size,omitempty"` ContentType string `json:"content_type,omitempty"` AttachmentURL string `json:"attachment_url,omitempty"` CanonicalURL string `json:"canonical_url,omitempty"` CreatedAt *Time `json:"created_at,omitempty"` UpdatedAt *Time `json:"updated_at,omitempty"` // contains filtered or unexported fields }
func NewAttachment ¶
func NewAttachment(file string, data ...[]byte) *Attachment
func (*Attachment) Data ¶
func (a *Attachment) Data() []byte
func (*Attachment) Field ¶
func (a *Attachment) Field() string
func (*Attachment) File ¶
func (a *Attachment) File() string
func (*Attachment) String ¶
func (a *Attachment) String() string
type Attachments ¶ added in v1.0.9
type Attachments []*Attachment
func (Attachments) Files ¶ added in v1.0.9
func (as Attachments) Files() Files
type Date ¶ added in v1.0.9
func (*Date) MarshalJSON ¶ added in v1.0.9
func (*Date) UnmarshalJSON ¶ added in v1.0.9
type Error ¶
type ErrorResult ¶
type ErrorResult struct { StatusCode int `json:"-"` // http status code Status string `json:"-"` // http status Code string `json:"code,omitempty"` Message string `json:"message,omitempty"` Description string `json:"description,omitempty"` Errors []*Error `json:"errors,omitempty"` RetryAfter time.Duration }
func (*ErrorResult) Detail ¶ added in v1.0.10
func (er *ErrorResult) Detail() string
func (*ErrorResult) Error ¶
func (er *ErrorResult) Error() string
func (*ErrorResult) GetRetryAfter ¶ added in v1.0.16
func (er *ErrorResult) GetRetryAfter() time.Duration
type FDK ¶
type FDK struct { Domain string Apikey string Username string Password string Transport http.RoundTripper Timeout time.Duration Logger log.Logger MaxRetries int RetryAfter time.Duration AbortOnRetry func() error AbortInterval time.Duration }
func (*FDK) DoDownloadNoAuth ¶ added in v1.0.9
func (*FDK) DoSaveFileNoAuth ¶ added in v1.0.9
func (*FDK) RetryForError ¶ added in v1.0.10
type ListOption ¶
type PageOption ¶ added in v1.0.9
func (*PageOption) IsNil ¶ added in v1.0.9
func (po *PageOption) IsNil() bool
func (*PageOption) Values ¶ added in v1.0.9
func (po *PageOption) Values() Values
type TimeSpent ¶ added in v1.0.10
func ParseTimeSpent ¶ added in v1.0.10
type Values ¶
func (Values) SetDatePtr ¶ added in v1.0.9
func (Values) SetStringMap ¶ added in v1.0.10
func (Values) SetStrings ¶
func (Values) SetTimePtr ¶
Click to show internal directories.
Click to hide internal directories.