libcompose: github.com/docker/libcompose/lookup Index | Files

package lookup

import "github.com/docker/libcompose/lookup"

Index

Package Files

composable.go envfile.go file.go simple_env.go

type ComposableEnvLookup Uses

type ComposableEnvLookup struct {
    Lookups []config.EnvironmentLookup
}

ComposableEnvLookup is a structure that implements the project.EnvironmentLookup interface. It holds an ordered list of EnvironmentLookup to call to look for the environment value.

func (*ComposableEnvLookup) Lookup Uses

func (l *ComposableEnvLookup) Lookup(key string, config *config.ServiceConfig) []string

Lookup creates a string slice of string containing a "docker-friendly" environment string in the form of 'key=value'. It loop through the lookups and returns the latest value if more than one lookup return a result.

type EnvfileLookup Uses

type EnvfileLookup struct {
    Path string
}

EnvfileLookup is a structure that implements the project.EnvironmentLookup interface. It holds the path of the file where to lookup environment values.

func (*EnvfileLookup) Lookup Uses

func (l *EnvfileLookup) Lookup(key string, config *config.ServiceConfig) []string

Lookup creates a string slice of string containing a "docker-friendly" environment string in the form of 'key=value'. It gets environment values using a '.env' file in the specified path.

type FileResourceLookup Uses

type FileResourceLookup struct {
}

FileResourceLookup is a "bare" structure that implements the project.ResourceLookup interface

func (*FileResourceLookup) Lookup Uses

func (f *FileResourceLookup) Lookup(file, relativeTo string) ([]byte, string, error)

Lookup returns the content and the actual filename of the file that is "built" using the specified file and relativeTo string. file and relativeTo are supposed to be file path. If file starts with a slash ('/'), it tries to load it, otherwise it will build a filename using the folder part of relativeTo joined with file.

func (*FileResourceLookup) ResolvePath Uses

func (f *FileResourceLookup) ResolvePath(path, relativeTo string) string

ResolvePath returns the path to be used for the given path volume. This function already takes care of relative paths.

type OsEnvLookup Uses

type OsEnvLookup struct {
}

OsEnvLookup is a "bare" structure that implements the project.EnvironmentLookup interface

func (*OsEnvLookup) Lookup Uses

func (o *OsEnvLookup) Lookup(key string, config *config.ServiceConfig) []string

Lookup creates a string slice of string containing a "docker-friendly" environment string in the form of 'key=value'. It gets environment values using os.Getenv. If the os environment variable does not exists, the slice is empty. serviceName and config are not used at all in this implementation.

Package lookup imports 9 packages (graph) and is imported by 30 packages. Updated 2017-10-28. Refresh now. Tools for package owners.