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 ¶
View Source
const ( CellsApiResourcePath = "/a" UserAgentKey = "User-Agent" )
Cells constants
View Source
const ( // AuthTypePat relies on a Personal Access Token generated on the server for a given user. AuthTypePat = "pat" // AuthTypeClientAuth is the legacy authentication method, based on user password: this is less secured. AuthTypeClientAuth = "session" // AuthTypeOAuth uses OAuth2 credential retrieval flow. AuthTypeOAuth = "oauth2" )
Supported Authentication types for v5+
View Source
const ( DefaultS3Region = "us-east-1" DefaultS3Bucket = "io" DefaultS3ApiSecret = "gatewaysecret" )
Default S3 parameters
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigRefresher ¶
type ConfigRefresherConsumer ¶
type ConfigRefresherConsumer interface {
SetConfigRefresher(ConfigRefresher)
}
type CredentialProviderOption ¶
type CredentialProviderOption func(aws.CredentialsProvider) aws.CredentialsProvider
type RoundTripOption ¶
type RoundTripOption func(http.RoundTripper) http.RoundTripper
type S3Config ¶
type S3Config struct { // 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"` // Bucket name, usually io. Bucket string `json:"bucket"` // RequestTimout overrides default HTTP request timeout when transfering files. RequestTimout int `json:"requestTimout,omitempty"` // Legacy // 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.
func NewS3Config ¶
func NewS3Config() *S3Config
type SdkConfig ¶
type SdkConfig struct { // Auth type is a convenience flag to store the type of authentication used by this SDK config // in v5, we support: PAT (Personal Access Token), OAuth2 (based on a JWT retrieved interactively via OAuth credential flow) and Basic (login/password, less secured) AuthType string `json:"authType,omitempty"` // Url stores domain name or IP & port to the server. Url string `json:"url"` // Username (login) for the currently configured Pydio Account User string `json:"user"` // IdToken might be a personal access Token (generated on your server) or an OAuth2 Token retrieved via the OIDC code flow. IdToken string `json:"idToken,omitempty"` // OIDC Code Flow additional info // RefreshToken holds the token to refresh your JWT. Warning: this token can be used only **once**, it is then blocked on the server side. RefreshToken string `json:"refreshToken,omitempty"` // TokenExpiresAt holds the expiration timestamp for the current JWT. TokenExpiresAt int `json:"tokenExpiresAt,omitempty"` // Password for client credential authentication (Legacy, less secure). Password string `json:"password,omitempty"` // SkipVerify tells the transport to ignore expired or self-signed TLS certificates. SkipVerify bool `json:"skipVerify"` // UseTokenCache flags if 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"` // CustomHeaders holds an optional list of headers to be overridden in requests, e.g. the User-Agent. CustomHeaders map[string]string }
SdkConfig stores parameters to talk to a running Cells instance REST API via the Go SDK.
type TokenProvider ¶
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. |
Click to show internal directories.
Click to hide internal directories.