config

package
v0.0.0-...-23ce5c3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2019 License: Apache-2.0 Imports: 14 Imported by: 22

Documentation

Index

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

func GetDefaultConfigFiles(codeRootPath string) string

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 GetHttpClient(sdkConfig *SdkConfig) *http.Client

func GetPreparedApiClient

func GetPreparedApiClient(sdkConfig *SdkConfig) (*apiclient.PydioAPIV2, context.Context, error)

GetPreparedApiClient connects to the Pydio Cells server defined by this config. Also returns a context to be used in subsequent requests.

func SetUpEnvironment

func SetUpEnvironment(configFilePath string) error

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
)

Jump to

Keyboard shortcuts

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