resource

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package resource implements resource-related CLI subcommands.

Index

Constants

This section is empty.

Variables

View Source
var ResourceCreateCmd = &cobra.Command{
	Use:   "resource",
	Short: "Creates a Passbolt Resource",
	Long:  `Creates a Passbolt Resource and Returns the Resources ID`,
	RunE:  ResourceCreate,
}

ResourceCreateCmd Creates a Passbolt Resource

View Source
var ResourceDeleteCmd = &cobra.Command{
	Use:   "resource",
	Short: "Deletes a Passbolt Resource",
	Long:  `Deletes a Passbolt Resource`,
	RunE:  ResourceDelete,
}

ResourceDeleteCmd Deletes a Resource

View Source
var ResourceGetCmd = &cobra.Command{
	Use:   "resource",
	Short: "Gets a Passbolt Resource",
	Long:  `Gets a Passbolt Resource`,
	RunE:  ResourceGet,
}

ResourceGetCmd Gets a Passbolt Resource

View Source
var ResourceListCmd = &cobra.Command{
	Use:     "resource",
	Short:   "Lists Passbolt Resources",
	Long:    `Lists Passbolt Resources`,
	Aliases: []string{"resources"},
	RunE:    ResourceList,
}

ResourceListCmd Lists a Passbolt Resource

View Source
var ResourceMoveCmd = &cobra.Command{
	Use:   "resource",
	Short: "Moves a Passbolt Resource into a Folder",
	Long:  `Moves a Passbolt Resource into a Folder`,
	RunE:  ResourceMove,
}

ResourceMoveCmd Moves a Passbolt Resource

View Source
var ResourcePermissionCmd = &cobra.Command{
	Use:     "permission",
	Short:   "Gets Permissions for a Passbolt Resource",
	Long:    `Gets Permissions for a Passbolt Resource`,
	Aliases: []string{"permissions"},
	RunE:    ResourcePermission,
}

ResourcePermissionCmd Gets Permissions for Passbolt Resource

View Source
var ResourceShareCmd = &cobra.Command{
	Use:   "resource",
	Short: "Shares a Passbolt Resource",
	Long:  `Shares a Passbolt Resource`,
	RunE:  ResourceShare,
}

ResourceShareCmd Shares a Passbolt Resource

View Source
var ResourceUpdateCmd = &cobra.Command{
	Use:   "resource",
	Short: "Updates a Passbolt Resource",
	Long:  `Updates a Passbolt Resource`,
	RunE:  ResourceUpdate,
}

ResourceUpdateCmd Updates a Passbolt Resource

Functions

func ParseExpiry

func ParseExpiry(input string) (string, error)

ParseExpiry accepts either an absolute time (ISO8601/RFC3339) or a human duration like "7d", "12h", "30m", or combinations like "1w2d3h". It returns an ISO8601 (RFC3339) timestamp string in UTC suitable for the API.

func ResourceCreate

func ResourceCreate(cmd *cobra.Command, args []string) error

func ResourceDelete

func ResourceDelete(cmd *cobra.Command, args []string) error

func ResourceGet

func ResourceGet(cmd *cobra.Command, args []string) error

func ResourceList

func ResourceList(cmd *cobra.Command, args []string) error

func ResourceMove

func ResourceMove(cmd *cobra.Command, args []string) error

func ResourcePermission

func ResourcePermission(cmd *cobra.Command, args []string) error

func ResourceShare

func ResourceShare(cmd *cobra.Command, args []string) error

func ResourceUpdate

func ResourceUpdate(cmd *cobra.Command, args []string) error

func SetResourceExpiry

func SetResourceExpiry(ctx context.Context, client *api.Client, id string, expiryInput string) error

SetResourceExpiry updates only the expiry date of a resource.

Types

type ResourceJSONOutput

type ResourceJSONOutput struct {
	ID                *string        `json:"id,omitempty"`
	FolderParentID    *string        `json:"folder_parent_id,omitempty"`
	Name              *string        `json:"name,omitempty"`
	Username          *string        `json:"username,omitempty"`
	URI               *string        `json:"uri,omitempty"`
	Password          *string        `json:"password,omitempty"`
	Description       *string        `json:"description,omitempty"`
	CreatedTimestamp  *time.Time     `json:"created_timestamp,omitempty"`
	ModifiedTimestamp *time.Time     `json:"modified_timestamp,omitempty"`
	Metadata          map[string]any `json:"metadata,omitempty"`
	Secret            map[string]any `json:"secret,omitempty"`
	// Non-pointer bool without omitempty so `false` reaches output.
	Deleted bool `json:"deleted"`
	Expired bool `json:"expired"`
	// Nullable timestamp: omitted when Resource.Expired is nil.
	ExpiredAt      *time.Time `json:"expired_at,omitempty"`
	ResourceTypeID *string    `json:"resource_type_id,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL