Documentation
¶
Index ¶
- Constants
- type GatewayClient
- type GetGatewayServiceClientFunc
- type Graph
- func (g Graph) CreateDrive(w http.ResponseWriter, r *http.Request)
- func (g Graph) DeleteDrive(w http.ResponseWriter, r *http.Request)
- func (g Graph) DeleteGroup(w http.ResponseWriter, r *http.Request)
- func (g Graph) DeleteGroupMember(w http.ResponseWriter, r *http.Request)
- func (g Graph) DeleteUser(w http.ResponseWriter, r *http.Request)
- func (g Graph) GetDrives(w http.ResponseWriter, r *http.Request)
- func (g Graph) GetExtendedSpaceProperties(ctx context.Context, baseURL *url.URL, space *storageprovider.StorageSpace) []libregraph.DriveItem
- func (g Graph) GetGatewayClient() GatewayClient
- func (g Graph) GetGroup(w http.ResponseWriter, r *http.Request)
- func (g Graph) GetGroupMembers(w http.ResponseWriter, r *http.Request)
- func (g Graph) GetGroups(w http.ResponseWriter, r *http.Request)
- func (g Graph) GetHTTPClient() HTTPClient
- func (g Graph) GetMe(w http.ResponseWriter, r *http.Request)
- func (g Graph) GetRootDriveChildren(w http.ResponseWriter, r *http.Request)
- func (g Graph) GetSingleDrive(w http.ResponseWriter, r *http.Request)
- func (g Graph) GetUser(w http.ResponseWriter, r *http.Request)
- func (g Graph) GetUsers(w http.ResponseWriter, r *http.Request)
- func (g Graph) ListStorageSpacesWithFilters(ctx context.Context, ...) (*storageprovider.ListStorageSpacesResponse, error)
- func (g Graph) PatchGroup(w http.ResponseWriter, r *http.Request)
- func (g Graph) PatchUser(w http.ResponseWriter, r *http.Request)
- func (g Graph) PostGroup(w http.ResponseWriter, r *http.Request)
- func (g Graph) PostGroupMember(w http.ResponseWriter, r *http.Request)
- func (g Graph) PostUser(w http.ResponseWriter, r *http.Request)
- func (g Graph) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (g Graph) UpdateDrive(w http.ResponseWriter, r *http.Request)
- type HTTPClient
- type Option
- func Config(val *config.Config) Option
- func Logger(val log.Logger) Option
- func Middleware(val ...func(http.Handler) http.Handler) Option
- func RoleManager(val *roles.Manager) Option
- func RoleService(val settingssvc.RoleService) Option
- func WithGatewayClient(val GatewayClient) Option
- func WithHTTPClient(val HTTPClient) Option
- type Options
- type Service
Constants ¶
const ( NoSpaceFoundMessage = "space with id `%s` not found" ListStorageSpacesTransportErr = "transport error sending list storage spaces grpc request" ListStorageSpacesReturnsErr = "list storage spaces grpc request returns an errorcode in the response" ReadmeSpecialFolderName = "readme" SpaceImageSpecialFolderName = "image" )
const (
// HeaderPurge defines the header name for the purge header.
HeaderPurge = "Purge"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GatewayClient ¶ added in v1.17.0
type GatewayClient interface {
// Returns the home path for the given authenticated user.
// When a user has access to multiple storage providers, one of them is the home.
GetHome(ctx context.Context, in *provider.GetHomeRequest, opts ...grpc.CallOption) (*provider.GetHomeResponse, error)
// GetPath does a path lookup for a resource by ID
GetPath(ctx context.Context, in *provider.GetPathRequest, opts ...grpc.CallOption) (*provider.GetPathResponse, error)
// Returns a list of resource information
// for the provided reference.
// MUST return CODE_NOT_FOUND if the reference does not exists.
ListContainer(ctx context.Context, in *provider.ListContainerRequest, opts ...grpc.CallOption) (*provider.ListContainerResponse, error)
// Returns the resource information at the provided reference.
// MUST return CODE_NOT_FOUND if the reference does not exist.
Stat(ctx context.Context, in *provider.StatRequest, opts ...grpc.CallOption) (*provider.StatResponse, error)
// Initiates the download of a file using an
// out-of-band data transfer mechanism.
InitiateFileDownload(ctx context.Context, in *provider.InitiateFileDownloadRequest, opts ...grpc.CallOption) (*gateway.InitiateFileDownloadResponse, error)
// Creates a storage space.
CreateStorageSpace(ctx context.Context, in *provider.CreateStorageSpaceRequest, opts ...grpc.CallOption) (*provider.CreateStorageSpaceResponse, error)
// Lists storage spaces.
ListStorageSpaces(ctx context.Context, in *provider.ListStorageSpacesRequest, opts ...grpc.CallOption) (*provider.ListStorageSpacesResponse, error)
// Updates a storage space.
UpdateStorageSpace(ctx context.Context, in *provider.UpdateStorageSpaceRequest, opts ...grpc.CallOption) (*provider.UpdateStorageSpaceResponse, error)
// Deletes a storage space.
DeleteStorageSpace(ctx context.Context, in *provider.DeleteStorageSpaceRequest, opts ...grpc.CallOption) (*provider.DeleteStorageSpaceResponse, error)
// Returns the quota available under the provided
// reference.
// MUST return CODE_NOT_FOUND if the reference does not exist
// MUST return CODE_RESOURCE_EXHAUSTED on exceeded quota limits.
GetQuota(ctx context.Context, in *gateway.GetQuotaRequest, opts ...grpc.CallOption) (*provider.GetQuotaResponse, error)
}
GatewayClient is the subset of the gateway.GatewayAPIClient that is being used to interact with the gateway
type GetGatewayServiceClientFunc ¶ added in v1.17.0
type GetGatewayServiceClientFunc func() (GatewayClient, error)
GetGatewayServiceClientFunc is a callback used to pass in a mock during testing
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph defines implements the business logic for Service.
func (Graph) CreateDrive ¶ added in v1.12.0
func (g Graph) CreateDrive(w http.ResponseWriter, r *http.Request)
CreateDrive creates a storage drive (space).
func (Graph) DeleteDrive ¶ added in v1.17.0
func (g Graph) DeleteDrive(w http.ResponseWriter, r *http.Request)
func (Graph) DeleteGroup ¶ added in v1.17.0
func (g Graph) DeleteGroup(w http.ResponseWriter, r *http.Request)
DeleteGroup implements the Service interface.
func (Graph) DeleteGroupMember ¶ added in v1.17.0
func (g Graph) DeleteGroupMember(w http.ResponseWriter, r *http.Request)
DeleteGroupMember implements the Service interface.
func (Graph) DeleteUser ¶ added in v1.17.0
func (g Graph) DeleteUser(w http.ResponseWriter, r *http.Request)
func (Graph) GetDrives ¶
func (g Graph) GetDrives(w http.ResponseWriter, r *http.Request)
GetDrives implements the Service interface.
func (Graph) GetExtendedSpaceProperties ¶ added in v1.17.0
func (g Graph) GetExtendedSpaceProperties(ctx context.Context, baseURL *url.URL, space *storageprovider.StorageSpace) []libregraph.DriveItem
GetExtendedSpaceProperties reads properties from the opaque and transforms them into driveItems
func (Graph) GetGatewayClient ¶ added in v1.17.0
func (g Graph) GetGatewayClient() GatewayClient
GetClient returns a gateway client to talk to reva
func (Graph) GetGroup ¶
func (g Graph) GetGroup(w http.ResponseWriter, r *http.Request)
GetGroup implements the Service interface.
func (Graph) GetGroupMembers ¶ added in v1.17.0
func (g Graph) GetGroupMembers(w http.ResponseWriter, r *http.Request)
func (Graph) GetGroups ¶
func (g Graph) GetGroups(w http.ResponseWriter, r *http.Request)
GetGroups implements the Service interface.
func (Graph) GetHTTPClient ¶ added in v1.17.0
func (g Graph) GetHTTPClient() HTTPClient
GetClient returns a gateway client to talk to reva
func (Graph) GetMe ¶
func (g Graph) GetMe(w http.ResponseWriter, r *http.Request)
GetMe implements the Service interface.
func (Graph) GetRootDriveChildren ¶
func (g Graph) GetRootDriveChildren(w http.ResponseWriter, r *http.Request)
GetRootDriveChildren implements the Service interface.
func (Graph) GetSingleDrive ¶ added in v1.17.0
func (g Graph) GetSingleDrive(w http.ResponseWriter, r *http.Request)
GetSingleDrive does a lookup of a single space by spaceId
func (Graph) GetUser ¶
func (g Graph) GetUser(w http.ResponseWriter, r *http.Request)
GetUser implements the Service interface.
func (Graph) GetUsers ¶
func (g Graph) GetUsers(w http.ResponseWriter, r *http.Request)
GetUsers implements the Service interface.
func (Graph) ListStorageSpacesWithFilters ¶ added in v1.17.0
func (g Graph) ListStorageSpacesWithFilters(ctx context.Context, filters []*storageprovider.ListStorageSpacesRequest_Filter) (*storageprovider.ListStorageSpacesResponse, error)
ListStorageSpacesWithFilters List Storage Spaces using filters
func (Graph) PatchGroup ¶ added in v1.17.0
func (g Graph) PatchGroup(w http.ResponseWriter, r *http.Request)
PatchGroup implements the Service interface.
func (Graph) PatchUser ¶ added in v1.17.0
func (g Graph) PatchUser(w http.ResponseWriter, r *http.Request)
PatchUser implements the Service Interface. Updates the specified attributes of an ExistingUser
func (Graph) PostGroup ¶ added in v1.17.0
func (g Graph) PostGroup(w http.ResponseWriter, r *http.Request)
PostGroup implements the Service interface.
func (Graph) PostGroupMember ¶ added in v1.17.0
func (g Graph) PostGroupMember(w http.ResponseWriter, r *http.Request)
PostGroupMember implements the Service interface.
func (Graph) PostUser ¶ added in v1.17.0
func (g Graph) PostUser(w http.ResponseWriter, r *http.Request)
func (Graph) ServeHTTP ¶
func (g Graph) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements the Service interface.
func (Graph) UpdateDrive ¶ added in v1.13.0
func (g Graph) UpdateDrive(w http.ResponseWriter, r *http.Request)
type HTTPClient ¶ added in v1.17.0
HTTPClient is the subset of the http.Client that is being used to interact with the download gateway
type Option ¶
type Option func(o *Options)
Option defines a single option function.
func Middleware ¶
Middleware provides a function to set the middleware option.
func RoleManager ¶ added in v1.18.0
RoleManager provides a function to set the RoleManager option.
func RoleService ¶ added in v1.18.0
func RoleService(val settingssvc.RoleService) Option
RoleService provides a function to set the RoleService option.
func WithGatewayClient ¶ added in v1.17.0
func WithGatewayClient(val GatewayClient) Option
WithGatewayClient provides a function to set the gateway client option.
func WithHTTPClient ¶ added in v1.17.0
func WithHTTPClient(val HTTPClient) Option
WithHTTPClient provides a function to set the http client option.
type Options ¶
type Options struct {
Logger log.Logger
Config *config.Config
Middleware []func(http.Handler) http.Handler
GatewayClient GatewayClient
HTTPClient HTTPClient
RoleService settingssvc.RoleService
RoleManager *roles.Manager
}
Options defines the available options for this package.
type Service ¶
type Service interface {
ServeHTTP(http.ResponseWriter, *http.Request)
GetMe(http.ResponseWriter, *http.Request)
GetUsers(http.ResponseWriter, *http.Request)
GetUser(http.ResponseWriter, *http.Request)
PostUser(http.ResponseWriter, *http.Request)
DeleteUser(http.ResponseWriter, *http.Request)
PatchUser(http.ResponseWriter, *http.Request)
GetGroups(http.ResponseWriter, *http.Request)
GetGroup(http.ResponseWriter, *http.Request)
PostGroup(http.ResponseWriter, *http.Request)
PatchGroup(http.ResponseWriter, *http.Request)
DeleteGroup(http.ResponseWriter, *http.Request)
GetGroupMembers(http.ResponseWriter, *http.Request)
PostGroupMember(http.ResponseWriter, *http.Request)
DeleteGroupMember(http.ResponseWriter, *http.Request)
GetDrives(w http.ResponseWriter, r *http.Request)
}
Service defines the extension handlers.
func NewInstrument ¶
NewInstrument returns a service that instruments metrics.
func NewLogging ¶
NewLogging returns a service that logs messages.
func NewService ¶
NewService returns a service implementation for Service.
func NewTracing ¶
NewTracing returns a service that instruments traces.