cells_sdk

package module
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: Apache-2.0 Imports: 0 Imported by: 8

README

Cells API client

Legacy Rest API Client in go for Pydio Cells. Please see v2 subfolder.

WARNING LEGACY BRANCH

This version has been released with version 0.9 before cleaning and refactoring the API in order to provide backward compatibility for potential consumers of the SDK.

You should really rather use the v2 branch

Overview

Current SDK has been updated on Jul. 1st 2020 with git commit fdebe76 for Cells v2.1.0 release.

This API client was generated by the go-swagger project.

For more information, please visit https://pydio.com

How to use

Simply put the package under your project folder and add the following import:

    "github.com/pydio/cells-sdk-go"

The transport sub-package provides some utilitary methods to ease the set up of a communication with your target Cells instance, and you might find the few sample commands that are in the example package useful to jump in.

You can also have a look at the Cells client repository (also on Github) to see more working examples.

Documentation

Overview

Package cells_sdk provides a ready to use SDK to use the Cells REST API in Go language. It also provides some patterns that ease implementation of Go programs that use the SDK.

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultConfig stores a convenience static object that must be configured only once
	// and is globally accessible to easily retrieve an up-and-running connected client.
	DefaultConfig *SdkConfig
	// DefaultS3Config stores a convenience static object that must be configured only once
	// and is globally accessible to easily retrieve an up-and-running connected client.
	DefaultS3Config *S3Config
)

Functions

This section is empty.

Types

type S3Config

type S3Config struct {
	// Bucket name, usually io.
	Bucket string `json:"bucket"`
	// Endpoint overrides the default URL generated by the S3 SDK from the bucket name.
	Endpoint string `json:"enpoint"`
	// Region param, usually us-east-1
	Region string `json:"region"`
	// ApiKey is used by the Cells SDK to transmit the JWT token.
	ApiKey string `json:"apiKey"`
	// ApiSecret identifies this client.
	ApiSecret string `json:"apiSecret"`
	// Set to true to rather use legacy mode (JWT Auth is transmitted via custom 'X-Pydio-Bearer' header).
	UsePydioSpecificHeader bool `json:"usePydioSpecificHeader"`
	// IsDebug is a convenience legacy flag to add some logging to this S3 client.
	// Should be cleaned as soon as we defined the logging strategy for this repo.
	IsDebug bool `json:"isDebug"`
}

S3Config stores connection parameters to a running Cells instance S3 gateway via the AWS SDK for Go.

type SdkConfig

type SdkConfig struct {
	// Url stores domain name or IP & port to the server.
	Url string `json:"url"`

	// OIDC Code Flow
	IdToken        string `json:"idToken"`
	RefreshToken   string `json:"refreshToken"`
	TokenExpiresAt int    `json:"tokenExpiresAt"`

	// OIDC ClientKey / ClientSecret - Legacy stuff, not used anymore
	ClientKey    string `json:"clientKey"`
	ClientSecret string `json:"clientSecret"`
	// Pydio User Authentication
	User     string `json:"user"`
	Password string `json:"password"`

	// SkipVerify tells the transport to ignore expired or self-signed TLS certificates
	SkipVerify bool `json:"skipVerify"`

	// UseTokenCache flags wether we should rely on a local cache to avoid retrieving a new JWT token at each request.
	// It is useful to *not* use the cache when running connection tests for instance.
	UseTokenCache bool `json:"useTokenCache"`

	// Optional list of headers to override in requests, typically User-Agent
	CustomHeaders map[string]string
}

SdkConfig stores parameters to talk to a running Cells instance REST API via the Go SDK.

Directories

Path Synopsis
cmd
Package cmd implements some basic examples of what can be achieved when combining the use of the Go SDK for Cells with the powerful Cobra framework to implement CLI client applications for Cells.
Package cmd implements some basic examples of what can be achieved when combining the use of the Go SDK for Cells with the powerful Cobra framework to implement CLI client applications for Cells.
aws
mc

Jump to

Keyboard shortcuts

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