Documentation ¶
Overview ¶
Package blr provides support the HSDP Blob Repository services
Index ¶
- Constants
- Variables
- type AccessURL
- type Attachment
- type Blob
- type BlobPart
- type BlobPartUpload
- type BlobPolicy
- type BlobStorePolicy
- type BlobStorePolicyStatement
- type BlobsService
- func (b *BlobsService) AbortUpload(blob Blob) (bool, *Response, error)
- func (b *BlobsService) CompleteUpload(blob Blob, parts BlobPartUpload) (bool, *Response, error)
- func (b *BlobsService) Create(blob Blob) (*Blob, *Response, error)
- func (b *BlobsService) Delete(blob Blob) (bool, *Response, error)
- func (b *BlobsService) DeletePolicy(blob Blob) (bool, *Response, error)
- func (b *BlobsService) Find(opt *GetBlobOptions, options ...OptionFunc) (*[]Blob, *Response, error)
- func (b *BlobsService) GetAccessURL(blob Blob) (*AccessURL, *Response, error)
- func (b *BlobsService) GetByID(id string) (*Blob, *Response, error)
- func (b *BlobsService) GetPolicy(blob Blob) (*BlobPolicy, *Response, error)
- func (b *BlobsService) ListParts(blob Blob) (*BlobPartUpload, *Response, error)
- func (b *BlobsService) SetPolicy(blob Blob, policy BlobPolicy) (bool, *Response, error)
- type Bucket
- type Client
- func (c *Client) Close()
- func (c *Client) Do(req *http.Request, v interface{}) (*Response, error)
- func (c *Client) GetBaseURL() string
- func (c *Client) GetEndpointURL() string
- func (c *Client) NewRequest(method, requestPath string, opt interface{}, options ...OptionFunc) (*http.Request, error)
- func (c *Client) SetBaseURL(urlStr string) error
- type Config
- type ConfigurationsService
- func (b *ConfigurationsService) CreateBlobStorePolicy(policy BlobStorePolicy) (*BlobStorePolicy, *Response, error)
- func (b *ConfigurationsService) CreateBucket(bucket Bucket) (*Bucket, *Response, error)
- func (b *ConfigurationsService) DeleteBlobStorePolicy(policy BlobStorePolicy) (bool, *Response, error)
- func (b *ConfigurationsService) DeleteBucket(bucket Bucket) (bool, *Response, error)
- func (b *ConfigurationsService) FindBlobStorePolicy(opt *GetBlobStorePolicyOptions, options ...OptionFunc) (*[]BlobStorePolicy, *Response, error)
- func (b *ConfigurationsService) FindBucket(opt *GetBucketOptions, options ...OptionFunc) (*[]Bucket, *Response, error)
- func (b *ConfigurationsService) GetBlobStorePolicyByID(id string) (*BlobStorePolicy, *Response, error)
- func (b *ConfigurationsService) GetBucketByID(id string) (*Bucket, *Response, error)
- func (b *ConfigurationsService) UpdateBucket(bucket Bucket) (*Bucket, *Response, error)
- type CorsConfiguration
- type GetBlobOptions
- type GetBlobStorePolicyOptions
- type GetBucketOptions
- type Meta
- type OptionFunc
- type PartUpload
- type PolicyStatement
- type PrincipalResourceList
- type Reference
- type Response
- type Tag
Constants ¶
const (
APIVersion = "1"
)
Variables ¶
var ( ErrNotFound = errors.New("entity not found") ErrBaseURLCannotBeEmpty = errors.New("base URL cannot be empty") ErrEmptyResult = errors.New("empty result") ErrInvalidEndpointURL = errors.New("invalid endpoint URL") ErrMissingName = errors.New("missing name value") ErrMissingDescription = errors.New("missing description value") ErrMalformedInputValue = errors.New("malformed input value") ErrMissingOrganization = errors.New("missing organization") ErrMissingProposition = errors.New("missing proposition") ErrMissingGlobalReference = errors.New("missing global reference") ErrNotImplementedByHSDP = errors.New("method not implemented by HSDP") ErrEmptyResults = errors.New("empty results") ErrOperationFailed = errors.New("operation failed") ErrCouldNoReadResourceAfterCreate = errors.New("could not read resource after create") )
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct { ContentType string `json:"contentType,omitempty"` Language string `json:"language,omitempty"` Hash string `json:"hash,omitempty"` Title string `json:"title,omitempty"` Data string `json:"data" validate:"required"` URL string `json:"url"` Size int64 `json:"size"` Created string `json:"created,omitempty"` }
type Blob ¶
type Blob struct { ResourceType string `json:"resourceType" validate:"required"` ID string `json:"id,omitempty"` DataType string `json:"dataType" validate:"required"` Guid string `json:"guid,omitempty"` Tags *[]Tag `json:"tags,omitempty" validate:"omitempty,max=10"` AutoGenerateBlobPathName bool `json:"autoGenerateBlobPathName"` BlobPath string `json:"blobPath,omitempty" validate:"omitempty"` BlobName string `json:"blobName,omitempty" validate:"omitempty"` VirtualPath string `json:"virtualPath,omitempty" validate:"omitempty"` VirtualName string `json:"virtualName,omitempty" validate:"omitempty"` Bucket string `json:"bucket,omitempty"` Creation *string `json:"creation,omitempty"` CreatedBy string `json:"createdBy,omitempty"` Attachment *Attachment `json:"attachment,omitempty"` UploadOnBehalf bool `json:"uploadOnBehalf"` ManagingOrganization string `json:"managingOrganization,omitempty"` PropositionGuid string `json:"propositionGuid,omitempty"` MultipartEnabled bool `json:"multipartEnabled"` NoOfParts *int `json:"noOfParts,omitempty"` State *string `json:"state,omitempty"` Meta *Meta `json:"meta,omitempty"` }
type BlobPartUpload ¶
type BlobPartUpload struct { ResourceType string `json:"resourceType"` BlobParts []PartUpload `json:"blobParts"` }
type BlobPolicy ¶
type BlobPolicy struct { ResourceType string `json:"resourceType" validate:"required"` Statement []PolicyStatement `json:"statement" validate:"required"` }
type BlobStorePolicy ¶
type BlobStorePolicy struct { ResourceType string `json:"resourceType"` ID string `json:"id,omitempty"` Statement []BlobStorePolicyStatement `json:"statement"` }
type BlobsService ¶
type BlobsService struct { *Client // contains filtered or unexported fields }
func (*BlobsService) AbortUpload ¶
func (b *BlobsService) AbortUpload(blob Blob) (bool, *Response, error)
func (*BlobsService) CompleteUpload ¶
func (b *BlobsService) CompleteUpload(blob Blob, parts BlobPartUpload) (bool, *Response, error)
func (*BlobsService) DeletePolicy ¶
func (b *BlobsService) DeletePolicy(blob Blob) (bool, *Response, error)
func (*BlobsService) Find ¶
func (b *BlobsService) Find(opt *GetBlobOptions, options ...OptionFunc) (*[]Blob, *Response, error)
func (*BlobsService) GetAccessURL ¶
func (b *BlobsService) GetAccessURL(blob Blob) (*AccessURL, *Response, error)
func (*BlobsService) GetPolicy ¶
func (b *BlobsService) GetPolicy(blob Blob) (*BlobPolicy, *Response, error)
func (*BlobsService) ListParts ¶
func (b *BlobsService) ListParts(blob Blob) (*BlobPartUpload, *Response, error)
func (*BlobsService) SetPolicy ¶
func (b *BlobsService) SetPolicy(blob Blob, policy BlobPolicy) (bool, *Response, error)
type Bucket ¶
type Bucket struct { ResourceType string `json:"resourceType" validate:"required"` ID string `json:"id,omitempty"` Name string `json:"name" validate:"required"` EnableHSDPDomain bool `json:"enableHSDPDomain"` EnableCDN bool `json:"enableCDN"` PriceClass string `json:"priceClass,omitempty"` CacheControlAge int `json:"cacheControlAge,omitempty"` PropositionID Reference `json:"propositionId" validate:"required"` CorsConfiguration CorsConfiguration `json:"corsConfiguration"` EnableCreateOrDeleteBlobMeta bool `json:"enableCreateOrDeleteBlobMeta"` }
type Client ¶
type Client struct { // HTTP Client used to communicate with IAM API *iam.Client // User agent used when communicating with the HSDP Blob Repository API UserAgent string Blobs *BlobsService Configurations *ConfigurationsService // contains filtered or unexported fields }
A Client manages communication with HSDP Blob Repository APIs
func (*Client) Do ¶
Do performs a http request. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.
func (*Client) GetBaseURL ¶
GetBaseURL returns the base URL as configured
func (*Client) GetEndpointURL ¶
GetEndpointURL returns the Discovery Endpoint URL as configured
func (*Client) NewRequest ¶
func (*Client) SetBaseURL ¶
SetBaseURL sets the base URL for API requests
type ConfigurationsService ¶
type ConfigurationsService struct { *Client // contains filtered or unexported fields }
func (*ConfigurationsService) CreateBlobStorePolicy ¶
func (b *ConfigurationsService) CreateBlobStorePolicy(policy BlobStorePolicy) (*BlobStorePolicy, *Response, error)
func (*ConfigurationsService) CreateBucket ¶
func (b *ConfigurationsService) CreateBucket(bucket Bucket) (*Bucket, *Response, error)
func (*ConfigurationsService) DeleteBlobStorePolicy ¶
func (b *ConfigurationsService) DeleteBlobStorePolicy(policy BlobStorePolicy) (bool, *Response, error)
func (*ConfigurationsService) DeleteBucket ¶
func (b *ConfigurationsService) DeleteBucket(bucket Bucket) (bool, *Response, error)
func (*ConfigurationsService) FindBlobStorePolicy ¶
func (b *ConfigurationsService) FindBlobStorePolicy(opt *GetBlobStorePolicyOptions, options ...OptionFunc) (*[]BlobStorePolicy, *Response, error)
func (*ConfigurationsService) FindBucket ¶
func (b *ConfigurationsService) FindBucket(opt *GetBucketOptions, options ...OptionFunc) (*[]Bucket, *Response, error)
func (*ConfigurationsService) GetBlobStorePolicyByID ¶
func (b *ConfigurationsService) GetBlobStorePolicyByID(id string) (*BlobStorePolicy, *Response, error)
func (*ConfigurationsService) GetBucketByID ¶
func (b *ConfigurationsService) GetBucketByID(id string) (*Bucket, *Response, error)
func (*ConfigurationsService) UpdateBucket ¶
func (b *ConfigurationsService) UpdateBucket(bucket Bucket) (*Bucket, *Response, error)
UpdateBucket updates a bucket
type CorsConfiguration ¶
type GetBlobOptions ¶
type GetBlobOptions struct { HSDPID *string `url:"hsdpId,omitempty"` BlobName *string `url:"blobName,omitempty"` DataType *string `url:"dataType,omitempty"` GUID *string `url:"guid,omitempty"` DefaultRegionID *string `url:"defaultRegionId,omitempty"` LastUpdated *string `url:"_lastUpdated,omitempty"` StartDate *string `url:"startDate,omitempty"` EndDate *string `url:"endDate,omitempty"` Include *string `url:"_include,omitempty"` Page *string `url:"page,omitempty"` Count *int `url:"_count,omitempty"` SingleDownload *string `url:"singleDownload,omitempty"` }
type GetBlobStorePolicyOptions ¶
type GetBlobStorePolicyOptions struct {
ID *string `url:"_id,omitempty"`
}
type GetBucketOptions ¶
type GetBucketOptions struct { ID *string `url:"_id,omitempty"` Name *string `url:"name,omitempty"` PropositionID *string `url:"propositionId,omitempty"` Count *int `url:"_count,omitempty"` Page *int `url:"page,omitempty"` }
GetBucketOptions struct describes search criteria for looking up Bucket
type OptionFunc ¶
OptionFunc is the function signature function for options
type PartUpload ¶
type PolicyStatement ¶
type PolicyStatement struct { ResourceType string `json:"resourceType" validate:"required"` SID *string `json:"sid,omitempty"` Principal PrincipalResourceList `json:"principal" validate:"required"` Effect string `json:"effect" validate:"required"` Action []string `json:"action" validate:"required"` }
type PrincipalResourceList ¶
type PrincipalResourceList struct {
HSDP []string `json:"hsdp" validate:"required,min=1,max=64"`
}
type Response ¶
Response is a HSDP BLR API response. This wraps the standard http.Response returned from HSDP BLR and provides convenient access to things like errors