Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( GetPostDetail = `` /* 431-byte string literal not displayed */ GetTimeline = ` user(username: \"%s\") { publication { posts(page:%d) { slug dateAdded dateUpdated } } }` )
View Source
var ( PostUnmarshaler = func(bytes []byte) (any, error) { var e PostError if err := json.Unmarshal(bytes, &e); err != nil { return nil, err } if len(e.Errors) > 0 { return nil, fmt.Errorf("unexpected API response: %s", e.Errors[0]["message"]) } // { "data": { "post": { ... } } } var results map[string]map[string]*models.Post if err := json.Unmarshal(bytes, &results); err != nil { return nil, err } return results["data"]["post"], nil } TimelineUnmarshaler = func(bytes []byte) (any, error) { // { "data": { "user": { "publication": { "posts": [ ... ] } } } } var results map[string]map[string]map[string]map[string][]models.Post if err := json.Unmarshal(bytes, &results); err != nil { return nil, err } return results["data"]["user"]["publication"]["posts"], nil } )
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.