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 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 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 GetBlobOptions
- type Meta
- type OptionFunc
- type PartUpload
- type PolicyStatement
- type PrincipalResourceList
- type Response
- type Tag
Constants ¶
View Source
const (
APIVersion = "1"
)
Variables ¶
View Source
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 ¶ added in v0.64.0
type BlobPartUpload struct { ResourceType string `json:"resourceType"` BlobParts []PartUpload `json:"blobParts"` }
type BlobPolicy ¶ added in v0.64.0
type BlobPolicy struct { ResourceType string `json:"resourceType" validate:"required"` Statement []PolicyStatement `json:"statement" validate:"required"` }
type BlobsService ¶
type BlobsService struct { *Client // contains filtered or unexported fields }
func (*BlobsService) AbortUpload ¶ added in v0.64.0
func (b *BlobsService) AbortUpload(blob Blob) (bool, *Response, error)
func (*BlobsService) CompleteUpload ¶ added in v0.64.0
func (b *BlobsService) CompleteUpload(blob Blob, parts BlobPartUpload) (bool, *Response, error)
func (*BlobsService) DeletePolicy ¶ added in v0.64.0
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 ¶ added in v0.64.0
func (b *BlobsService) GetAccessURL(blob Blob) (*AccessURL, *Response, error)
func (*BlobsService) GetPolicy ¶ added in v0.64.0
func (b *BlobsService) GetPolicy(blob Blob) (*BlobPolicy, *Response, error)
func (*BlobsService) ListParts ¶ added in v0.64.0
func (b *BlobsService) ListParts(blob Blob) (*BlobPartUpload, *Response, error)
func (*BlobsService) SetPolicy ¶ added in v0.64.0
func (b *BlobsService) SetPolicy(blob Blob, policy BlobPolicy) (bool, *Response, error)
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 // 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 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 OptionFunc ¶
OptionFunc is the function signature function for options
type PartUpload ¶ added in v0.64.0
type PolicyStatement ¶ added in v0.64.0
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 ¶ added in v0.64.0
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
func (*Response) StatusCode ¶ added in v0.73.0
Click to show internal directories.
Click to hide internal directories.