move api package to sub folder

This commit is contained in:
Samuel Lorch 2021-08-30 14:00:05 +02:00
parent ff29c83d56
commit ff1be787f2
23 changed files with 61 additions and 61 deletions

View file

@ -3,31 +3,31 @@ package helper
import (
"context"
"github.com/speatzle/go-passbolt"
"github.com/speatzle/go-passbolt/api"
)
func CreateFolder(ctx context.Context, c *passbolt.Client, folderParentID, name string) (string, error) {
f, err := c.CreateFolder(ctx, passbolt.Folder{
func CreateFolder(ctx context.Context, c *api.Client, folderParentID, name string) (string, error) {
f, err := c.CreateFolder(ctx, api.Folder{
Name: name,
FolderParentID: folderParentID,
})
return f.ID, err
}
func GetFolder(ctx context.Context, c *passbolt.Client, folderID string) (string, string, error) {
func GetFolder(ctx context.Context, c *api.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})
func UpdateFolder(ctx context.Context, c *api.Client, folderID, name string) error {
_, err := c.UpdateFolder(ctx, folderID, api.Folder{Name: name})
return err
}
func DeleteFolder(ctx context.Context, c *passbolt.Client, folderID string) error {
func DeleteFolder(ctx context.Context, c *api.Client, folderID string) error {
return c.DeleteFolder(ctx, folderID)
}
func MoveFolder(ctx context.Context, c *passbolt.Client, folderID, folderParentID string) error {
func MoveFolder(ctx context.Context, c *api.Client, folderID, folderParentID string) error {
return c.MoveFolder(ctx, folderID, folderParentID)
}