Documentation
¶
Index ¶
- Variables
- func Home() (string, error)
- func IsAFoldProject(path string) bool
- type ContainerAPI
- type NotAService
- type Project
- func (p *Project) AddService(svc Service)
- func (p *Project) ConfigureContainerAPI(b ContainerAPI)
- func (p *Project) ConfigureGatewayPort(port int)
- func (p *Project) ConfigureLogger(l logging.Logger)
- func (p *Project) Down() error
- func (p *Project) GetService(path string) (*Service, error)
- func (p *Project) GetServices(paths ...string) ([]*Service, error)
- func (p *Project) NewService(name string) *Service
- func (p *Project) SaveConfig(projectPath string) error
- func (p *Project) Up(ctx context.Context, out io.Writer, services ...*Service) error
- func (p *Project) Validate() error
- type Service
- func (s *Service) AbsPath() (string, error)
- func (s *Service) Build(ctx context.Context, out io.Writer) (*container.Image, error)
- func (s *Service) Id() string
- func (s *Service) Start(img *container.Image, net *container.Network) error
- func (s *Service) Stop() error
- func (s *Service) Validate() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ProjectNameRegex = `^[a-zA-Z][a-zA-Z-_]+$` NotAFoldProject = errors.New("fold.yaml not found") InvalidConfig = errors.New("invalid config file") CantWriteConfig = errors.New("can't write fold.yaml") )
View Source
var ( ServiceNameRegex = `^[a-z][a-z-_]+$` ServicePathInvalid = errors.New("cannot build an absolute path to the service") )
Functions ¶
func IsAFoldProject ¶
Types ¶
type ContainerAPI ¶
type ContainerAPI interface {
Context() context.Context
NewNetwork(name string) *container.Network
NetworkExists(net *container.Network) (bool, error)
CreateNetwork(net *container.Network) error
RemoveNetwork(net *container.Network) error
GetImage(name string) (*container.Image, error)
PullImage(name string) (*container.Image, error)
BuildImage(img *container.Image) error
NewContainer(
name string,
image container.Image,
mounts ...container.Mount,
) *container.Container
GetContainer(name string) (*container.Container, error)
RunContainer(net *container.Network, con *container.Container) error
StopContainer(con *container.Container) error
}
type NotAService ¶
type NotAService struct {
Service string
}
func (NotAService) Error ¶
func (nas NotAService) Error() string
type Project ¶
type Project struct {
Name string
Maintainer string
Email string
Repository string
Services []*Service
// contains filtered or unexported fields
}
func (*Project) AddService ¶
func (*Project) ConfigureContainerAPI ¶
func (p *Project) ConfigureContainerAPI(b ContainerAPI)
func (*Project) ConfigureGatewayPort ¶
func (*Project) ConfigureLogger ¶
func (*Project) GetService ¶
This works with either a path to a service or just a service name.
func (*Project) NewService ¶
func (*Project) SaveConfig ¶
Click to show internal directories.
Click to hide internal directories.