Move code from Internal Git

This commit is contained in:
Samuel Lorch 2021-08-30 13:52:31 +02:00
parent 4457df3e5f
commit ff29c83d56
26 changed files with 2008 additions and 0 deletions

33
helper/folder.go Normal file
View file

@ -0,0 +1,33 @@
package helper
import (
"context"
"github.com/speatzle/go-passbolt"
)
func CreateFolder(ctx context.Context, c *passbolt.Client, folderParentID, name string) (string, error) {
f, err := c.CreateFolder(ctx, passbolt.Folder{
Name: name,
FolderParentID: folderParentID,
})
return f.ID, err
}
func GetFolder(ctx context.Context, c *passbolt.Client, folderID string) (string, string, error) {
f, err := c.GetFolder(ctx, folderID)
return f.FolderParentID, f.Name, err
}
func UpdateFolder(ctx context.Context, c *passbolt.Client, folderID, name string) error {
_, err := c.UpdateFolder(ctx, folderID, passbolt.Folder{Name: name})
return err
}
func DeleteFolder(ctx context.Context, c *passbolt.Client, folderID string) error {
return c.DeleteFolder(ctx, folderID)
}
func MoveFolder(ctx context.Context, c *passbolt.Client, folderID, folderParentID string) error {
return c.MoveFolder(ctx, folderID, folderParentID)
}