config

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (

	// ENV variables
	PodopsConfigPathEnv      = "PODOPS_CONFIG_PATH"
	PodopsStorageLocationEnv = "PODOPS_STORAGE_LOCATION"
	PodopsStaticLocationEnv  = "PODOPS_STATIC_LOCATION"
	PodopsBuildLocationEnv   = "PODOPS_BUILD_LOCATION"
	PodopsServiceEndpointEnv = "PODOPS_SERVICE_ENDPOINT"
	PodopsAPIEndpointEnv     = "PODOPS_API_ENDPOINT"
	PodopsContentEndpointEnv = "PODOPS_CONTENT_ENDPOINT"

	// default scopes
	ScopeContentAdmin  = "content:admin"
	ScopeContentEditor = "content:editor"
	ScopeContentRead   = "content:read"
	ScopeContentWrite  = "content:write"
)
View Source
const (
	DefaultTouchFile             = ".updated"
	DefaultConfigFileLocation    = ".podops/config"
	DefaultMasterKeyFileLocation = "master.key"
)
View Source
const (
	// Version specifies the verion of the API and its structs
	Version = "v1"

	// MajorVersion of the API
	MajorVersion = 0
	// MinorVersion of the API
	MinorVersion = 10
	// FixVersion of the API
	FixVersion = 0

	CmdLineName     = "po"
	ProjectName     = "podops"
	CopyrightString = "podops copyright 2022"
)

Variables

View Source
var (
	// StorageLocation is the root location for the cdn on the server
	StorageLocation = env.GetString(PodopsStorageLocationEnv, defaultStorageLocation)
	// StaticLocation is the root location for the static content on the server
	StaticLocation = env.GetString(PodopsStaticLocationEnv, defaultStaticLocation)
	// BuildLocation is the default location for podcast assets
	BuildLocation = env.GetString(PodopsBuildLocationEnv, defaultBuildLocation)
)
View Source
var (
	// VersionString is the canonical API description
	VersionString string = fmt.Sprintf("%d.%d.%d", MajorVersion, MinorVersion, FixVersion)
	// UserAgentString identifies any http request podops makes
	UserAgentString string = fmt.Sprintf("podops %d.%d.%d", MajorVersion, MinorVersion, FixVersion)
	// ServerString identifies the content server
	ServerString string = fmt.Sprintf("podops cdn %d.%d.%d", MajorVersion, MinorVersion, FixVersion)
)

Functions

func DefaultClientSettings

func DefaultClientSettings() *settings.DialSettings

DefaultClientSettings returns a configuration based defaults and ENV variables.

func DefaultConfigPath

func DefaultConfigPath() string

func LoadClientSettings

func LoadClientSettings(path string) (*settings.DialSettings, string)

LoadClientSettings loads the configuration from file. Stored values will be overwritten from ENV values if these are set.

func ResolveConfigPath

func ResolveConfigPath(path string) []string

func Settings

func Settings() *settings.DialSettings

func SettingsPath

func SettingsPath() string

func UpdateClientSettings

func UpdateClientSettings(path string) *settings.DialSettings

UpdateClientSettings load the configuration from the given path and updates the global settings.

func WithContentEndpoint

func WithContentEndpoint(url string) settings.ClientOption

WithContentEndpoint returns a ClientOption that overrides the default cdn endpoint to be used for a client.

func WithServiceEndpoint

func WithServiceEndpoint(url string) settings.ClientOption

WithServiceEndpoint returns a ClientOption that overrides the default service endpoint to be used for a client.

Types

This section is empty.

Jump to

Keyboard shortcuts

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