Documentation ¶
Index ¶
- func AuthenticateCS3(ctx context.Context, su config.ServiceUser, tm token.Manager) (token string, err error)
- func IsNotFoundErr(e error) bool
- func MakeDirIfNotExist(ctx context.Context, sp provider.ProviderAPIClient, root *provider.ResourceId, ...) error
- type CS3Repo
- func (r CS3Repo) DeleteAccount(ctx context.Context, id string) (err error)
- func (r CS3Repo) DeleteGroup(ctx context.Context, id string) (err error)
- func (r CS3Repo) LoadAccount(ctx context.Context, id string, a *accountsmsg.Account) (err error)
- func (r CS3Repo) LoadAccounts(ctx context.Context, a *[]*accountsmsg.Account) (err error)
- func (r CS3Repo) LoadGroup(ctx context.Context, id string, g *accountsmsg.Group) (err error)
- func (r CS3Repo) LoadGroups(ctx context.Context, g *[]*accountsmsg.Group) (err error)
- func (r CS3Repo) WriteAccount(ctx context.Context, a *accountsmsg.Account) (err error)
- func (r CS3Repo) WriteGroup(ctx context.Context, g *accountsmsg.Group) (err error)
- type DiskRepo
- func (r DiskRepo) DeleteAccount(ctx context.Context, id string) (err error)
- func (r DiskRepo) DeleteGroup(ctx context.Context, id string) (err error)
- func (r DiskRepo) LoadAccount(ctx context.Context, id string, a *accountsmsg.Account) (err error)
- func (r DiskRepo) LoadAccounts(ctx context.Context, a *[]*accountsmsg.Account) (err error)
- func (r DiskRepo) LoadGroup(ctx context.Context, id string, g *accountsmsg.Group) (err error)
- func (r DiskRepo) LoadGroups(ctx context.Context, g *[]*accountsmsg.Group) (err error)
- func (r DiskRepo) WriteAccount(ctx context.Context, a *accountsmsg.Account) (err error)
- func (r DiskRepo) WriteGroup(ctx context.Context, g *accountsmsg.Group) (err error)
- type Repo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticateCS3 ¶
func AuthenticateCS3(ctx context.Context, su config.ServiceUser, tm token.Manager) (token string, err error)
AuthenticateCS3 mints an auth token for communicating with cs3 storage based on a service user from config
func IsNotFoundErr ¶
IsNotFoundErr can be returned by repo Load and Delete operations
func MakeDirIfNotExist ¶
func MakeDirIfNotExist(ctx context.Context, sp provider.ProviderAPIClient, root *provider.ResourceId, folder string) error
MakeDirIfNotExist will create a root node in the metadata storage. Requires an authenticated context.
Types ¶
type CS3Repo ¶
type CS3Repo struct {
// contains filtered or unexported fields
}
CS3Repo provides a cs3 implementation of the Repo interface
func (CS3Repo) DeleteAccount ¶
DeleteAccount deletes an account via cs3 by id
func (CS3Repo) DeleteGroup ¶
DeleteGroup deletes a group via cs3 by id
func (CS3Repo) LoadAccount ¶
LoadAccount loads an account via cs3 by id and writes it to the provided account
func (CS3Repo) LoadAccounts ¶
LoadAccounts loads all the accounts from the cs3 api
func (CS3Repo) LoadGroup ¶
LoadGroup loads a group via cs3 by id and writes it to the provided group
func (CS3Repo) LoadGroups ¶
LoadGroups loads all the groups from the cs3 api
func (CS3Repo) WriteAccount ¶
WriteAccount writes an account via cs3 and modifies the provided account (e.g. with a generated id).
func (CS3Repo) WriteGroup ¶
WriteGroup writes a group via cs3 and modifies the provided group (e.g. with a generated id).
type DiskRepo ¶
type DiskRepo struct {
// contains filtered or unexported fields
}
DiskRepo provides a local filesystem implementation of the Repo interface
func NewDiskRepo ¶
NewDiskRepo creates a new disk repo
func (DiskRepo) DeleteAccount ¶
DeleteAccount from the local filesystem
func (DiskRepo) DeleteGroup ¶
DeleteGroup from the local filesystem
func (DiskRepo) LoadAccount ¶
LoadAccount from the local filesystem
func (DiskRepo) LoadAccounts ¶
LoadAccounts loads all the accounts from the local filesystem
func (DiskRepo) LoadGroups ¶
LoadGroups loads all the groups from the local filesystem
func (DiskRepo) WriteAccount ¶
WriteAccount to the local filesystem
func (DiskRepo) WriteGroup ¶
WriteGroup to the local filesystem
type Repo ¶
type Repo interface { WriteAccount(ctx context.Context, a *accountsmsg.Account) (err error) LoadAccount(ctx context.Context, id string, a *accountsmsg.Account) (err error) LoadAccounts(ctx context.Context, a *[]*accountsmsg.Account) (err error) DeleteAccount(ctx context.Context, id string) (err error) WriteGroup(ctx context.Context, g *accountsmsg.Group) (err error) LoadGroup(ctx context.Context, id string, g *accountsmsg.Group) (err error) LoadGroups(ctx context.Context, g *[]*accountsmsg.Group) (err error) DeleteGroup(ctx context.Context, id string) (err error) }
Repo defines the storage operations