Documentation
¶
Index ¶
- type APIClient
- type AccessEnum
- type AppDetailsByToken
- type AppSchema
- type Assets
- func (c *Assets) CreateFolder(p CreateFolderXQuery) (map[string]interface{}, error)
- func (c *Assets) CreateSignedUrl(p CreateSignedUrlXQuery) (map[string]interface{}, error)
- func (c *Assets) DeleteFile(p DeleteFileXQuery) (map[string]interface{}, error)
- func (c *Assets) DeleteFiles(p DeleteFilesXQuery) (map[string]interface{}, error)
- func (c *Assets) DeleteFolder(p DeleteFolderXQuery) (map[string]interface{}, error)
- func (c *Assets) FileUpload(p FileUploadXQuery) (map[string]interface{}, error)
- func (c *Assets) GetFileByFileId(p GetFileByFileIdXQuery) (map[string]interface{}, error)
- func (c *Assets) GetFileById(p GetFileByIdXQuery) (map[string]interface{}, error)
- func (c *Assets) GetModule(p GetModuleXQuery) (map[string]interface{}, error)
- func (c *Assets) GetModules(p GetModulesXQuery) (map[string]interface{}, error)
- func (c *Assets) ListFiles(p ListFilesXQuery) (map[string]interface{}, error)
- func (c *Assets) UpdateFile(p UpdateFileXQuery) (map[string]interface{}, error)
- func (c *Assets) UpdateFolder(p UpdateFolderXQuery) (map[string]interface{}, error)
- func (c *Assets) UrlUpload(p UrlUploadXQuery) (map[string]interface{}, error)
- type CreateFolderRequest
- type CreateFolderXQuery
- type CreateSignedUrlXQuery
- type DeleteFileXQuery
- type DeleteFilesXQuery
- type DeleteFolderXQuery
- type DeleteMultipleFilesRequest
- type Delimiter
- type ErrorSchema
- type FileUploadRequest
- type FileUploadXQuery
- type FilesResponse
- type FoldersResponse
- type GetAppByTokenXQuery
- type GetFileByFileIdXQuery
- type GetFileByIdXQuery
- type GetModuleXQuery
- type GetModulesXQuery
- type ListFilesResponse
- type ListFilesXQuery
- type OAuthClient
- type Organization
- type OrganizationDetailSchema
- type PixelbinClient
- type PixelbinConfig
- type PresignedUrl
- type SignedUploadRequest
- type SignedUploadResponse
- type TransformationModuleResponse
- type TransformationModulesResponse
- type UpdateFileRequest
- type UpdateFileXQuery
- type UpdateFolderRequest
- type UpdateFolderXQuery
- type UploadResponse
- type UrlUploadRequest
- type UrlUploadXQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct {
Conf *PixelbinConfig
Method string
Url string
Query map[string]string
Body interface{}
ContentType string
}
APIClient holds raw data for api execution
type AccessEnum ¶
type AccessEnum string
AccessEnum used by Assets
const ( //PUBLIC_READ defines constant for the `public-read` PUBLIC_READ AccessEnum = "public-read" //PRIVATE defines constant for the `private` PRIVATE AccessEnum = "private" )
func (AccessEnum) IsValid ¶
func (ac AccessEnum) IsValid() error
IsValid return error if enum is invalid
type AppDetailsByToken ¶
type AppDetailsByToken struct {
App AppSchema `json:"app"`
Org OrganizationDetailSchema `json:"org"`
}
AppDetailsByToken used by Organization
type AppSchema ¶
type AppSchema struct {
ID float64 `json:"_id"`
OrgId float64 `json:"orgId"`
Name string `json:"name"`
Token string `json:"token"`
Permissions []string `json:"permissions"`
Active bool `json:"active"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
AppSchema used by Organization
type Assets ¶
type Assets struct {
// contains filtered or unexported fields
}
Assets holds Assets object properties
func NewAssets ¶
func NewAssets(config *PixelbinConfig) *Assets
NewAssets returns new Assets instance
func (*Assets) CreateFolder ¶
func (c *Assets) CreateFolder( p CreateFolderXQuery, ) (map[string]interface{}, error)
summary: Create folder
description: Create a new folder at the specified path. Also creates the ancestors if they do not exist.
params: CreateFolderXQuery
func (*Assets) CreateSignedUrl ¶
func (c *Assets) CreateSignedUrl( p CreateSignedUrlXQuery, ) (map[string]interface{}, error)
summary: S3 Signed URL upload
description: For the given asset details, a S3 signed URL will be generated, which can be then used to upload your asset.
params: CreateSignedUrlXQuery
func (*Assets) DeleteFile ¶
func (c *Assets) DeleteFile( p DeleteFileXQuery, ) (map[string]interface{}, error)
summary: Delete file
description:
params: DeleteFileXQuery
func (*Assets) DeleteFiles ¶
func (c *Assets) DeleteFiles( p DeleteFilesXQuery, ) (map[string]interface{}, error)
summary: Delete multiple files
description:
params: DeleteFilesXQuery
func (*Assets) DeleteFolder ¶
func (c *Assets) DeleteFolder( p DeleteFolderXQuery, ) (map[string]interface{}, error)
summary: Delete folder
description: Delete folder and all its children permanently.
params: DeleteFolderXQuery
func (*Assets) FileUpload ¶
func (c *Assets) FileUpload( p FileUploadXQuery, ) (map[string]interface{}, error)
summary: Upload File
description: Upload File to Pixelbin
params: FileUploadXQuery
func (*Assets) GetFileByFileId ¶
func (c *Assets) GetFileByFileId( p GetFileByFileIdXQuery, ) (map[string]interface{}, error)
summary: Get file details with fileId
description:
params: GetFileByFileIdXQuery
func (*Assets) GetFileById ¶
func (c *Assets) GetFileById( p GetFileByIdXQuery, ) (map[string]interface{}, error)
summary: Get file details with _id
description:
params: GetFileByIdXQuery
func (*Assets) GetModule ¶
func (c *Assets) GetModule( p GetModuleXQuery, ) (map[string]interface{}, error)
summary: Get Transformation Module by module identifier
description: Get Transformation Module by module identifier
params: GetModuleXQuery
func (*Assets) GetModules ¶
func (c *Assets) GetModules( p GetModulesXQuery, ) (map[string]interface{}, error)
summary: Get all transformation modules
description: Get all transformation modules.
params: GetModulesXQuery
func (*Assets) ListFiles ¶
func (c *Assets) ListFiles( p ListFilesXQuery, ) (map[string]interface{}, error)
summary: List and search files and folders.
description: List all files and folders in root folder. Search for files if name is provided. If path is provided, search in the specified path.
params: ListFilesXQuery
func (*Assets) UpdateFile ¶
func (c *Assets) UpdateFile( p UpdateFileXQuery, ) (map[string]interface{}, error)
summary: Update file details
description:
params: UpdateFileXQuery
func (*Assets) UpdateFolder ¶
func (c *Assets) UpdateFolder( p UpdateFolderXQuery, ) (map[string]interface{}, error)
summary: Update folder details
description: Update folder details. Eg: Soft delete it by making `isActive` as `false`. We currently do not support updating folder name or path.
params: UpdateFolderXQuery
type CreateFolderRequest ¶
CreateFolderRequest used by Assets
type CreateFolderXQuery ¶
type CreateSignedUrlXQuery ¶
type CreateSignedUrlXQuery struct {
Name string `json:"name,omitempty"`
Path string `json:"path,omitempty"`
Format string `json:"format,omitempty"`
Access AccessEnum `json:"access,omitempty"`
Tags []string `json:"tags,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
Overwrite bool `json:"overwrite,omitempty"`
FilenameOverride bool `json:"filenameOverride,omitempty"`
}
type DeleteFileXQuery ¶
type DeleteFileXQuery struct {
FileId string `json:"fileId,omitempty"`
}
type DeleteFilesXQuery ¶
type DeleteFilesXQuery struct {
Ids []string `json:"ids,omitempty"`
}
type DeleteFolderXQuery ¶
type DeleteFolderXQuery struct {
ID string `json:"_id,omitempty"`
}
type DeleteMultipleFilesRequest ¶
type DeleteMultipleFilesRequest struct {
Ids []string `json:"ids"`
}
DeleteMultipleFilesRequest used by Assets
type Delimiter ¶
type Delimiter struct {
OperationSeparator string `json:"operationSeparator"`
ParameterSeparator string `json:"parameterSeparator"`
}
Delimiter used by Assets
type ErrorSchema ¶
type ErrorSchema struct {
Message string `json:"message"`
}
ErrorSchema used by Organization
type FileUploadRequest ¶
type FileUploadRequest struct {
File *os.File `json:"file"`
Path string `json:"path"`
Name string `json:"name"`
Access AccessEnum `json:"access"`
Tags []string `json:"tags"`
Metadata map[string]interface{} `json:"metadata"`
Overwrite bool `json:"overwrite"`
FilenameOverride bool `json:"filenameOverride"`
}
FileUploadRequest used by Assets
type FileUploadXQuery ¶
type FileUploadXQuery struct {
File *os.File `json:"file,omitempty"`
Path string `json:"path,omitempty"`
Name string `json:"name,omitempty"`
Access AccessEnum `json:"access,omitempty"`
Tags []string `json:"tags,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
Overwrite bool `json:"overwrite,omitempty"`
FilenameOverride bool `json:"filenameOverride,omitempty"`
}
type FilesResponse ¶
type FilesResponse struct {
ID string `json:"_id"`
Name string `json:"name"`
Path string `json:"path"`
FileId string `json:"fileId"`
Format string `json:"format"`
Size float64 `json:"size"`
Access string `json:"access"`
IsActive bool `json:"isActive"`
Tags []string `json:"tags"`
Metadata map[string]interface{} `json:"metadata"`
URL string `json:"url"`
Thumbnail string `json:"thumbnail"`
}
FilesResponse used by Assets
type FoldersResponse ¶
type FoldersResponse struct {
ID string `json:"_id"`
Name string `json:"name"`
Path string `json:"path"`
IsActive bool `json:"isActive"`
}
FoldersResponse used by Assets
type GetAppByTokenXQuery ¶
type GetAppByTokenXQuery struct {
Token string `json:"token,omitempty"`
}
type GetFileByFileIdXQuery ¶
type GetFileByFileIdXQuery struct {
FileId string `json:"fileId,omitempty"`
}
type GetFileByIdXQuery ¶
type GetFileByIdXQuery struct {
ID string `json:"_id,omitempty"`
}
type GetModuleXQuery ¶
type GetModuleXQuery struct {
Identifier string `json:"identifier,omitempty"`
}
type GetModulesXQuery ¶
type GetModulesXQuery struct {
}
type ListFilesResponse ¶
type ListFilesResponse struct {
Items []exploreItem `json:"items"`
Page page `json:"page"`
}
ListFilesResponse used by Assets
type ListFilesXQuery ¶
type ListFilesXQuery struct {
Name string `json:"name,omitempty"`
Path string `json:"path,omitempty"`
Format string `json:"format,omitempty"`
Tags []interface{} `json:"tags,omitempty"`
OnlyFiles bool `json:"onlyFiles,omitempty"`
OnlyFolders bool `json:"onlyFolders,omitempty"`
PageNo float64 `json:"pageNo,omitempty"`
PageSize float64 `json:"pageSize,omitempty"`
Sort string `json:"sort,omitempty"`
}
type OAuthClient ¶
type OAuthClient struct {
Config *PixelbinConfig
Token string
}
OAuthClient holds OAuth Client details
func NewOAuthClient ¶
func NewOAuthClient(config *PixelbinConfig) *OAuthClient
NewOAuthClient return OAuthClient instance
func (*OAuthClient) GetAccessToken ¶
func (o *OAuthClient) GetAccessToken() string
GetAccessToken returns the access token
type Organization ¶
type Organization struct {
// contains filtered or unexported fields
}
Organization holds Organization object properties
func NewOrganization ¶
func NewOrganization(config *PixelbinConfig) *Organization
NewOrganization returns new Organization instance
func (*Organization) GetAppByToken ¶
func (c *Organization) GetAppByToken( p GetAppByTokenXQuery, ) (map[string]interface{}, error)
summary: Get App Details
description: Get App and org details with the API_TOKEN
params: GetAppByTokenXQuery
type OrganizationDetailSchema ¶
type OrganizationDetailSchema struct {
ID float64 `json:"_id"`
Name string `json:"name"`
CloudName string `json:"cloudName"`
OwnerId string `json:"ownerId"`
Active bool `json:"active"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
OrganizationDetailSchema used by Organization
type PixelbinClient ¶
type PixelbinClient struct {
Config *PixelbinConfig
Assets *Assets
Organization *Organization
}
PixelbinClient holds all the PixelbinConfig object properties
func NewPixelbinClient ¶
func NewPixelbinClient(config *PixelbinConfig) *PixelbinClient
NewPixelbinClient returns pixelbin service instances
type PixelbinConfig ¶
type PixelbinConfig struct {
ApiSecret string
Domain string
OAuthClient *OAuthClient
}
PixelbinConfig provides configuration to a service client instance.
func NewPixelbinConfig ¶
func NewPixelbinConfig(apiSecret, domain string) *PixelbinConfig
NewPixelbinConfig provides pixelbin configuration
func (*PixelbinConfig) GetAccessToken ¶
func (p *PixelbinConfig) GetAccessToken() string
GetAccessToken returns the access token
func (*PixelbinConfig) SetOAuthClient ¶
func (p *PixelbinConfig) SetOAuthClient()
SetOAuthClient sets OAuthClient into pixelbin configuration
type PresignedUrl ¶
PresignedUrl used by Assets
type SignedUploadRequest ¶
type SignedUploadRequest struct {
Name string `json:"name"`
Path string `json:"path"`
Format string `json:"format"`
Access AccessEnum `json:"access"`
Tags []string `json:"tags"`
Metadata map[string]interface{} `json:"metadata"`
Overwrite bool `json:"overwrite"`
FilenameOverride bool `json:"filenameOverride"`
}
SignedUploadRequest used by Assets
type SignedUploadResponse ¶
type SignedUploadResponse struct {
S3PresignedUrl PresignedUrl `json:"s3PresignedUrl"`
}
SignedUploadResponse used by Assets
type TransformationModuleResponse ¶
type TransformationModuleResponse struct {
Identifier string `json:"identifier"`
Name string `json:"name"`
Description string `json:"description"`
Credentials map[string]interface{} `json:"credentials"`
Operations []interface{} `json:"operations"`
Enabled bool `json:"enabled"`
}
TransformationModuleResponse used by Assets
type TransformationModulesResponse ¶
type TransformationModulesResponse struct {
Delimiters Delimiter `json:"delimiters"`
Plugins map[string]TransformationModuleResponse `json:"plugins"`
Presets []interface{} `json:"presets"`
}
TransformationModulesResponse used by Assets
type UpdateFileRequest ¶
type UpdateFileRequest struct {
Name string `json:"name"`
Path string `json:"path"`
Access string `json:"access"`
IsActive bool `json:"isActive"`
Tags []string `json:"tags"`
Metadata map[string]interface{} `json:"metadata"`
}
UpdateFileRequest used by Assets
type UpdateFileXQuery ¶
type UpdateFileXQuery struct {
FileId string `json:"fileId,omitempty"`
Name string `json:"name,omitempty"`
Path string `json:"path,omitempty"`
Access string `json:"access,omitempty"`
IsActive bool `json:"isActive,omitempty"`
Tags []string `json:"tags,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
type UpdateFolderRequest ¶
type UpdateFolderRequest struct {
IsActive bool `json:"isActive"`
}
UpdateFolderRequest used by Assets
type UpdateFolderXQuery ¶
type UploadResponse ¶
type UploadResponse struct {
ID string `json:"_id"`
FileId string `json:"fileId"`
Name string `json:"name"`
Path string `json:"path"`
Format string `json:"format"`
Size float64 `json:"size"`
Access string `json:"access"`
Tags []string `json:"tags"`
Metadata map[string]interface{} `json:"metadata"`
URL string `json:"url"`
Thumbnail string `json:"thumbnail"`
}
UploadResponse used by Assets
type UrlUploadRequest ¶
type UrlUploadRequest struct {
URL string `json:"url"`
Path string `json:"path"`
Name string `json:"name"`
Access AccessEnum `json:"access"`
Tags []string `json:"tags"`
Metadata map[string]interface{} `json:"metadata"`
Overwrite bool `json:"overwrite"`
FilenameOverride bool `json:"filenameOverride"`
}
UrlUploadRequest used by Assets
type UrlUploadXQuery ¶
type UrlUploadXQuery struct {
URL string `json:"url,omitempty"`
Path string `json:"path,omitempty"`
Name string `json:"name,omitempty"`
Access AccessEnum `json:"access,omitempty"`
Tags []string `json:"tags,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
Overwrite bool `json:"overwrite,omitempty"`
FilenameOverride bool `json:"filenameOverride,omitempty"`
}