Documentation ¶
Index ¶
- func Parse(url *url.URL, mortConfig *config.Config, obj *FileObject) error
- func RegisterParser(kind string, fn ParseFnc)
- type FileObject
- func (o *FileObject) AppendToKey(str string)
- func (o *FileObject) Copy() *FileObject
- func (o *FileObject) FillWithRequest(req *http.Request, ctx context.Context)
- func (o *FileObject) GetResponseCacheKey() string
- func (o *FileObject) HasParent() bool
- func (o *FileObject) HasTransform() bool
- func (obj *FileObject) LogData(fields ...zapcore.Field) []zapcore.Field
- func (o *FileObject) Type() string
- type ParseFnc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
Parse pare given url using appropriate parser it set object Key, Bucket, Parent and transforms
func RegisterParser ¶
RegisterParser add new kind of function to map of decoders and for config validator
Types ¶
type FileObject ¶
type FileObject struct { Uri *url.URL `json:"uri"` // original request path Bucket string `json:"bucket"` // request matched bucket Key string `json:"key"` // storage path for file with leading slash Transforms transforms.Transforms `json:"transforms"` // list of transform that should be performed Storage config.Storage `json:"storage"` // selected storage that should be used Parent *FileObject // original image for transformed image CheckParent bool // boolean if we should always check if parent exists AllowChangeKey bool // parser can allow or not changing key by this flag Debug bool // flag for debug requests Ctx context.Context // context of request Range string // HTTP range in request // contains filtered or unexported fields }
FileObject is representing parsed request for image or file
func NewFileErrorObject ¶ added in v0.13.0
func NewFileErrorObject(parent string, erroredObject *FileObject) (*FileObject, error)
func NewFileObject ¶
NewFileObject create new instance of FileObject uri is request URL mortConfig should be pointer to current buckets config
func NewFileObjectFromPath ¶
func NewFileObjectFromPath(path string, mortConfig *config.Config) (*FileObject, error)
NewFileObjectFromPath create new instance of FileObject path should be request path mortConfig should be pointer to current buckets config
func (*FileObject) AppendToKey ¶ added in v0.15.0
func (o *FileObject) AppendToKey(str string)
AppendToKey add string to key
func (*FileObject) Copy ¶ added in v0.15.0
func (o *FileObject) Copy() *FileObject
func (*FileObject) FillWithRequest ¶ added in v0.13.0
func (o *FileObject) FillWithRequest(req *http.Request, ctx context.Context)
FillWithRequest assign to object request and HTTP range data
func (*FileObject) GetResponseCacheKey ¶ added in v0.13.0
func (o *FileObject) GetResponseCacheKey() string
func (*FileObject) HasParent ¶
func (o *FileObject) HasParent() bool
HasParent inform if object has parent
func (*FileObject) HasTransform ¶
func (o *FileObject) HasTransform() bool
HasTransform inform if object has transform
func (*FileObject) LogData ¶ added in v0.13.0
func (obj *FileObject) LogData(fields ...zapcore.Field) []zapcore.Field
LogData log data for given object
func (*FileObject) Type ¶ added in v0.13.0
func (o *FileObject) Type() string
Type returns type of object "parent" or "transform"