platformsh

package
v0.0.0-...-474d2f3 Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatSVG  = "image/svg+xml"
	FormatGIF  = "image/gif"
	FormatICO  = "image/vnd.microsoft.icon"
	FormatJPG  = "image/jpeg"
	FormatPNG  = "image/png"
	FormatTIFF = "image/tiff"
)

Variables

This section is empty.

Functions

func DefaultFileSystem

func DefaultFileSystem(cwd string) afero.Fs

Types

type Access

type Access map[AccessType]AccessLevel

type AccessLevel

type AccessLevel uint8
const (
	AccessLevelViewer AccessLevel = iota
	AccessLevelContributor
	AccessLevelAdmin
)

func NewAccessLevel

func NewAccessLevel(name string) (AccessLevel, error)

func (AccessLevel) MarshalText

func (v AccessLevel) MarshalText() ([]byte, error)

func (AccessLevel) String

func (v AccessLevel) String() string

func (*AccessLevel) UnmarshalText

func (v *AccessLevel) UnmarshalText(text []byte) (err error)

type AccessType

type AccessType uint8
const (
	AccessTypeSSH AccessType = iota
)

func NewAccessType

func NewAccessType(name string) (AccessType, error)

func (AccessType) MarshalText

func (v AccessType) MarshalText() ([]byte, error)

func (AccessType) String

func (v AccessType) String() string

func (*AccessType) UnmarshalText

func (v *AccessType) UnmarshalText(text []byte) (err error)

type AggregateError

type AggregateError []error

func (AggregateError) Append

func (e AggregateError) Append(errors ...error) AggregateError

noinspection GoAssignmentToReceiver

func (AggregateError) Error

func (e AggregateError) Error() string

type Application

type Application struct {
	ApplicationCore
	Web     Web     `json:"web"`
	Hooks   Hooks   `json:"hooks"`
	Crons   Crons   `json:"crons"`
	Workers Workers `json:"workers"`
	TreeID  string  `json:"tree_id"`
	SlugID  string  `json:"slug_id"`
	AppDir  string  `json:"app_dir"`
}

type ApplicationBase

type ApplicationBase struct {
	Size          ServiceSize `json:"size"`
	Disk          uint32      `json:"disk"`
	Access        Access      `json:"access"`
	Relationships StringMap   `json:"relationships"`
	Mounts        Mounts      `json:"mounts"`
	Timezone      string      `json:"timezone"` // TODO: replace with serializable time.Location
	Variables     Variables   `json:"variables"`
}

type ApplicationBuilder

type ApplicationBuilder struct {
	ApplicationCore
	Dependencies JSONObject `json:"dependencies"`
	Build        Build      `json:"build"`
	Source       Source     `json:"source"`
}

type ApplicationCore

type ApplicationCore struct {
	ApplicationBase
	Name      string      `json:"name"`
	Type      string      `json:"type"`
	Runtime   interface{} `json:"runtime"`
	Preflight Preflight   `json:"preflight"`
}

type ApplicationMount

type ApplicationMount uint8
const (
	ApplicationMountLocal ApplicationMount = iota
	ApplicationMountTemp
	ApplicationMountService
)

func NewApplicationMount

func NewApplicationMount(name string) (ApplicationMount, error)

func (ApplicationMount) MarshalText

func (v ApplicationMount) MarshalText() ([]byte, error)

func (ApplicationMount) String

func (v ApplicationMount) String() string

func (*ApplicationMount) UnmarshalText

func (v *ApplicationMount) UnmarshalText(text []byte) (err error)

type Build

type Build struct {
	Flavor string `json:"flavor"`
	Caches Caches `json:"caches"`
}

type Cache

type Cache struct {
	Enabled    bool     `json:"enabled"`
	DefaultTTL int      `json:"default_ttl"`
	Cookies    []string `json:"cookies"`
	Headers    []string `json:"headers"`
}

type CacheConfiguration

type CacheConfiguration struct {
	Directory        string   `json:"directory"`
	Watch            []string `json:"watch"`
	AllowStale       bool     `json:"allow_stale"`
	ShareBetweenApps bool     `json:"share_between_apps"`
}

type Caches

type Caches map[string]CacheConfiguration

type ClientCertificateAuthority

type ClientCertificateAuthority struct {
	*x509.Certificate
}

func (ClientCertificateAuthority) MarshalText

func (v ClientCertificateAuthority) MarshalText() ([]byte, error)

func (*ClientCertificateAuthority) UnmarshalText

func (v *ClientCertificateAuthority) UnmarshalText(text []byte) error

type Commands

type Commands struct {
	Start string `json:"start"`
	Stop  string `json:"stop,omitempty"`
}

type Cron

type Cron struct {
	Spec string `json:"spec"`
	Cmd  string `json:"cmd"`
}

type Crons

type Crons map[string]Cron

type Duration

type Duration struct {
	time.Duration
}

func (Duration) MarshalText

func (v Duration) MarshalText() ([]byte, error)

func (*Duration) UnmarshalText

func (v *Duration) UnmarshalText(text []byte) (err error)

type Environment

type Environment interface {
	EnvironmentAPI

	Prefix() string

	FileSystem() afero.Fs
	SetFileSystem(afero.Fs)

	SetLookupFunc(LookupFunc)
	Lookup(string) (string, bool)

	ReadDotEnv()

	Listener() (net.Listener, error)

	Variable(key string) (interface{}, bool)
}

func NewEnvironment

func NewEnvironment(prefix string) Environment

type EnvironmentAPI

type EnvironmentAPI interface {
	Application() (*Application, error)
	ApplicationName() (string, error)
	AppName() (string, error)
	AppCommand() (string, error)
	ApplicationCommand() (string, error)
	AppDir() (string, error)
	Branch() (string, error)
	Dir() (string, error)
	DocumentRoot() (string, error)
	Environment() (string, error)
	Port() (string, error)
	Project() (string, error)
	ProjectEntropy() (string, error)
	Relationships() (Relationships, error)
	Routes() (Routes, error)
	SMTPHost() (string, error)
	Socket() (string, error)
	TreeID() (string, error)
	Variables() (JSONObject, error)
	Vars() (JSONObject, error)
	XClientCert() (string, error)
	XClientDN() (string, error)
	XClientIP() (string, error)
	XClientSSL() (string, error)
	XClientVerify() (string, error)
}

type HTTPAccess

type HTTPAccess struct {
	Addresses []string          `json:"addresses"`
	BasicAuth map[string]string `json:"basic_auth"`
}

type Hooks

type Hooks struct {
	Build      string `json:"build"`
	Deploy     string `json:"deploy"`
	PostDeploy string `json:"post_deploy"`
}

type JSONArray

type JSONArray = []interface{}

type JSONObject

type JSONObject = map[string]interface{}

type LookupFunc

type LookupFunc func(string) (string, bool)

type MissingEnvironment

type MissingEnvironment struct {
	Name       string
	InnerError error
}

func (MissingEnvironment) Error

func (e MissingEnvironment) Error() string

type Mount

type Mount struct {
	Source     ApplicationMount `json:"source"`
	SourcePath string           `json:"path"`
	Service    string           `json:"service,omitempty"`
}

type Mounts

type Mounts map[string]Mount

type Passthru

type Passthru struct {
	Enabled bool
	Path    string
}

func (Passthru) MarshalJSON

func (p Passthru) MarshalJSON() ([]byte, error)

func (*Passthru) UnmarshalJSON

func (p *Passthru) UnmarshalJSON(data []byte) error

type Preflight

type Preflight struct {
	Enabled      bool     `json:"enabled"`
	IgnoredRules []string `json:"ignored_rules"`
}
type RasterLogo struct {
	Size       int
	Background string
	Foreground string
}
func NewRasterLogo() RasterLogo

func (RasterLogo) Negotiate

func (x RasterLogo) Negotiate(c *gin.Context) render.Render

type RedirectPath

type RedirectPath struct {
	Regexp       bool     `json:"regexp"`
	To           string   `json:"to"`
	Prefix       bool     `json:"prefix"`
	AppendSuffix bool     `json:"append_suffix"`
	Code         int      `json:"code"`
	Expires      Duration `json:"expires"`
}

type RedirectPaths

type RedirectPaths map[string]RedirectPath

type Redirects

type Redirects struct {
	Expires Duration      `json:"expires"`
	Paths   RedirectPaths `json:"paths"`
}

type Relationship

type Relationship struct {
	Cluster  string     `json:"cluster"`
	Fragment string     `json:"fragment"`
	Host     string     `json:"host"`
	Hostname string     `json:"hostname"`
	IP       string     `json:"ip"`
	Password string     `json:"password"`
	Path     string     `json:"path"`
	Port     int        `json:"port"`
	Public   bool       `json:"public"`
	Query    JSONObject `json:"query"`
	Rel      string     `json:"rel"`
	Scheme   string     `json:"scheme"`
	Service  string     `json:"service"`
	SSL      JSONObject `json:"ssl"`
	Type     string     `json:"type"`
	Username string     `json:"username"`
}

func (Relationship) URL

func (r Relationship) URL(user, query bool) string

type Relationships

type Relationships map[string][]Relationship

func (Relationships) MongoDB

func (r Relationships) MongoDB(name string) (*mgo.Database, error)

func (Relationships) Postgresql

func (r Relationships) Postgresql(name string) (string, error)
type RenderRasterLogo struct {
	ContentType string
}

func (RenderRasterLogo) Render

func (RenderRasterLogo) WriteContentType

func (x RenderRasterLogo) WriteContentType(w http.ResponseWriter)

type Route

type Route struct {
	Primary        bool              `json:"primary"`
	ID             *string           `json:"id"`
	OriginalURL    string            `json:"original_url"`
	Attributes     map[string]string `json:"attributes"`
	Type           string            `json:"type"`
	Redirects      Redirects         `json:"redirects"`
	TLS            TLSSettings       `json:"tls"`
	HTTPAccess     HTTPAccess        `json:"http_access"`
	RestrictRobots bool              `json:"restrict_robots"`

	// Upstream Routes
	Cache    Cache  `json:"cache"`
	SSI      SSI    `json:"ssi"`
	Upstream string `json:"upstream"`

	// Redirect Routes
	To string `json:"to"`
}

type RouteIdentification

type RouteIdentification struct {
	Scheme string `json:"scheme"`
	Host   string `json:"host"`
	Path   string `json:"path"`
}

type RouteRepresentation

type RouteRepresentation struct {
	Project     string              `json:"project"`
	Environment string              `json:"environment"`
	Route       RouteIdentification `json:"route"`
}

type Routes

type Routes map[url.URL]Route

func (Routes) MarshalJSON

func (r Routes) MarshalJSON() ([]byte, error)

func (*Routes) UnmarshalJSON

func (r *Routes) UnmarshalJSON(text []byte) error

type SSI

type SSI struct {
	Enabled bool `json:"enabled"`
}
type SVGLogo struct {
	Background string
	Foreground string
}

func NewLogoSVG

func NewLogoSVG() SVGLogo

func (SVGLogo) Execute

func (x SVGLogo) Execute(w io.Writer) error

func (SVGLogo) Render

func (x SVGLogo) Render(w http.ResponseWriter) error

func (SVGLogo) WriteContentType

func (x SVGLogo) WriteContentType(w http.ResponseWriter)

type ServiceSize

type ServiceSize uint8
const (
	ServiceSizeAuto ServiceSize = iota
	ServiceSizeSmall
	ServiceSizeMedium
	ServiceSizeLarge
	ServiceSizeExtraLarge
	ServiceSizeDoubleExtraLarge
	ServiceSizeQuadrupleExtraLarge
)

func NewServiceSize

func NewServiceSize(name string) (ServiceSize, error)

func (ServiceSize) MarshalText

func (v ServiceSize) MarshalText() ([]byte, error)

func (ServiceSize) String

func (v ServiceSize) String() string

func (*ServiceSize) UnmarshalText

func (v *ServiceSize) UnmarshalText(text []byte) (err error)

type SocketFamily

type SocketFamily uint8
const (
	SocketFamilyTCP SocketFamily = iota
	SocketFamilyUnix
)

func NewSocketFamily

func NewSocketFamily(name string) (SocketFamily, error)

func (SocketFamily) MarshalText

func (v SocketFamily) MarshalText() ([]byte, error)

func (SocketFamily) String

func (v SocketFamily) String() string

func (*SocketFamily) UnmarshalText

func (v *SocketFamily) UnmarshalText(text []byte) (err error)

type SocketProtocol

type SocketProtocol uint8
const (
	SocketProtocolHTTP SocketProtocol = iota
	SocketProtocolFastCGI
	SocketProtocolUWSGI
)

func NewSocketProtocol

func NewSocketProtocol(name string) (SocketProtocol, error)

func (SocketProtocol) MarshalText

func (v SocketProtocol) MarshalText() ([]byte, error)

func (SocketProtocol) String

func (v SocketProtocol) String() string

func (*SocketProtocol) UnmarshalText

func (v *SocketProtocol) UnmarshalText(text []byte) (err error)

type Source

type Source struct {
	Operations SourceOperations `json:"operations"`
}

type SourceOperation

type SourceOperation struct {
	Command string `json:"command"`
}

type SourceOperations

type SourceOperations map[string]SourceOperation

type StringMap

type StringMap = map[string]string

type TLSSTS

type TLSSTS struct {
	Enabled           bool `json:"enabled"`
	IncludeSubdomains bool `json:"include_subdomains"`
	Preload           bool `json:"preload"`
}

type TLSSettings

type TLSSettings struct {
	StrictTransportSecurity      TLSSTS                       `json:"strict_transport_security"`
	MinVersion                   *TLSVersion                  `json:"min_version"`
	ClientAuthentication         string                       `json:"client_authentication"`
	ClientCertificateAuthorities []ClientCertificateAuthority `json:"client_certificate_authorities"`
}

type TLSVersion

type TLSVersion uint16
const (
	TLSv10 TLSVersion = iota + 0x0301
	TLSv11
	TLSv12
	TLSv13
	TLSv14
)

func NewTLSVersion

func NewTLSVersion(name string) (TLSVersion, error)

func (TLSVersion) MarshalText

func (v TLSVersion) MarshalText() ([]byte, error)

func (TLSVersion) String

func (v TLSVersion) String() string

func (*TLSVersion) UnmarshalText

func (v *TLSVersion) UnmarshalText(text []byte) (err error)

type Upstream

type Upstream struct {
	SocketFamily SocketFamily   `json:"socket_family"`
	Protocol     SocketProtocol `json:"socket_protocol"`
}

type Variables

type Variables map[string]JSONObject

type Web

type Web struct {
	// ApplicationBase
	Locations    WebLocations `json:"locations"`
	Commands     Commands     `json:"commands"`
	Upstream     Upstream     `json:"upstream"`
	DocumentRoot *string      `json:"document_root,omitempty"` // deprecated
	Passthru     *string      `json:"passthru,omitempty"`      // deprecated
	IndexFiles   []string     `json:"index_files,omitempty"`   // deprecated
	Whitelist    []string     `json:"whitelist,omitempty"`     // deprecated
	Blacklist    []string     `json:"blacklist,omitempty"`     // deprecated
	Expires      *Duration    `json:"expires,omitempty"`       // deprecated
	MoveToRoot   *bool        `json:"move_to_root,omitempty"`  // deprecated
}

type WebLocation

type WebLocation struct {
	Root     string    `json:"root"`
	Expires  Duration  `json:"expires"`
	Passthru Passthru  `json:"passthru"`
	Scripts  bool      `json:"scripts"`
	Index    []string  `json:"index"`
	Allow    bool      `json:"allow"`
	Headers  StringMap `json:"headers"`
	Rules    WebRules  `json:"rules"`
}

type WebLocations

type WebLocations map[string]WebLocation

type WebRule

type WebRule struct {
	Expires  Duration  `json:"expires"`
	Passthru Passthru  `json:"passthru"`
	Scripts  bool      `json:"scripts"`
	Allow    bool      `json:"allow"`
	Headers  StringMap `json:"headers"`
}

type WebRules

type WebRules map[string]WebRule

type Worker

type Worker struct {
	// ApplicationBase
	Commands Commands `json:"commands"`
}

type Workers

type Workers map[string]Worker

Jump to

Keyboard shortcuts

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