Documentation
¶
Index ¶
- Variables
- func ClearKeyring(c *cells_sdk.SdkConfig) error
- func ConfigFromKeyring(conf *cells_sdk.SdkConfig) error
- func ConfigToKeyring(conf *cells_sdk.SdkConfig) error
- func DefaultConfigFilePath() string
- func GetApiClient(anonymous ...bool) (context.Context, *client.PydioCellsRest, error)
- func GetFile(pathToFile string) (io.Reader, int, error)
- func GetS3Client() (*s3.S3, string, error)
- func OAuthExchangeCode(c *cells_sdk.SdkConfig, code, callbackUrl string) error
- func OAuthPrepareUrl(serverUrl, clientId, clientSecret, state string, browser bool) (redirectUrl string, callbackUrl string, e error)
- func PutFile(pathToFile string, content io.ReadSeeker, checkExists bool) (*s3.PutObjectOutput, error)
- func RefreshIfRequired(conf *cells_sdk.SdkConfig) (bool, error)
- func RetryCallback(callback func() error, number int, interval time.Duration) error
- func SetUpEnvironment(configFilePath string, s3ConfigFilePath ...string) error
- func StatNode(pathToFile string) (*models.TreeNode, bool)
Constants ¶
This section is empty.
Variables ¶
var ( DefaultConfig *cells_sdk.SdkConfig DefaultS3Config *cells_sdk.S3Config // Keys to retrieve configuration via environment variables KeyURL, KeyClientKey, KeyClientSecret, KeyUser, KeyPassword, KeySkipVerify = "TARGET_URL", "TARGET_CLIENT_KEY", "TARGET_CLIENT_SECRET", "TARGET_USER", "TARGET_PASSWORD", "TARGET_SKIP_VERIFY" // Keys to retrieve environment variables to configure a connection to Pydio Cells S3 API KeyS3Endpoint, KeyS3Region, KeyS3Bucket, KeyS3ApiKey, KeyS3ApiSecret, KeyS3UsePydioSpecificHeader, KeyS3IsDebug = "TARGET_S3_ENDPOINT", "TARGET_S3_REGION", "TARGET_S3_BUCKET", "TARGET_S3_API_KEY", "TARGET_S3_API_SECRET", "TARGET_S3_USE_PYDIO_SPECIFIC_HEADER", "TARGET_S3_IS_DEBUG" )
Functions ¶
func ClearKeyring ¶
func ClearKeyring(c *cells_sdk.SdkConfig) error
ClearKeyring removes tokens from local keychain, if they are present
func ConfigFromKeyring ¶
func ConfigFromKeyring(conf *cells_sdk.SdkConfig) error
ConfigFromKeyring tries to find tokens inside local keychain and feed the conf with them
func ConfigToKeyring ¶
func ConfigToKeyring(conf *cells_sdk.SdkConfig) error
ConfigToKeyring tries to store tokens in local keychain and remove them from the conf
func DefaultConfigFilePath ¶
func DefaultConfigFilePath() string
func GetApiClient ¶
GetApiClient connects to the Pydio Cells server defined by this config, by sending an authentication request to the OIDC service to get a valid JWT (or taking the JWT from cache). It also returns a context to be used in subsequent requests.
func OAuthExchangeCode ¶
OAuthExchangeCode gets an OAuth code and retrieves an AccessToken/RefreshToken pair. It updates the passed Conf
func OAuthPrepareUrl ¶
func OAuthPrepareUrl(serverUrl, clientId, clientSecret, state string, browser bool) (redirectUrl string, callbackUrl string, e error)
OAuthPrepareUrl makes a URL that can be opened in browser or copy/pasted by user
func PutFile ¶
func PutFile(pathToFile string, content io.ReadSeeker, checkExists bool) (*s3.PutObjectOutput, error)
func RefreshIfRequired ¶
RefreshIfRequired refreshes the token inside the given conf if required
func RetryCallback ¶
RetryCallback implements boiler plate code to easily call the same function until it suceeds or a time-out is reached.
func SetUpEnvironment ¶
SetUpEnvironment retrieves parameters and stores them in the DefaultConfig of the SDK. configFilePath and s3ConfigFilePath can be <nil> if the parameters are defined via env variables.
Types ¶
This section is empty.