Documentation ¶
Overview ¶
Code generated by go generate cmd/definitions; DO NOT EDIT.
Index ¶
- Constants
- Variables
- func GenerateInfo(path string)
- func GenerateIterator(path string)
- func GenerateNamespace(path string)
- func GenerateObject(path string)
- func GenerateOperation(path string)
- func GeneratePair(path string)
- func GenerateService(data Metadata, path string)
- type Feature
- type Field
- type Info
- type Metadata
- type Namespace
- type Operation
- type Pair
- type Service
- type Storage
- type Type
Constants ¶
View Source
const ( NamespaceFactory = "factory" NamespaceService = "service" NamespaceStorage = "storage" NamespaceObject = "object" )
View Source
const ( FeatureTypeOperation = "operation" FeatureTypeSystem = "system" FeatureTypeVirtual = "virtual" )
View Source
const (
CategoryMeta = "meta"
)
Variables ¶
View Source
var FeaturesService = append([]Feature{ { Name: "loose_pair", Type: FeatureTypeVirtual, Description: `loose_pair feature is designed for users who don't want strict pair checks. If this feature is enabled, the service will not return an error for not support pairs. This feature was introduced in GSP-109.`, }, }, buildOperationFeatures(OperationsService)...)
View Source
var FeaturesStorage = append([]Feature{ { Name: "loose_pair", Type: FeatureTypeVirtual, Description: `loose_pair feature is designed for users who don't want strict pair checks. If this feature is enabled, the service will not return an error for not support pairs. This feature was introduced in GSP-109.`, }, { Name: "virtual_dir", Type: FeatureTypeVirtual, Description: `virtual_dir feature is designed for a service that doesn't have native dir support but wants to provide simulated operations. - If this feature is disabled (the default behavior), the service will behave like it doesn't have any dir support. - If this feature is enabled, the service will support simulated dir behavior in create_dir, create, list, delete, and so on. This feature was introduced in GSP-109.`, }, { Name: "virtual_link", Type: FeatureTypeVirtual, Description: `virtual_link feature is designed for a service that doesn't have native support for link. - If this feature is enabled, the service will run compatible mode: create link via native methods, but allow read link from old-style link object. - If this feature is not enabled, the service will run in native as other service. This feature was introduced in GSP-86.`, }, { Name: "virtual_object_metadata", Type: FeatureTypeVirtual, Description: `virtual_object_metadata feature is designed for a service that doesn't have native object metadata support but wants to provide simulated operations. - If this feature is disabled (the default behavior), the service will behave like it doesn't have any object metadata support. - If this feature is enabled, the service will support simulated object metadata behavior in the list, stat, and so on. This feature was introduced in GSP-109.`, }, { Name: "write_empty_object", Type: FeatureTypeSystem, Description: `write_empty_object feature is designed for a service that support write empty object. This behavior was defined in GSP-751 and classified as an operation-related feature in GSP-837.`, }, }, buildOperationFeatures(OperationsStorage)...)
View Source
var InfosObjectMetaArray = []Info{ { Name: "append_offset", Type: Type{Name: "int64"}, Description: "AppendOffset is the offset of the append object.", }, { Name: "content_disposition", Type: Type{Name: "string"}, }, { Name: "content_length", Type: Type{Name: "int64"}, }, { Name: "content_md5", Type: Type{Name: "string"}, }, { Name: "content_type", Type: Type{Name: "string"}, }, { Name: "etag", Type: Type{Name: "string"}, }, { Name: "id", Type: Type{Name: "string"}, Description: `ID is the unique key in storage. ID SHOULD be an absolute path compatible with the target operating system-defined file paths, or a unique identifier specified by service.`, // contains filtered or unexported fields }, { Name: "last_modified", Type: Type{Package: "time", Name: "Time"}, }, { Name: "link_target", Type: Type{Name: "string"}, Description: "LinkTarget is the symlink target for link object.", }, { Name: "mode", Type: Type{Package: "types", Name: "ObjectMode"}, // contains filtered or unexported fields }, { Name: "multipart_id", Type: Type{Name: "string"}, Description: "MultipartID is the part id of part object.", }, { Name: "path", Type: Type{Name: "string"}, Description: `Path is either the absolute path or the relative path towards storage's WorkDir depends on user's input. Path SHOULD be Unix style.`, // contains filtered or unexported fields }, { Name: "system_metadata", Type: Type{Name: "interface{}"}, Description: "SystemMetadata stores system defined metadata.", }, { Name: "user_metadata", Type: Type{Name: "map[string]string"}, Description: "UserMetadata stores user defined metadata.", }, }
View Source
var InfosStorageMetaArray = []Info{ { Name: "append_number_maximum", Type: Type{Name: "int"}, Description: "Max append numbers in append operation.", }, { Name: "append_size_maximum", Type: Type{Name: "int64"}, Description: "Max append size in append operation.", }, { Name: "append_total_size_maximum", Type: Type{Name: "int64"}, Description: "Max append total size in append operation.", }, { Name: "copy_size_maximum", Type: Type{Name: "int64"}, Description: "Maximum size for copy operation.", }, { Name: "fetch_size_maximum", Type: Type{Name: "int64"}, Description: "Maximum size for fetch operation.", }, { Name: "location", Type: Type{Name: "string"}, }, { Name: "move_size_maximum", Type: Type{Name: "int64"}, Description: "Maximum size for move operation.", }, { Name: "multipart_number_maximum", Type: Type{Name: "int"}, Description: "Maximum part number in multipart operation.", }, { Name: "multipart_size_maximum", Type: Type{Name: "int64"}, Description: "Maximum part size in multipart operation.", }, { Name: "multipart_size_minimum", Type: Type{Name: "int64"}, Description: "Minimum part size in multipart operation.", }, { Name: "name", Type: Type{Name: "string"}, // contains filtered or unexported fields }, { Name: "system_metadata", Type: Type{Name: "interface{}"}, Description: "SystemMetadata stores system defined metadata.", }, { Name: "work_dir", Type: Type{Name: "string"}, // contains filtered or unexported fields }, { Name: "write_size_maximum", Type: Type{Name: "int64"}, Description: "Maximum size for write operation.", }, { Name: "service", Type: Type{Name: "string"}, Description: "Service name.", // contains filtered or unexported fields }, }
View Source
var OperationsService = []Operation{ { Name: "create", Namespace: NamespaceService, Params: []Field{ getField("name"), }, Results: []Field{ getField("store"), }, Description: "will create a new storager instance.", }, { Name: "delete", Namespace: NamespaceService, Params: []Field{ getField("name"), }, Description: "will delete a storager instance.", }, { Name: "get", Namespace: NamespaceService, Params: []Field{ getField("name"), }, Results: []Field{ getField("store"), }, Description: "will get a valid storager instance for service.", }, { Name: "list", Namespace: NamespaceService, Results: []Field{ getField("sti"), }, Description: "will list all storager instances under this service.", }, }
View Source
var OperationsServiceMap = make(map[string]Operation)
View Source
var OperationsStorage = []Operation{ { Name: "create", Namespace: NamespaceStorage, Local: true, Params: []Field{ getField("path"), }, Results: []Field{ getField("o"), }, Pairs: []Pair{ PairObjectMode, }, Description: `will create a new object without any api call. ## Behavior - Create SHOULD NOT send any API call. - Create SHOULD accept ObjectMode pair as object mode.`, }, { Name: "delete", Namespace: NamespaceStorage, Params: []Field{ getField("path"), }, Pairs: []Pair{ PairObjectMode, }, Description: `will delete an object from service. ## Behavior - Delete only delete one and only one object. - Service DON'T NEED to support remove all. - User NEED to implement remove_all by themself. - Delete is idempotent. - Successful delete always return nil error. - Delete SHOULD never return ObjectNotExist - Delete DON'T NEED to check the object exist or not.`, }, { Name: "metadata", Namespace: NamespaceStorage, Local: true, Results: []Field{ getField("meta"), }, Description: `will return current storager metadata.`, }, { Name: "list", Namespace: NamespaceStorage, Params: []Field{ getField("path"), }, Results: []Field{ getField("oi"), }, Pairs: []Pair{ PairListMode, }, Description: `will return list a specific path. ## Behavior - Service SHOULD support default ListMode. - Service SHOULD implement ListModeDir without the check for VirtualDir. - Service DON'T NEED to Stat while in List.`, }, { Name: "read", Namespace: NamespaceStorage, Params: []Field{ getField("path"), getField("w"), }, Results: []Field{ getField("n"), }, Pairs: []Pair{ PairSize, PairOffset, PairIoCallback, }, Description: `will read the file's data.`, }, { Name: "stat", Namespace: NamespaceStorage, Params: []Field{ getField("path"), }, Results: []Field{ getField("o"), }, Pairs: []Pair{ PairObjectMode, }, Description: `will stat a path to get info of an object. ## Behavior - Stat SHOULD accept ObjectMode pair as hints. - Service COULD have different implementations for different object mode. - Service SHOULD check if returning ObjectMode is match`, }, { Name: "write", Namespace: NamespaceStorage, Params: []Field{ getField("path"), getField("r"), getField("size"), }, Results: []Field{ getField("n"), }, Pairs: []Pair{ PairIoCallback, }, Description: `will write data into a file. ## Behavior - Write SHOULD support users pass nil io.Reader. - Service that has native support for pass nil io.Reader doesn't NEED to check the io.Reader is nil or not. - Service that doesn't have native support for pass nil io.Reader SHOULD check and create an empty io.Reader if it is nil. - Write SHOULD NOT return an error as the object exist. - Service that has native support for overwrite doesn't NEED to check the object exists or not. - Service that doesn't have native support for overwrite SHOULD check and delete the object if exists. - A successful write operation SHOULD be complete, which means the object's content and metadata should be the same as specified in write request. `, }, { Name: "create_append", Namespace: NamespaceStorage, Params: []Field{ getField("path"), }, Results: []Field{ getField("o"), }, Pairs: []Pair{}, Description: `will create an append object. ## Behavior - CreateAppend SHOULD create an appendable object with position 0 and size 0. - CreateAppend SHOULD NOT return an error as the object exist. - Service SHOULD check and delete the object if exists.`, }, { Name: "write_append", Namespace: NamespaceStorage, Params: []Field{ getField("o"), getField("r"), getField("size"), }, Results: []Field{ getField("n"), }, Description: `will append content to an append object.`, }, { Name: "commit_append", Namespace: NamespaceStorage, Params: []Field{ getField("o"), }, Description: `will commit and finish an append process.`, }, { Name: "create_block", Namespace: NamespaceStorage, Params: []Field{ getField("path"), }, Results: []Field{ getField("o"), }, Description: `will create a new block object. ## Behavior - CreateBlock SHOULD NOT return an error as the object exist. - Service that has native support for overwrite doesn't NEED to check the object exists or not. - Service that doesn't have native support for overwrite SHOULD check and delete the object if exists.`, }, { Name: "write_block", Namespace: NamespaceStorage, Params: []Field{ getField("o"), getField("r"), getField("size"), getField("bid"), }, Results: []Field{ getField("n"), }, Description: `will write content to a block.`, }, { Name: "combine_block", Namespace: NamespaceStorage, Params: []Field{ getField("o"), getField("bids"), }, Description: `will combine blocks into an object.`, }, { Name: "list_block", Namespace: NamespaceStorage, Params: []Field{ getField("o"), }, Results: []Field{ getField("bi"), }, Description: `will list blocks belong to this object.`, }, { Name: "copy", Namespace: NamespaceStorage, Params: []Field{ getField("src"), getField("dst"), }, Description: `will copy an Object or multiple object in the service. ## Behavior - Copy only copy one and only one object. - Service DON'T NEED to support copy a non-empty directory or copy files recursively. - User NEED to implement copy a non-empty directory and copy recursively by themself. - Copy a file to a directory SHOULD return ErrObjectModeInvalid. - Copy SHOULD NOT return an error as dst object exists. - Service that has native support for overwrite doesn't NEED to check the dst object exists or not. - Service that doesn't have native support for overwrite SHOULD check and delete the dst object if exists. - A successful copy opration should be complete, which means the dst object's content and metadata should be the same as src object.`, }, { Name: "create_dir", Namespace: NamespaceStorage, Params: []Field{ getField("path"), }, Results: []Field{ getField("o"), }, Description: `will create a new dir object`, }, { Name: "fetch", Namespace: NamespaceStorage, Params: []Field{ getField("path"), getField("url"), }, Description: `will fetch from a given url to path. ## Behavior - Fetch SHOULD NOT return an error as the object exists. - A successful fetch operation should be complete, which means the object's content and metadata should be the same as requiring from the url.`, }, { Name: "create_link", Namespace: NamespaceStorage, Params: []Field{ getField("path"), getField("target"), }, Results: []Field{ getField("o"), }, Description: `Will create a link object. # Behavior - path and target COULD be relative or absolute path. - If target not exists, CreateLink will still create a link object to path. - If path exists: - If path is a symlink object, CreateLink will remove the symlink object and create a new link object to path. - If path is not a symlink object, CreateLink will return an ErrObjectModeInvalid error when the service does not support overwrite. - A link object COULD be returned in Stat or List. - CreateLink COULD implement virtual_link feature when service without native support. - Users SHOULD enable this feature by themselves.`, }, { Name: "move", Namespace: NamespaceStorage, Params: []Field{ getField("src"), getField("dst"), }, Description: `will move an object in the service. ## Behavior - Move only move one and only one object. - Service DON'T NEED to support move a non-empty directory. - User NEED to implement move a non-empty directory by themself. - Move a file to a directory SHOULD return ErrObjectModeInvalid. - Move SHOULD NOT return an error as dst object exists. - Service that has native support for overwrite doesn't NEED to check the dst object exists or not. - Service that doesn't have native support for overwrite SHOULD check and delete the dst object if exists. - A successful move operation SHOULD be complete, which means the dst object's content and metadata should be the same as src object.`, }, { Name: "create_multipart", Namespace: NamespaceStorage, Params: []Field{ getField("path"), }, Results: []Field{ getField("o"), }, Description: `will create a new multipart. ## Behavior - CreateMultipart SHOULD NOT return an error as the object exists.`, }, { Name: "write_multipart", Namespace: NamespaceStorage, Params: []Field{ getField("o"), getField("r"), getField("size"), getField("index"), }, Results: []Field{ getField("n"), getField("part"), }, Description: `will write content to a multipart.`, }, { Name: "complete_multipart", Namespace: NamespaceStorage, Params: []Field{ getField("o"), getField("parts"), }, Description: `will complete a multipart upload and construct an Object.`, }, { Name: "list_multipart", Namespace: NamespaceStorage, Params: []Field{ getField("o"), }, Results: []Field{ getField("pi"), }, Description: `will list parts belong to this multipart.`, }, { Name: "create_page", Namespace: NamespaceStorage, Params: []Field{ getField("path"), }, Results: []Field{ getField("o"), }, Description: `will create a new page object. ## Behavior - CreatePage SHOULD NOT return an error as the object exists.`, }, { Name: "write_page", Namespace: NamespaceStorage, Params: []Field{ getField("o"), getField("r"), getField("size"), getField("offset"), }, Results: []Field{ getField("n"), }, Description: `will write content to specific offset.`, }, { Name: "query_sign_http_read", Namespace: NamespaceStorage, Params: []Field{ getField("path"), getField("expire"), }, Results: []Field{ getField("req"), }, Description: "will read data from the file by using query parameters to authenticate requests.", }, { Name: "query_sign_http_write", Namespace: NamespaceStorage, Params: []Field{ getField("path"), getField("size"), getField("expire"), }, Results: []Field{ getField("req"), }, Description: "will write data into a file by using query parameters to authenticate requests.", }, { Name: "query_sign_http_delete", Namespace: NamespaceStorage, Params: []Field{ getField("path"), getField("expire"), }, Results: []Field{ getField("req"), }, Description: "will delete an object from service by using query parameters to authenticate requests.", }, { Name: "query_sign_http_create_multipart", Namespace: NamespaceStorage, Params: []Field{ getField("path"), getField("expire"), }, Results: []Field{ getField("req"), }, Description: "will create a new multipart by using query parameters to authenticate requests.", }, { Name: "query_sign_http_write_multipart", Namespace: NamespaceStorage, Params: []Field{ getField("o"), getField("size"), getField("index"), getField("expire"), }, Results: []Field{ getField("req"), }, Description: "will write content to a multipart by using query parameters to authenticate requests.", }, { Name: "query_sign_http_list_multipart", Namespace: NamespaceStorage, Params: []Field{ getField("o"), getField("expire"), }, Results: []Field{ getField("req"), }, Description: "will list parts belong to this multipart by using query parameters to authenticate requests.", }, { Name: "query_sign_http_complete_multipart", Namespace: NamespaceStorage, Params: []Field{ getField("o"), getField("parts"), getField("expire"), }, Results: []Field{ getField("req"), }, Description: "will complete a multipart upload and construct an Object by using query parameters to authenticate requests.", }, }
View Source
var OperationsStorageMap = make(map[string]Operation)
View Source
var PairArray = []Pair{ PairContentDisposition, PairContentMD5, PairContentType, PairContinuationToken, PairCredential, PairEndpoint, PairListMode, PairLocation, PairName, PairObjectMode, PairOffset, PairSize, PairMultipartID, PairIoCallback, PairWorkDir, }
View Source
var PairContentDisposition = Pair{ Name: "content_disposition", Type: Type{Name: "string"}, // contains filtered or unexported fields }
View Source
var PairContentMD5 = Pair{ Name: "content_md5", Type: Type{Name: "string"}, // contains filtered or unexported fields }
View Source
var PairContentType = Pair{ Name: "content_type", Type: Type{Name: "string"}, Defaultable: true, // contains filtered or unexported fields }
View Source
var PairContinuationToken = Pair{ Name: "continuation_token", Type: Type{Name: "string"}, Description: "specify the continuation token for list", // contains filtered or unexported fields }
View Source
var PairCredential = Pair{ Name: "credential", Type: Type{Name: "string"}, Description: "specify how to provide credential for service or storage", // contains filtered or unexported fields }
View Source
var PairEndpoint = Pair{ Name: "endpoint", Type: Type{Name: "string"}, Description: "specify how to provide endpoint for service or storage", // contains filtered or unexported fields }
View Source
var PairIoCallback = Pair{ Name: "io_callback", Type: Type{Name: "func([]byte)"}, Defaultable: true, Description: `specify what todo every time we read data from source`, // contains filtered or unexported fields }
View Source
var PairListMode = Pair{ Name: "list_mode", Type: Type{Package: "types", Name: "ListMode"}, // contains filtered or unexported fields }
View Source
var PairLocation = Pair{ Name: "location", Type: Type{Name: "string"}, Description: "specify the location for service or storage", // contains filtered or unexported fields }
View Source
var PairMap = make(map[string]Pair)
View Source
var PairMultipartID = Pair{ Name: "multipart_id", Type: Type{Name: "string"}, // contains filtered or unexported fields }
View Source
var PairName = Pair{ Name: "name", Type: Type{Name: "string"}, Description: "specify the storage name", // contains filtered or unexported fields }
View Source
var PairObjectMode = Pair{ Name: "object_mode", Type: Type{Package: "types", Name: "ObjectMode"}, Description: `ObjectMode hint`, // contains filtered or unexported fields }
View Source
var PairOffset = Pair{ Name: "offset", Type: Type{Name: "int64"}, Description: `specify offset for this request, storage will seek to this offset before read`, // contains filtered or unexported fields }
View Source
var PairSize = Pair{ Name: "size", Type: Type{Name: "int64"}, Description: `specify size for this request, storage will only read limited content data`, // contains filtered or unexported fields }
View Source
var PairWorkDir = Pair{ Name: "work_dir", Type: Type{Name: "string"}, Description: `specify the work dir for service or storage, every operation will be relative to this dir. work_dir SHOULD be an absolute path. work_dir will be default to / if not set. work_dir SHOULD be Unix style for object storage services. For fs storage service on windows platform, the behavior is defined separately.`, // contains filtered or unexported fields }
Functions ¶
func GenerateInfo ¶
func GenerateInfo(path string)
func GenerateIterator ¶
func GenerateIterator(path string)
func GenerateNamespace ¶
func GenerateNamespace(path string)
func GenerateObject ¶
func GenerateObject(path string)
func GenerateOperation ¶
func GenerateOperation(path string)
func GeneratePair ¶
func GeneratePair(path string)
func GenerateService ¶
Types ¶
type Feature ¶
func SortFeatures ¶
type Info ¶
type Info struct { Namespace string Category string Name string Type Type Description string // contains filtered or unexported fields }
func (Info) NameForFunctionName ¶
func (Info) NameForStructField ¶
type Metadata ¶
type Operation ¶
type Operation struct { Name string Namespace string Local bool Params []Field Results []Field Pairs []Pair Description string }
func SortOperations ¶
type Pair ¶
type Service ¶
type Service struct { Features types.ServiceFeatures Create []Pair Delete []Pair Get []Pair List []Pair }
func (Service) HasFeature ¶
func (Service) ListFeatures ¶
func (Service) Operations ¶
type Storage ¶
type Storage struct { Features types.StorageFeatures CombineBlock []Pair CommitAppend []Pair CompleteMultipart []Pair Copy []Pair Create []Pair CreateAppend []Pair CreateBlock []Pair CreateDir []Pair CreateLink []Pair CreateMultipart []Pair CreatePage []Pair Delete []Pair Fetch []Pair List []Pair ListBlock []Pair ListMultipart []Pair Metadata []Pair Move []Pair QuerySignHTTPCompleteMultipart []Pair QuerySignHTTPCreateMultipart []Pair QuerySignHTTPDelete []Pair QuerySignHTTPListMultipart []Pair QuerySignHTTPRead []Pair QuerySignHTTPWrite []Pair QuerySignHTTPWriteMultipart []Pair Read []Pair Stat []Pair Write []Pair WriteAppend []Pair WriteBlock []Pair WriteMultipart []Pair WritePage []Pair }
func (Storage) HasFeature ¶
func (Storage) ListFeatures ¶
func (Storage) Operations ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.