Documentation
¶
Index ¶
- Variables
- type DockerGenerator
- func (b *DockerGenerator) Err() error
- func (v *DockerGenerator) Name() string
- func (v *DockerGenerator) Services() []*services.ServiceConfig
- func (b *DockerGenerator) SetErr(err error)
- func (b *DockerGenerator) StartWalk(basePath string)
- func (b *DockerGenerator) StopWalk()
- func (v *DockerGenerator) VisitDir(path string) (bool, error)
- type EdwardGenerator
- func (b *EdwardGenerator) Err() error
- func (v *EdwardGenerator) Imports() []string
- func (v *EdwardGenerator) Name() string
- func (b *EdwardGenerator) SetErr(err error)
- func (b *EdwardGenerator) StartWalk(basePath string)
- func (b *EdwardGenerator) StopWalk()
- func (v *EdwardGenerator) VisitDir(path string) (bool, error)
- type Generator
- type GeneratorCollection
- type GoGenerator
- func (b *GoGenerator) Err() error
- func (v *GoGenerator) Name() string
- func (v *GoGenerator) Services() []*services.ServiceConfig
- func (b *GoGenerator) SetErr(err error)
- func (v *GoGenerator) StartWalk(path string)
- func (b *GoGenerator) StopWalk()
- func (v *GoGenerator) VisitDir(path string) (bool, error)
- type GroupGenerator
- type IcbmGenerator
- func (b *IcbmGenerator) Err() error
- func (v *IcbmGenerator) Name() string
- func (v *IcbmGenerator) Services() []*services.ServiceConfig
- func (b *IcbmGenerator) SetErr(err error)
- func (b *IcbmGenerator) StartWalk(basePath string)
- func (b *IcbmGenerator) StopWalk()
- func (v *IcbmGenerator) VisitDir(path string) (bool, error)
- type ImportGenerator
- type ProcfileGenerator
- func (b *ProcfileGenerator) Err() error
- func (v *ProcfileGenerator) Groups() []*services.ServiceGroupConfig
- func (v *ProcfileGenerator) Name() string
- func (v *ProcfileGenerator) Services() []*services.ServiceConfig
- func (b *ProcfileGenerator) SetErr(err error)
- func (b *ProcfileGenerator) StartWalk(basePath string)
- func (b *ProcfileGenerator) StopWalk()
- func (v *ProcfileGenerator) VisitDir(path string) (bool, error)
- type ServiceGenerator
Constants ¶
This section is empty.
Variables ¶
var SkipAll skipAllErr = skipAllErr("skipped")
SkipAll indicates that all generators should skip this directory and subdirectories.
Functions ¶
This section is empty.
Types ¶
type DockerGenerator ¶
type DockerGenerator struct {
// contains filtered or unexported fields
}
DockerGenerator generates services from Docker files. Services are generated from a Dockerfile.
The container is build with a tag based on the directory name suffixed with ':edward'. For a Dockerfile under 'service', the tag would be 'service:edward'.
Ports identified with EXPOSE in the Dockerfile will be forwarded from the container, with the local port matching the port in the container.
func (*DockerGenerator) Err ¶
func (b *DockerGenerator) Err() error
Err returns the most recent error from this generator
func (*DockerGenerator) Name ¶
func (v *DockerGenerator) Name() string
Name returns 'docker' to identify this generator
func (*DockerGenerator) Services ¶
func (v *DockerGenerator) Services() []*services.ServiceConfig
Services returns a slice of services identified in the directory walk
func (*DockerGenerator) SetErr ¶
func (b *DockerGenerator) SetErr(err error)
SetErr allows an error to be applied to this generator from outside
func (*DockerGenerator) StartWalk ¶
func (b *DockerGenerator) StartWalk(basePath string)
StartWalk lets a generator know that a directory walk has been started, with the given starting path
type EdwardGenerator ¶
type EdwardGenerator struct {
// contains filtered or unexported fields
}
EdwardGenerator generates imports for all Edward config files in the directory hierarchy.
func (*EdwardGenerator) Err ¶
func (b *EdwardGenerator) Err() error
Err returns the most recent error from this generator
func (*EdwardGenerator) Imports ¶
func (v *EdwardGenerator) Imports() []string
Imports returns all imports found during previous walks.
func (*EdwardGenerator) Name ¶
func (v *EdwardGenerator) Name() string
Name returns 'edward' to identify this generator.
func (*EdwardGenerator) SetErr ¶
func (b *EdwardGenerator) SetErr(err error)
SetErr allows an error to be applied to this generator from outside
func (*EdwardGenerator) StartWalk ¶
func (b *EdwardGenerator) StartWalk(basePath string)
StartWalk lets a generator know that a directory walk has been started, with the given starting path
type Generator ¶
type Generator interface { Name() string StartWalk(basePath string) StopWalk() VisitDir(path string) (bool, error) Err() error SetErr(err error) }
Generator provides an interface to identify a generator and perform a directory walk to find projects for configuration.
type GeneratorCollection ¶
GeneratorCollection provides the ability to execute multiple generators under the same path.
func (*GeneratorCollection) Generate ¶
func (g *GeneratorCollection) Generate() error
Generate walks over the directories under the GeneratorCollection's Path and runs each generator on each directory in turn. If a generator finds a match, no other generators may run in that directory and subdirectories.
func (*GeneratorCollection) Groups ¶
func (g *GeneratorCollection) Groups() []*services.ServiceGroupConfig
Groups returns any groups found during the Generate
func (*GeneratorCollection) Imports ¶
func (g *GeneratorCollection) Imports() []string
Imports returns any imports found during the Generate
func (*GeneratorCollection) Services ¶
func (g *GeneratorCollection) Services() []*services.ServiceConfig
Services returns any services found during the Generate
type GoGenerator ¶
type GoGenerator struct {
// contains filtered or unexported fields
}
GoGenerator generates go services from main packages
func (*GoGenerator) Err ¶
func (b *GoGenerator) Err() error
Err returns the most recent error from this generator
func (*GoGenerator) Name ¶
func (v *GoGenerator) Name() string
Name returns 'go' to identify this generator
func (*GoGenerator) Services ¶
func (v *GoGenerator) Services() []*services.ServiceConfig
Services returns the services generated during the last walk
func (*GoGenerator) SetErr ¶
func (b *GoGenerator) SetErr(err error)
SetErr allows an error to be applied to this generator from outside
func (*GoGenerator) StartWalk ¶
func (v *GoGenerator) StartWalk(path string)
StartWalk lets a generator know that a directory walk has been started, with the given starting path
type GroupGenerator ¶
type GroupGenerator interface {
Groups() []*services.ServiceGroupConfig
}
GroupGenerator provides an interface to return a slice of groups after performing a directory walk.
type IcbmGenerator ¶
type IcbmGenerator struct {
// contains filtered or unexported fields
}
IcbmGenerator generates services from an icbm build.spec file
func (*IcbmGenerator) Err ¶
func (b *IcbmGenerator) Err() error
Err returns the most recent error from this generator
func (*IcbmGenerator) Name ¶
func (v *IcbmGenerator) Name() string
Name returns 'icbm' to identify this generator
func (*IcbmGenerator) Services ¶
func (v *IcbmGenerator) Services() []*services.ServiceConfig
Services returns a slice of all the services generated during this walk
func (*IcbmGenerator) SetErr ¶
func (b *IcbmGenerator) SetErr(err error)
SetErr allows an error to be applied to this generator from outside
func (*IcbmGenerator) StartWalk ¶
func (b *IcbmGenerator) StartWalk(basePath string)
StartWalk lets a generator know that a directory walk has been started, with the given starting path
func (*IcbmGenerator) StopWalk ¶
func (b *IcbmGenerator) StopWalk()
StopWalk lets a generator know that a directory walk has been completed, so it can perform any necessary cleanup or consolidation.
func (*IcbmGenerator) VisitDir ¶
func (v *IcbmGenerator) VisitDir(path string) (bool, error)
VisitDir checks a directory for a build.spec file. If found, it will parse the file to obtain service definitions. Once a spec file has been parsed, true, filepath.SkipDir will be returned to ensure no further directories below this are parsed.
type ImportGenerator ¶
type ImportGenerator interface {
Imports() []string
}
ImportGenerator provides an interface to return a slice of Edward config file paths to be imported after a directory walk.
type ProcfileGenerator ¶
type ProcfileGenerator struct {
// contains filtered or unexported fields
}
ProcfileGenerator generates services and groups from Procfiles.
For each Procfile, a group is generated to contain a set of services, one per process in the Procfile.
The group is named for the directory containing the Procfile, services are named using the form '[group]:[process]'.
func (*ProcfileGenerator) Err ¶
func (b *ProcfileGenerator) Err() error
Err returns the most recent error from this generator
func (*ProcfileGenerator) Groups ¶
func (v *ProcfileGenerator) Groups() []*services.ServiceGroupConfig
Groups returns a slice of groups generated on previous walks
func (*ProcfileGenerator) Name ¶
func (v *ProcfileGenerator) Name() string
Name returns 'procfile' to identify this generator
func (*ProcfileGenerator) Services ¶
func (v *ProcfileGenerator) Services() []*services.ServiceConfig
Services returns a slice of services generated on previous walks
func (*ProcfileGenerator) SetErr ¶
func (b *ProcfileGenerator) SetErr(err error)
SetErr allows an error to be applied to this generator from outside
func (*ProcfileGenerator) StartWalk ¶
func (b *ProcfileGenerator) StartWalk(basePath string)
StartWalk lets a generator know that a directory walk has been started, with the given starting path
type ServiceGenerator ¶
type ServiceGenerator interface {
Services() []*services.ServiceConfig
}
ServiceGenerator provides an interface to return a slice of services after performing a directory walk.