Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyUpdate(ctx context.Context, p *UpdatePackage, dryRun bool, pgChan chan float64, ...)
- func BuildParams(source []string, targetFolder string, targetParent bool) string
- func CheckKeyring() error
- func CleanURL(input string) (string, error)
- func ClearKeyring(c *CecConfig) error
- func ConfigFromKeyring(conf *CecConfig) error
- func ConfigToKeyring(conf *CecConfig) error
- func CopyJob(ctx context.Context, jsonParams string) (string, error)
- func CopyParams(source []string, targetFolder string) string
- func CreateSimpleFolderLink(ctx context.Context, targetNodeUuid, label string) (*models.RestShareLink, error)
- func DefaultConfigDirPath() string
- func DefaultConfigFilePath() string
- func DeleteNode(ctx context.Context, paths []string) (jobUUIDs []string, e error)
- func GetAllBulkMeta(ctx context.Context, path string) (nodes []*models.TreeNode, err error)
- func GetApiClient(anonymous ...bool) (*client.PydioCellsRestAPI, error)
- func GetConfigFilePath() string
- func GetFile(ctx context.Context, pathToFile string) (io.Reader, int, error)
- func GetS3Client(ctx context.Context) (*s3.Client, string, error)
- func GetTaskStatusForJob(ctx context.Context, jobID string) (status models.JobsTaskStatus, msg string, pg float32, e error)
- func IsForbiddenError(err error) bool
- func ListNodesPath(ctx context.Context, path string) ([]string, error)
- func MonitorJob(ctx context.Context, JobID string) (err error)
- func MoveJob(ctx context.Context, jsonParams string) (string, error)
- func MoveParams(source []string, targetFolder string) string
- func NewCellsConfigStore() cells_sdk.ConfigStore
- func PutFile(ctx context.Context, pathToFile string, content io.ReadSeeker, ...) (*s3.PutObjectOutput, error)
- func RandString(n int) string
- func RenameParams(source []string, targetFolder string) string
- func RetrieveCurrentSessionLogin() (string, error)
- func RetrieveRemoteServerVersion() (*common.ServerVersion, error)
- func RetrieveSessionLogin(newConf *CecConfig) (string, error)
- func RetryCallback(callback func() error, number int, interval time.Duration) error
- func RunJob(ctx context.Context, jobName string, jsonParams string) (string, error)
- func SetConfigFilePath(confPath string)
- func StandardizeLink(old string) string
- func StatNode(ctx context.Context, pathToFile string) (*models.TreeNode, bool)
- func TreeCreateNodes(nodes []*models.TreeNode) error
- func Unique(length int) string
- func UpdateConfig(newConf *CecConfig) error
- func ValidURL(input string) error
- type BarsPool
- type CecConfig
- type CellsConfigStore
- type ConfigList
- type CrawlNode
- func (c *CrawlNode) Base() string
- func (c *CrawlNode) CopyAll(ctx context.Context, dd []*CrawlNode, pool *BarsPool) (errs []error)
- func (c *CrawlNode) CopyAllVerbose(ctx context.Context, dd []*CrawlNode) (errs []error)
- func (c *CrawlNode) Dir() string
- func (c *CrawlNode) Join(p ...string) string
- func (c *CrawlNode) MkdirAll(ctx context.Context, dd []*CrawlNode, pool *BarsPool) error
- func (c *CrawlNode) Walk(ctx context.Context, current ...string) (children []*CrawlNode, e error)
- type PgReader
- type UpdatePackage
- type UpdateRequest
- type UpdateResponse
Constants ¶
const LetterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
const NoKeyringMsg = "" /* 132-byte string literal not displayed */
NoKeyringMsg warns end user when no keyring is found
Variables ¶
var ( DryRun bool PoolSize = 3 )
var CellsStore = NewCellsConfigStore()
Functions ¶
func ApplyUpdate ¶
func CheckKeyring ¶
func CheckKeyring() error
CheckKeyring simply tries a write followed by a read in the local keyring and returns nothing if it works or an error otherwise.
func ClearKeyring ¶
ClearKeyring removes sensitive info from the local keychain, if they are present.
func ConfigFromKeyring ¶
ConfigFromKeyring tries to find sensitive info inside local keychain and feed the conf.
func ConfigToKeyring ¶
ConfigToKeyring stores sensitive information in local keyring if any and removes it from current SDK config.
func CopyParams ¶
func CreateSimpleFolderLink ¶
func DefaultConfigDirPath ¶
func DefaultConfigDirPath() string
func DefaultConfigFilePath ¶
func DefaultConfigFilePath() string
func GetAllBulkMeta ¶ added in v4.1.0
func GetApiClient ¶
func GetApiClient(anonymous ...bool) (*client.PydioCellsRestAPI, error)
GetApiClient returns a client to directly communicate with the Pydio Cells REST API. Requests are anonymous when corresponding flag is set. Otherwise, the authentication is managed by the client, using the current active SDKConfig to provide valid credentials.
func GetConfigFilePath ¶
func GetConfigFilePath() string
func GetS3Client ¶
GetS3Client creates a new default S3 client based on current active config to transfer files to/from a distant Cells server.
func GetTaskStatusForJob ¶
func GetTaskStatusForJob(ctx context.Context, jobID string) (status models.JobsTaskStatus, msg string, pg float32, e error)
GetTaskStatusForJob retrieves the task status, progress and message.
func IsForbiddenError ¶
func MonitorJob ¶
MonitorJob monitors a job status every second.
func MoveParams ¶
func NewCellsConfigStore ¶ added in v4.1.0
func NewCellsConfigStore() cells_sdk.ConfigStore
func PutFile ¶
func PutFile(ctx context.Context, pathToFile string, content io.ReadSeeker, checkExists bool, errChan ...chan error) (*s3.PutObjectOutput, error)
func RandString ¶
func RenameParams ¶
func RetrieveCurrentSessionLogin ¶
RetrieveCurrentSessionLogin requests the registry of the current configured server & login and parse the result to get current user login. Typically useful when using PAT auth.
func RetrieveRemoteServerVersion ¶
func RetrieveRemoteServerVersion() (*common.ServerVersion, error)
RetrieveRemoteServerVersion gets the version info from the distant server. User must be authenticated (and admin ?).
func RetrieveSessionLogin ¶ added in v4.1.0
RetrieveSessionLogin tries to get the registry of the server defined by the passed configuration and parse the result to get current user login. Typically useful when using PAT auth.
func RetryCallback ¶
RetryCallback implements boilerplate code to easily call the same function until it succeeds or a time-out is reached.
func SetConfigFilePath ¶
func SetConfigFilePath(confPath string)
func StandardizeLink ¶
func TreeCreateNodes ¶
func UpdateConfig ¶
Types ¶
type BarsPool ¶
type BarsPool struct { *uiprogress.Progress // contains filtered or unexported fields }
func NewBarsPool ¶
type CecConfig ¶
type CecConfig struct { *cells_sdk.SdkConfig Label string `json:"label"` SkipKeyring bool `json:"skipKeyring"` CreatedAtVersion string `json:"createdAtVersion"` }
CecConfig extends the default SdkConfig with custom parameters.
var ( // DefaultConfig stores the current active config, we must initialise it to avoid nil panic dereference DefaultConfig *CecConfig DefaultTransport openapiruntime.ClientTransport )
func CloneConfig ¶ added in v4.0.1
func DefaultCecConfig ¶ added in v4.1.0
func DefaultCecConfig() *CecConfig
DefaultCecConfig simply creates a new configuration struct.
type CellsConfigStore ¶ added in v4.1.0
type CellsConfigStore struct {
// contains filtered or unexported fields
}
CellsConfigStore implements a Cells Client specific store for credentials. It wraps a keyring if such a tool is correctly configured and can be reached by the client.
func (*CellsConfigStore) RefreshIfRequired ¶ added in v4.1.0
func (store *CellsConfigStore) RefreshIfRequired(sdkConfig *cells_sdk.SdkConfig) (bool, error)
type ConfigList ¶
func GetConfigList ¶
func GetConfigList() (*ConfigList, error)
GetConfigList retrieves configuration stored in the config.json file.
func (*ConfigList) GetActiveConfig ¶
func (list *ConfigList) GetActiveConfig() (*CecConfig, error)
func (*ConfigList) GetStoredConfig ¶ added in v4.1.0
func (list *ConfigList) GetStoredConfig(id string) (*CecConfig, error)
func (*ConfigList) Remove ¶
func (list *ConfigList) Remove(id string) error
Remove unregisters a config from the list of available configurations by its ID.
func (*ConfigList) SaveConfigFile ¶
func (list *ConfigList) SaveConfigFile() error
SaveConfigFile saves inside the config file.
func (*ConfigList) SetActiveConfig ¶
func (list *ConfigList) SetActiveConfig(id string) error
type CrawlNode ¶
type CrawlNode struct { IsLocal bool IsDir bool FullPath string RelPath string MTime time.Time Size int64 NewFileName string os.FileInfo models.TreeNode }
CrawlNode enables processing the scp command step by step.
func NewCrawler ¶
func NewLocalNode ¶
NewLocalNode creates the base node for crawling in case of an upload.
func NewRemoteNode ¶
NewRemoteNode creates the base node for crawling in case of a download.
func (*CrawlNode) CopyAll ¶
CopyAll parallely performs the real upload/download of files that have been prepared during the Walk step.
func (*CrawlNode) CopyAllVerbose ¶ added in v4.1.0
CopyAllVerbose parallely performs the real upload/download of files that have been prepared. during the Walk step with no progress bar and rather more logs.
type PgReader ¶
func (*PgReader) CreateErrorChan ¶
type UpdatePackage ¶
type UpdatePackage struct { // Name of the application PackageName string `json:"PackageName,omitempty"` // Version of this new binary Version string `json:"Version,omitempty"` // Release date of the binary ReleaseDate int32 `json:"ReleaseDate,omitempty"` // Short human-readable description Label string `json:"Label,omitempty"` // Long human-readable description (markdown) Description string `json:"Description,omitempty"` // List or public URL of change logs ChangeLog string `json:"ChangeLog,omitempty"` // License of this package License string `json:"License,omitempty"` // Https URL where to download the binary BinaryURL string `json:"BinaryURL,omitempty"` // Checksum of the binary to verify its integrity BinaryChecksum string `json:"BinaryChecksum,omitempty"` // Signature of the binary BinarySignature string `json:"BinarySignature,omitempty"` // Hash type used for the signature BinaryHashType string `json:"BinaryHashType,omitempty"` // Size of the binary to download // BinarySize int64 `json:"BinarySize,omitempty"` BinarySize string `json:"BinarySize,omitempty"` // GOOS value used at build time BinaryOS string `json:"BinaryOS,omitempty"` // GOARCH value used at build time BinaryArch string `json:"BinaryArch,omitempty"` // Not used : if binary is a patch IsPatch bool `json:"IsPatch,omitempty"` // Not used : if a patch, how to patch (bsdiff support) PatchAlgorithm string `json:"PatchAlgorithm,omitempty"` }
func LoadUpdates ¶
func LoadUpdates(ctx context.Context, channel string) ([]*UpdatePackage, error)
type UpdateRequest ¶
type UpdateRequest struct { // Channel name. Channel string `json:"Channel,omitempty"` // PackageName is the technical name of the currently running application. PackageName string `json:"PackageName,omitempty"` // Current version of the application CurrentVersion string `json:"CurrentVersion,omitempty"` // Current GOOS GOOS string `json:"GOOS,omitempty"` // Current GOARCH GOARCH string `json:"GOARCH,omitempty"` // Not Used : specific service to get updates for ServiceName string `json:"ServiceName,omitempty"` // For enterprise version, info about the current license LicenseInfo map[string]string `json:"LicenseInfo,omitempty"` }
type UpdateResponse ¶
type UpdateResponse struct { Channel string `json:"Channel,omitempty"` // List of available binaries AvailableBinaries []*UpdatePackage `json:"AvailableBinaries,omitempty"` }