Documentation
¶
Index ¶
Constants ¶
const DefaultURL = "https://data.gov.ua"
DefaultURL is a URL of official Ukrainian government data platform.
Variables ¶
var BaseURL = DefaultURL
BaseURL is current base URL used for sending requests.
var DefaultClient = NewClient()
DefaultClient is a default HTTP client.
Functions ¶
func ResourceRevision ¶
func ResourceRevision(pkg, resource, revision string) (io.ReadCloser, error)
Revision returns information about specific revision of a specific resource. This is not a part of API, but it pretty important method for downloading updated version of a resource.
Types ¶
type Client ¶
Client is wrapper of http.Client for Ukrainian government data platform.
func NewClient ¶
func NewClient() *Client
NewClient creates new instance of client with timeout equal 5 seconds.
func (*Client) ResourceRevision ¶
func (client *Client) ResourceRevision(ctx context.Context, pkg, resource, revision string) (io.ReadCloser, error)
Revision returns information about specific revision of a specific resource. This is not a part of API, but it pretty important method for downloading updated version of a resource.
func (*Client) ResourceShow ¶
ResourceShow returns information about resource by it's unique id. For more information: https://data.gov.ua/pages/aboutuser2.
type Resource ¶
type Resource struct { Revisions []Revision `json:"resource_revisions"` PackageID string `json:"package_id"` }
Resource represents detailed information about resource and it's changes.
func ResourceShow ¶
ResourceShow returns information about resource by it's unique id. For more information: https://data.gov.ua/pages/aboutuser2.
type Response ¶
type Response struct {
Result json.RawMessage `json:"result"`
}
Response is a general structure of platform response.
type Revision ¶
type Revision struct { ID string `json:"id"` MimeType string `json:"mimetype"` Name string `json:"name"` Format string `json:"format"` URL string `json:"url"` FileHashSum *string `json:"file_hash_sum"` ResourceCreated string `json:"resource_created"` Size int `json:"size"` }
Revision is an represents changes of a resource.
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
func NewSubscription ¶
func NewSubscription(id string) *Subscription