mirror of
https://github.com/passbolt/go-passbolt.git
synced 2025-05-09 09:48:20 +00:00
add missing Comments to Public Functions
This commit is contained in:
parent
b047c9c647
commit
982af2dae4
8 changed files with 16 additions and 1 deletions
|
@ -30,6 +30,7 @@ func (c *Client) DoCustomRequest(ctx context.Context, method, path, version stri
|
||||||
return response, err
|
return response, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DoCustomRequestAndReturnRawResponse Executes a Custom Request and returns a APIResponse and the Raw HTTP Response
|
||||||
func (c *Client) DoCustomRequestAndReturnRawResponse(ctx context.Context, method, path, version string, body interface{}, opts interface{}) (*http.Response, *APIResponse, error) {
|
func (c *Client) DoCustomRequestAndReturnRawResponse(ctx context.Context, method, path, version string, body interface{}, opts interface{}) (*http.Response, *APIResponse, error) {
|
||||||
u, err := addOptions(path, version, opts)
|
u, err := addOptions(path, version, opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -176,6 +176,7 @@ func (c *Client) Logout(ctx context.Context) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetUserID Gets the ID of the Current User
|
||||||
func (c *Client) GetUserID() string {
|
func (c *Client) GetUserID() string {
|
||||||
return c.userID
|
return c.userID
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package api
|
||||||
import "errors"
|
import "errors"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
// API Error Codes
|
||||||
ErrAPIResponseErrorStatusCode = errors.New("Error API JSON Response Status")
|
ErrAPIResponseErrorStatusCode = errors.New("Error API JSON Response Status")
|
||||||
ErrAPIResponseUnknownStatusCode = errors.New("Unknown API JSON Response Status")
|
ErrAPIResponseUnknownStatusCode = errors.New("Unknown API JSON Response Status")
|
||||||
)
|
)
|
||||||
|
|
|
@ -15,6 +15,7 @@ type ResourceType struct {
|
||||||
Modified *Time `json:"modified,omitempty"`
|
Modified *Time `json:"modified,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetResourceTypesOptions is a placeholder for future options
|
||||||
type GetResourceTypesOptions struct {
|
type GetResourceTypesOptions struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ type Secret struct {
|
||||||
Modified *Time `json:"modified,omitempty"`
|
Modified *Time `json:"modified,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SecretDataTypePasswordAndDescription is the format a secret of resource type "password-and-description" is stored in
|
||||||
type SecretDataTypePasswordAndDescription struct {
|
type SecretDataTypePasswordAndDescription struct {
|
||||||
Password string `json:"password"`
|
Password string `json:"password"`
|
||||||
Description string `json:"description,omitempty"`
|
Description string `json:"description,omitempty"`
|
||||||
|
|
|
@ -11,20 +11,23 @@ type ResourceShareRequest struct {
|
||||||
Secrets []Secret `json:"secrets,omitempty"`
|
Secrets []Secret `json:"secrets,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ResourceShareSimulationResult is the Result of a Sharing Siumulation
|
// ResourceShareSimulationResult is the Result of a Sharing Simulation
|
||||||
type ResourceShareSimulationResult struct {
|
type ResourceShareSimulationResult struct {
|
||||||
Changes ResourceShareSimulationChanges `json:"changes,omitempty"`
|
Changes ResourceShareSimulationChanges `json:"changes,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ResourceShareSimulationChanges contains the Actual Changes
|
||||||
type ResourceShareSimulationChanges struct {
|
type ResourceShareSimulationChanges struct {
|
||||||
Added []ResourceShareSimulationChange `json:"added,omitempty"`
|
Added []ResourceShareSimulationChange `json:"added,omitempty"`
|
||||||
Removed []ResourceShareSimulationChange `json:"removed,omitempty"`
|
Removed []ResourceShareSimulationChange `json:"removed,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ResourceShareSimulationChange is a single change
|
||||||
type ResourceShareSimulationChange struct {
|
type ResourceShareSimulationChange struct {
|
||||||
User ResourceShareSimulationUser `json:"user,omitempty"`
|
User ResourceShareSimulationUser `json:"user,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ResourceShareSimulationUser contains the users id
|
||||||
type ResourceShareSimulationUser struct {
|
type ResourceShareSimulationUser struct {
|
||||||
ID string `json:"id,omitempty"`
|
ID string `json:"id,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"github.com/speatzle/go-passbolt/api"
|
"github.com/speatzle/go-passbolt/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// CreateFolder Creates a new Folder
|
||||||
func CreateFolder(ctx context.Context, c *api.Client, folderParentID, name string) (string, error) {
|
func CreateFolder(ctx context.Context, c *api.Client, folderParentID, name string) (string, error) {
|
||||||
f, err := c.CreateFolder(ctx, api.Folder{
|
f, err := c.CreateFolder(ctx, api.Folder{
|
||||||
Name: name,
|
Name: name,
|
||||||
|
@ -14,20 +15,24 @@ func CreateFolder(ctx context.Context, c *api.Client, folderParentID, name strin
|
||||||
return f.ID, err
|
return f.ID, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetFolder Gets a Folder
|
||||||
func GetFolder(ctx context.Context, c *api.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)
|
f, err := c.GetFolder(ctx, folderID)
|
||||||
return f.FolderParentID, f.Name, err
|
return f.FolderParentID, f.Name, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UpdateFolder Updates a Folder
|
||||||
func UpdateFolder(ctx context.Context, c *api.Client, folderID, name string) error {
|
func UpdateFolder(ctx context.Context, c *api.Client, folderID, name string) error {
|
||||||
_, err := c.UpdateFolder(ctx, folderID, api.Folder{Name: name})
|
_, err := c.UpdateFolder(ctx, folderID, api.Folder{Name: name})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DeleteFolder Deletes a Folder
|
||||||
func DeleteFolder(ctx context.Context, c *api.Client, folderID string) error {
|
func DeleteFolder(ctx context.Context, c *api.Client, folderID string) error {
|
||||||
return c.DeleteFolder(ctx, folderID)
|
return c.DeleteFolder(ctx, folderID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MoveFolder Moves a Folder into a Folder
|
||||||
func MoveFolder(ctx context.Context, c *api.Client, folderID, folderParentID string) error {
|
func MoveFolder(ctx context.Context, c *api.Client, folderID, folderParentID string) error {
|
||||||
return c.MoveFolder(ctx, folderID, folderParentID)
|
return c.MoveFolder(ctx, folderID, folderParentID)
|
||||||
}
|
}
|
||||||
|
|
|
@ -199,10 +199,12 @@ func UpdateResource(ctx context.Context, c *api.Client, resourceID, name, userna
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DeleteResource Deletes a Resource
|
||||||
func DeleteResource(ctx context.Context, c *api.Client, resourceID string) error {
|
func DeleteResource(ctx context.Context, c *api.Client, resourceID string) error {
|
||||||
return c.DeleteResource(ctx, resourceID)
|
return c.DeleteResource(ctx, resourceID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MoveResource Moves a Resource into a Folder
|
||||||
func MoveResource(ctx context.Context, c *api.Client, resourceID, folderParentID string) error {
|
func MoveResource(ctx context.Context, c *api.Client, resourceID, folderParentID string) error {
|
||||||
return c.MoveResource(ctx, resourceID, folderParentID)
|
return c.MoveResource(ctx, resourceID, folderParentID)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue