Documentation
¶
Overview ¶
Package cloudinary provides an interface to the Cloudinary DAM
Index ¶
- func NewFs(ctx context.Context, name string, root string, m configmap.Mapper) (fs.Fs, error)
- type Fs
- func (f *Fs) Features() *fs.Features
- func (f *Fs) FromStandardFullPath(dir string) string
- func (f *Fs) FromStandardName(s string) string
- func (f *Fs) FromStandardPath(s string) string
- func (f *Fs) Hashes() hash.Set
- func (f *Fs) List(ctx context.Context, dir string) (fs.DirEntries, error)
- func (f *Fs) Mkdir(ctx context.Context, dir string) error
- func (f *Fs) Name() string
- func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error)
- func (f *Fs) Precision() time.Duration
- func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
- func (f *Fs) Rmdir(ctx context.Context, dir string) error
- func (f *Fs) Root() string
- func (f *Fs) String() string
- func (f *Fs) ToAssetFolderAPI(dir string) string
- func (f *Fs) ToDisplayNameElastic(dir string) string
- func (f *Fs) ToStandardName(s string) string
- func (f *Fs) ToStandardPath(s string) string
- func (f *Fs) WaitEventuallyConsistent()
- type Object
- func (o *Object) Fs() fs.Info
- func (o *Object) Hash(ctx context.Context, ty hash.Type) (string, error)
- func (o *Object) ModTime(ctx context.Context) time.Time
- func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.ReadCloser, err error)
- func (o *Object) Remote() string
- func (o *Object) Remove(ctx context.Context) error
- func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error
- func (o *Object) Size() int64
- func (o *Object) Storable() bool
- func (o *Object) String() string
- func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Fs ¶
type Fs struct {
// contains filtered or unexported fields
}
Fs represents a remote cloudinary server
func (*Fs) FromStandardFullPath ¶
FromStandardFullPath encodes a full path to Cloudinary standard
func (*Fs) FromStandardName ¶
FromStandardName implementation of the api.CloudinaryEncoder
func (*Fs) FromStandardPath ¶
FromStandardPath implementation of the api.CloudinaryEncoder
func (*Fs) NewObject ¶
NewObject finds the Object at remote. If it can't be found it returns the error fs.ErrorObjectNotFound.
func (*Fs) Put ¶
func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
Put uploads content to Cloudinary
func (*Fs) ToAssetFolderAPI ¶
ToAssetFolderAPI encodes folders as expected by the Cloudinary SDK
func (*Fs) ToDisplayNameElastic ¶
ToDisplayNameElastic encodes a special case of elasticsearch
func (*Fs) ToStandardName ¶
ToStandardName implementation of the api.CloudinaryEncoder
func (*Fs) ToStandardPath ¶
ToStandardPath implementation of the api.CloudinaryEncoder
func (*Fs) WaitEventuallyConsistent ¶
func (f *Fs) WaitEventuallyConsistent()
WaitEventuallyConsistent waits till the FS is eventually consistent
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
Object describes a cloudinary object
func (*Object) Open ¶
func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.ReadCloser, err error)
Open an object for read
func (*Object) SetModTime ¶
SetModTime sets the modification time of the local fs object
type Options ¶
type Options struct { CloudName string `config:"cloud_name"` APIKey string `config:"api_key"` APISecret string `config:"api_secret"` UploadPrefix string `config:"upload_prefix"` UploadPreset string `config:"upload_preset"` Enc encoder.MultiEncoder `config:"encoding"` EventuallyConsistentDelay fs.Duration `config:"eventually_consistent_delay"` }
Options defines the configuration for this backend