Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultHost is an immutable default host of government data registry. DefaultHost = "https://data.gov.ua" // DefaultBasePath is an immutable base path of government data registry. DefaultBasePath = "/api/3/action" )
View Source
const TimeFormat = "2006-01-02T15:04:05.999999"
TimeFormat is default time format of the government website.
Variables ¶
View Source
var ( // BaseHost equals to DefaultHost by default, it is mutable. BaseHost = DefaultHost // BasePath equals to DefaultBasePath by default, it is mutable. BasePath = DefaultBasePath )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is core http client struct.
type Group ¶
type Group struct { DisplayName string `json:"display_name"` Description string `json:"description"` ImageDisplayURL string `json:"image_display_url"` Title string `json:"title"` ID string `json:"id"` Name string `json:"name"` }
Group is a REST object.
type Package ¶
type Package struct { LicenseTitle string `json:"license_title"` Maintainer string `json:"maintainer"` TagString string `json:"tag_string"` PurposeOfCollectingInformation string `json:"purpose_of_collecting_information"` Private bool `json:"private"` MaintainerEmail string `json:"maintainer_email"` NumTags int `json:"num_tags"` UpdateFrequency string `json:"update_frequency"` ID string `json:"id"` MetadataCreated string `json:"metadata_created"` MetadataModified string `json:"metadata_modified"` Author string `json:"author"` AuthorEmail string `json:"author_email"` State string `json:"state"` Version string `json:"version"` IsDataPackage string `json:"is_datapackage"` CreatorUserID string `json:"creator_user_id"` Type string `json:"type"` Resources []Resource `json:"resources"` NumResources int `json:"num_resources"` Tags []Tag `json:"tags"` Language string `json:"language"` Groups []Group `json:"groups"` LicenseID string `json:"license_id"` Name string `json:"name"` IsOpen bool `json:"isopen"` Notes string `json:"notes"` OwnerOrg string `json:"owner_org"` LicenseURL string `json:"license_url"` Title string `json:"title"` RevisionID string `json:"revision_id"` }
Package is a REST object.
type Resource ¶
type Resource struct { PackageID string `json:"package_id"` DataStoreActive bool `json:"datastore_active"` ID string `json:"id"` Size int `json:"size"` FileHashSum string `json:"file_hash_sum"` State string `json:"state"` Hash string `json:"hash"` Description string `json:"description"` Format string `json:"format"` LastModified Time `json:"last_modified"` URLType string `json:"url_type"` MIMEType string `json:"mimetype"` Name string `json:"name"` Created string `json:"created"` URL string `json:"url"` Position int `json:"position"` RevisionID string `json:"revision_id"` }
Resource is a REST object.
type Response ¶
type Response struct { Help string `json:"help"` Success bool `json:"success"` Result json.RawMessage `json:"result"` }
Response from data registry has always same base payload.
type Tag ¶
type Tag struct { State string `json:"state"` DisplayName string `json:"display_name"` ID string `json:"id"` Name string `json:"name"` }
Tag is a REST object.
type Time ¶
Time is almost the same as time.Time, but has behaves differently on JSON serialization.
func (*Time) MarshalJSON ¶
MarshalJSON overrides JSON serialization.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON overrides JSON deserialization.
Click to show internal directories.
Click to hide internal directories.