Documentation ¶
Index ¶
- type Ckan
- func (c *Ckan) CreatePackage(ctx context.Context, pkg Package) (Package, error)
- func (c *Ckan) CreateResource(ctx context.Context, resource Resource) (Resource, error)
- func (c *Ckan) PatchPackage(ctx context.Context, pkg Package) (Package, error)
- func (c *Ckan) PatchResource(ctx context.Context, resource Resource) (Resource, error)
- func (c *Ckan) ReorderResource(ctx context.Context, pkgID string, resourceIDs []string) error
- func (c *Ckan) SavePackage(ctx context.Context, pkg Package) (Package, error)
- func (c *Ckan) SaveResource(ctx context.Context, resource Resource) (Resource, error)
- func (c *Ckan) SearchPackageByName(ctx context.Context, name string) (List[Package], error)
- func (c *Ckan) ShowPackage(ctx context.Context, id string) (Package, error)
- func (c *Ckan) UploadResource(ctx context.Context, resource Resource, filename string, data []byte) (Resource, error)
- type Error
- type Interface
- type List
- type Mock
- func (c *Mock) CreatePackage(ctx context.Context, pkg Package) (Package, error)
- func (c *Mock) CreateResource(ctx context.Context, resource Resource) (Resource, error)
- func (c *Mock) PatchPackage(ctx context.Context, pkg Package) (Package, error)
- func (c *Mock) PatchResource(ctx context.Context, resource Resource) (Resource, error)
- func (c *Mock) ReorderResource(ctx context.Context, pkgID string, resourceIDs []string) error
- func (c *Mock) SavePackage(ctx context.Context, pkg Package) (Package, error)
- func (c *Mock) SaveResource(ctx context.Context, resource Resource) (Resource, error)
- func (c *Mock) SearchPackageByName(ctx context.Context, name string) (List[Package], error)
- func (c *Mock) ShowPackage(ctx context.Context, id string) (Package, error)
- func (c *Mock) UploadResource(ctx context.Context, resource Resource, filename string, data []byte) (Resource, error)
- type Package
- type Resource
- type Response
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ckan ¶
type Ckan struct {
// contains filtered or unexported fields
}
func (*Ckan) CreatePackage ¶
func (*Ckan) CreateResource ¶
func (*Ckan) PatchPackage ¶
func (*Ckan) PatchResource ¶
func (*Ckan) ReorderResource ¶
func (*Ckan) SavePackage ¶
func (*Ckan) SaveResource ¶
func (*Ckan) SearchPackageByName ¶
func (*Ckan) ShowPackage ¶
type Interface ¶
type Interface interface { ShowPackage(ctx context.Context, id string) (Package, error) SearchPackageByName(ctx context.Context, name string) (List[Package], error) CreatePackage(ctx context.Context, pkg Package) (Package, error) PatchPackage(ctx context.Context, pkg Package) (Package, error) SavePackage(ctx context.Context, pkg Package) (Package, error) CreateResource(ctx context.Context, resource Resource) (Resource, error) PatchResource(ctx context.Context, resource Resource) (Resource, error) UploadResource(ctx context.Context, resource Resource, filename string, data []byte) (Resource, error) SaveResource(ctx context.Context, resource Resource) (Resource, error) ReorderResource(ctx context.Context, pkgID string, resourceIDs []string) error }
type List ¶
type Mock ¶
type Mock struct {
// contains filtered or unexported fields
}
func (*Mock) CreatePackage ¶
func (*Mock) CreateResource ¶
func (*Mock) PatchPackage ¶
func (*Mock) PatchResource ¶
func (*Mock) ReorderResource ¶
func (*Mock) SavePackage ¶
func (*Mock) SaveResource ¶
func (*Mock) SearchPackageByName ¶
func (*Mock) ShowPackage ¶
type Package ¶
type Package struct { ID string `json:"id,omitempty"` // The name of the new dataset, must be between 2 and 100 characters long and // contain only lowercase alphanumeric characters, - and _, e.g. 'warandpeace' Name string `json:"name,omitempty"` // The title of the dataset (optional, default: same as name) Title string `json:"title,omitempty"` // If True creates a private dataset Private *bool `json:"private,omitempty"` // The name of the dataset's author (optional) Author string `json:"author,omitempty"` // The email address of the dataset's author (optional) AuthorEmail string `json:"author_email,omitempty"` // The name of the dataset's maintainer (optional) Maintainer string `json:"maintainer,omitempty"` // The email address of the dataset's maintainer (optional) MaintainerEmail string `json:"maintainer_email,omitempty"` // The id of the dataset's license, see `~ckan.logic.action.get.license_list` for available values (optional) LicenseID string `json:"license_id,omitempty"` // A description of the dataset (optional) Notes string `json:"notes,omitempty"` // A URL for the dataset's source (optional) URL string `json:"url,omitempty"` // (optional) Version string `json:"version,omitempty"` // The current state of the dataset, e.g. 'active' or // 'deleted', only active datasets show up in search results and // other lists of datasets, this parameter will be ignored if you are not // authorized to change the state of the dataset (optional, default: // 'active') State string `json:"state,omitempty"` // The type of the dataset (optional), // `~ckan.plugins.interfaces.IDatasetForm` plugins // associate themselves with different dataset types and provide custom // dataset handling behaviour for these types Type string `json:"type,omitempty"` // The dataset's resources, see // `resource_create` for the format of resource dictionaries (optional) Resources []Resource `json:"resources,omitempty"` // The dataset's tags, see `tag_create` for the format // of tag dictionaries (optional) Tags []Tag `json:"tags,omitempty"` // The id of the dataset's owning organization, see // `~ckan.logic.action.get.organization_list` or // `~ckan.logic.action.get.organization_list_for_user` for // available values. This parameter can be made optional if the config // option `ckan.auth.create_unowned_dataset` is set to True. // Note: name is also available instead of ID on creating a package OwnerOrg string `json:"owner_org,omitempty"` // geospatialjp Restriction string `json:"restriction,omitempty"` LicenseAgreement string `json:"license_agreement,omitempty"` RegisterdDate string `json:"registerd_date,omitempty"` Fee string `json:"fee,omitempty"` Charge string `json:"charge,omitempty"` Area string `json:"area,omitempty"` Quality string `json:"quality,omitempty"` Emergency string `json:"emergency,omitempty"` LicenseTitle string `json:"license_title,omitempty"` ThumbnailURL string `json:"thumbnail_url,omitempty"` LicenseURL string `json:"license_url,omitempty"` Spatial string `json:"spatial,omitempty"` }
type Resource ¶
type Resource struct { ID string `json:"id,omitempty"` // id of package that the resource should be added to. PackageID string `json:"package_id,omitempty"` // url of resource URL string `json:"url,omitempty"` URLType string `json:"url_type,omitempty"` RevisionID string `json:"revision_id,omitempty"` Description string `json:"description,omitempty"` Format string `json:"format,omitempty"` Hash string `json:"hash,omitempty"` Name string `json:"name,omitempty"` ResourceType string `json:"resource_type,omitempty"` Mimetype string `json:"mimetype,omitempty"` MimetypeInner string `json:"mimetype_inner,omitempty"` CacheUrl string `json:"cache_url,omitempty"` Size int `json:"size,omitempty"` Created string `json:"created,omitempty"` LastModified string `json:"last_modified,omitempty"` CacheLastUpdated string `json:"cache_last_updated,omitempty"` }
Click to show internal directories.
Click to hide internal directories.