envs

package
v0.0.0-...-82567e2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsMap

func AsMap(env Environment) map[string]string

AsMap returns the extracted environment variables

func AsSlice

func AsSlice(env Environment) []string

AsSlice returns the extracted environment variables

func AsString

func AsString(env Environment) string

AsString returns a string representation of the environment variables

func LoadDotEnv

func LoadDotEnv(vars map[string]string, scriptDir string) map[string]string

find .env in the script directory and up SHOULD ONLY be enabled on demand, so that Symfony has the priority so this feature is only useful for when you want to load a .env file that you are NOT loading yourself, so everything but PHP scripts and here, we only have PHP scripts anyway

Types

type Environment

type Environment interface {
	Path() string
	Mailer() Envs
	Language() string
	Relationships() Relationships
	Extra() Envs
	Local() bool
}

Environment knows how to extract env vars (local or remote)

func GetEnv

func GetEnv(dir string, debug bool) (Environment, error)

type Envs

type Envs map[string]string

type Local

type Local struct {
	Dir       string
	Debug     bool
	Tunnel    string
	TunnelEnv bool
	DockerEnv bool
}

Local represents the local project

func NewLocal

func NewLocal(path string, debug bool) (*Local, error)

NewLocal creates a new local project

func (*Local) Extra

func (l *Local) Extra() Envs

Extra adds some env specific env vars

func (*Local) FindHttpServices

func (l *Local) FindHttpServices() []string

func (*Local) FindRelationshipPrefix

func (l *Local) FindRelationshipPrefix(frel, fscheme string) string

func (*Local) FindServiceUrl

func (l *Local) FindServiceUrl(serviceOrRelationship string) (string, bool)

func (*Local) Language

func (l *Local) Language() string

func (*Local) Local

func (l *Local) Local() bool

Local returns true if the command is used on a local machine

func (*Local) Mailer

func (l *Local) Mailer() Envs

Mail catchers are handled like regular services

func (*Local) Path

func (l *Local) Path() string

Path returns the project's path

func (*Local) Relationships

func (l *Local) Relationships() Relationships

Relationships returns envs from Platform.sh relationships or a local Docker setup

func (*Local) RelationshipsFromDocker

func (l *Local) RelationshipsFromDocker() Relationships

type Relationships

type Relationships map[string][]map[string]interface{}

type Remote

type Remote struct {
	Debug bool
}

Remote represents the Symfony platform

func (*Remote) Extra

func (r *Remote) Extra() Envs

Extra adds some env specific env vars

func (*Remote) Language

func (r *Remote) Language() string

func (*Remote) Local

func (r *Remote) Local() bool

Local returns true if the command is used on a local machine

func (*Remote) Mailer

func (r *Remote) Mailer() Envs

Mailer returns MAILER_* env vars

func (*Remote) Path

func (r *Remote) Path() string

Path returns the project's path

func (*Remote) Relationships

func (r *Remote) Relationships() Relationships

Relationships returns envs from Symfony relationships

type Tunnel

type Tunnel struct {
	Project *platformsh.Project
	Worker  string
	Debug   bool
}

func (*Tunnel) Expose

func (t *Tunnel) Expose(expose bool) error

func (*Tunnel) IsExposed

func (t *Tunnel) IsExposed() bool

type URL

type URL struct {
	Key string `json:"-"`

	Kind        string `json:"type"`
	To          string
	Upstream    string
	OriginalURL string `json:"original_url"`
	// contains filtered or unexported fields
}

type URLSlice

type URLSlice []URL

func (*URLSlice) UnmarshalJSON

func (s *URLSlice) UnmarshalJSON(b []byte) error

UnmarshalJSON for map slice.

Jump to

Keyboard shortcuts

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