common

package
Version: v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxPaginationLimit      = 1000
	DefaultPaginationLimit  = MaxPaginationLimit
	DefaultPaginationOffset = 0
	MaxObjectSize           = 5 * 1024 * 1024 * 1024 // 5GB
	SortDirectionAsc        = "asc"
	SortDirectionDesc       = "desc"
)
View Source
const (
	KLimit        = "limit"
	KOffset       = "offset"
	KSort         = "sort"
	KLastModified = "lastmodified"
	KObjKey       = "objkey"
	KStorageTier  = "tier"
	KPrefix       = "prefix"
	KMarker       = "marker"
	KDelimiter    = "delimiter"
	KVerMarker    = "verMarker"
)
View Source
const (
	CTX_KEY_TENANT_ID   = "Tenantid"
	CTX_KEY_USER_ID     = "Userid"
	CTX_KEY_IS_ADMIN    = "Isadmin"
	CTX_VAL_TRUE        = "true"
	CTX_KEY_OBJECT_KEY  = "ObjectKey"
	CTX_KEY_BUCKET_NAME = "BucketName"
	CTX_KEY_SIZE        = "ObjectSize"
	CTX_KEY_LOCATION    = "Location"
)
View Source
const (
	REQUEST_PATH_BUCKET_NAME      = "bucketName"
	REQUEST_PATH_OBJECT_KEY       = "objectKey"
	REQUEST_HEADER_CONTENT_LENGTH = "Content-Length"
	REQUEST_HEADER_STORAGE_CLASS  = "x-amz-storage-class"
	REQUEST_HEADER_COPY_SOURCE    = "X-Amz-Copy-Source"
	REQUEST_HEADER_ACL            = "X-Amz-Acl"
	REQUEST_HEADER_CONTENT_MD5    = "Content-Md5"
)

Variables

This section is empty.

Functions

func GetFilter

func GetFilter(request *restful.Request, filterOpts []string) (map[string]string, error)

func GetPaginationParam

func GetPaginationParam(request *restful.Request) (int32, int32, error)

func GetSortParam

func GetSortParam(request *restful.Request) (sortKeys []string, sortDirs []string, err error)

An example of sort key parameter will be like this: sort=key1:asc,key2:desc

func InitCtxWithAuthInfo added in v0.6.3

func InitCtxWithAuthInfo(request *restful.Request) context.Context

func InitCtxWithVal added in v0.6.3

func InitCtxWithVal(request *restful.Request, md map[string]string) context.Context

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL