Documentation ¶
Index ¶
- Constants
- Variables
- func GetDefaultConfigFiles(codeRootPath string) string
- func GetHttpClient(sdkConfig *SdkConfig) *http.Client
- func GetPreparedApiClient(sdkConfig *SdkConfig) (*apiclient.PydioAPIV2, context.Context, error)
- func SetUpEnvironment(configFilePath string) error
- func Version() *hashiversion.Version
- type SdkConfig
Constants ¶
View Source
const ( // KeyS3BearerHeader is the leagacy additional header used by Pydio Cells API // to authenticate the request to the twicked S3 API. KeyS3BearerHeader = "X-Pydio-Bearer" )
Variables ¶
View Source
var ( // PackageType stores and exposes current package type. PackageType string // PackageLabel stores and exposes current package label. PackageLabel string // BuildStamp stores the current build stamp. BuildStamp string // BuildRevision stores the current build version. BuildRevision string // RunEnvAwareTests flag permits easy switch off of all tests // that will not pass in basic environment, typically in TeamCity, without specific configuration RunEnvAwareTests = false // TODO enhance )
View Source
var (
ApiResourcePath = "/api/v2"
)
View Source
var (
// Keys to retrieve configuration via environment variables
KeyProtocol, KeyURL, KeyPath, KeyUser, KeyPassword, KeySkipVerify = "TARGET_PROTOCOL", "TARGET_URL", "TARGET_PATH", "TARGET_USER", "TARGET_PASSWORD", "TARGET_SKIP_VERIFY"
)
Functions ¶
func GetDefaultConfigFiles ¶
GetDefaultConfigFiles simply retrieves absolute path for cells and s3 SDK config files give the absolute path to the root of the pydio-sdk-go source code folder.
func GetHttpClient ¶
func GetPreparedApiClient ¶
GetPreparedApiClient connects to the Pydio Cells server defined by this config. Also returns a context to be used in subsequent requests.
func SetUpEnvironment ¶
SetUpEnvironment retrieves parameter to configure the environment (either by env variable or json file) and stores them in the DefaultCOnfig of the SDK.
func Version ¶
func Version() *hashiversion.Version
Version retrieves the current build version of the app. Note that this is updated via the linker upon build.
Types ¶
type SdkConfig ¶
type SdkConfig struct { // Protocol used: http, https or wss. Protocol string `json:"protocol"` // Url stores domain name or IP & port to the server. Url string `json:"url"` // Path may add an addition path segment to access server, e.g; /pydio Path string `json:"path"` // Pydio User Authentication User string `json:"user"` Password string `json:"password"` // Disable SSL check for self-signed certificates - not recommended SkipVerify bool `json:"skipVerify"` }
SdkConfig contains necessary data to connect to Pydio Cells API.
var (
DefaultConfig *SdkConfig
)
Click to show internal directories.
Click to hide internal directories.