Documentation ¶
Index ¶
- Constants
- Variables
- type ParamCORSValue
- type ParamPermissionsValue
- type Server
- func (s *Server) DriverCreateBucket(ctx context.Context, req *cosi.DriverCreateBucketRequest) (*cosi.DriverCreateBucketResponse, error)
- func (s *Server) DriverDeleteBucket(ctx context.Context, req *cosi.DriverDeleteBucketRequest) (*cosi.DriverDeleteBucketResponse, error)
- func (s *Server) DriverGrantBucketAccess(ctx context.Context, req *cosi.DriverGrantBucketAccessRequest) (*cosi.DriverGrantBucketAccessResponse, error)
- func (s *Server) DriverRevokeBucketAccess(ctx context.Context, req *cosi.DriverRevokeBucketAccessRequest) (*cosi.DriverRevokeBucketAccessResponse, error)
Constants ¶
const ( ParamRegion = "cosi.linode.com/v1/region" ParamACL = "cosi.linode.com/v1/acl" ParamCORS = "cosi.linode.com/v1/cors" ParamPermissions = "cosi.linode.com/v1/permissions" )
const ( S3 = "s3" S3Region = "region" S3Endpoint = "endpoint" S3SecretAccessKeyID = "accessKeyID" S3SecretAccessSecretKey = "accessSecretKey" )
const ( KeyBucketID = "bucket.id" KeyBucketLabel = "bucket.label" KeyBucketCluster = "bucket.cluster" KeyBucketCreationTimestamp = "bucket.created_at" KeyBucketACL = "bucket.acl" KeyBucketCORS = "bucket.cors_enabled" KeyBucketAccessIDRaw = "bucket.access.id_raw" KeyBucketAccessID = "bucket.access.id" KeyBucketAccessName = "bucket.access.name" KeyBucketAccessAuth = "bucket.access.auth" KeyBucketAccessPermissions = "bucket.access.permissions" )
Variables ¶
var ( ErrNotFound = linodego.Error{Code: http.StatusNotFound} ErrBucketExists = errors.New("bucket exists with different parameters") ErrUnsuportedAuth = errors.New("unsupported authentication schema") ErrMissingRegion = errors.New("region was not provided") ErrUnknownPermsissions = errors.New("unknown permissions") )
Functions ¶
This section is empty.
Types ¶
type ParamCORSValue ¶
type ParamCORSValue string
const ( ParamCORSValueEnabled ParamCORSValue = "enabled" ParamCORSValueDisabled ParamCORSValue = "disabled" )
func (ParamCORSValue) Bool ¶
func (v ParamCORSValue) Bool() bool
func (ParamCORSValue) BoolP ¶
func (v ParamCORSValue) BoolP() *bool
type ParamPermissionsValue ¶
type ParamPermissionsValue string
const ( ParamPermissionsValueReadOnly ParamPermissionsValue = "read_only" ParamPermissionsValueReadWrite ParamPermissionsValue = "read_write" )
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements cosi.ProvisionerServer interface.
func (*Server) DriverCreateBucket ¶
func (s *Server) DriverCreateBucket(ctx context.Context, req *cosi.DriverCreateBucketRequest) (*cosi.DriverCreateBucketResponse, error)
DriverCreateBucket call is made to create the bucket in the backend.
NOTE: this call needs to be idempotent.
- If a bucket that matches both name and parameters already exists, then OK (success) must be returned.
- If a bucket by same name, but different parameters is provided, then the appropriate error code ALREADY_EXISTS must be returned.
func (*Server) DriverDeleteBucket ¶
func (s *Server) DriverDeleteBucket(ctx context.Context, req *cosi.DriverDeleteBucketRequest) (*cosi.DriverDeleteBucketResponse, error)
DriverDeleteBucket call is made to delete the bucket in the backend.
NOTE: this call needs to be idempotent. If the bucket has already been deleted, then no error should be returned.
func (*Server) DriverGrantBucketAccess ¶
func (s *Server) DriverGrantBucketAccess(ctx context.Context, req *cosi.DriverGrantBucketAccessRequest) (*cosi.DriverGrantBucketAccessResponse, error)
DriverGrantBucketAccess call grants access to an account. The account_name in the request shall be used as a unique identifier to create credentials.
NOTE: this call needs to be idempotent. The account_id returned in the response will be used as the unique identifier for deleting this access when calling DriverRevokeBucketAccess. The returned secret does not need to be the same each call to achieve idempotency.
func (*Server) DriverRevokeBucketAccess ¶
func (s *Server) DriverRevokeBucketAccess(ctx context.Context, req *cosi.DriverRevokeBucketAccessRequest) (*cosi.DriverRevokeBucketAccessResponse, error)
DriverRevokeBucketAccess call revokes all access to a particular bucket from a principal.
NOTE: this call needs to be idempotent.