Documentation ¶
Index ¶
- type Project
- func (p *Project) BuildServices(fs afero.Fs) (chan ServiceBuildUpdate, error)
- func (p *Project) CollectServicesRequirements() ([]*collector.ServiceRequirements, error)
- func (p *Project) GetServices() []Service
- func (p *Project) RunServices(localCloud *cloud.LocalCloud, stop <-chan bool, ...) error
- func (p *Project) RunServicesWithCommand(localCloud *cloud.LocalCloud, stop <-chan bool, ...) error
- type ProjectConfiguration
- type RunContainerOption
- type RuntimeConfiguration
- type Service
- func (s *Service) BuildImage(fs afero.Fs, logs io.Writer) error
- func (s *Service) GetAbsoluteFilePath() (string, error)
- func (s *Service) GetFilePath() string
- func (s *Service) Run(stop <-chan bool, updates chan<- ServiceRunUpdate, env map[string]string) error
- func (s *Service) RunContainer(stop <-chan bool, updates chan<- ServiceRunUpdate, opts ...RunContainerOption) error
- type ServiceBuildStatus
- type ServiceBuildUpdate
- type ServiceConfiguration
- type ServiceRunStatus
- type ServiceRunUpdate
- type ServiceRunUpdateWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Project ¶
type Project struct { Name string Directory string Preview []preview.Feature // contains filtered or unexported fields }
func FromFile ¶
FromFile - Loads a nitric project from a nitric.yaml file If no filepath is provided, the default location './nitric.yaml' is used
func (*Project) BuildServices ¶ added in v1.34.0
func (p *Project) BuildServices(fs afero.Fs) (chan ServiceBuildUpdate, error)
BuildServices - Builds all the services in the project
func (*Project) CollectServicesRequirements ¶ added in v1.34.0
func (p *Project) CollectServicesRequirements() ([]*collector.ServiceRequirements, error)
func (*Project) GetServices ¶ added in v1.34.0
func (*Project) RunServices ¶ added in v1.34.0
func (p *Project) RunServices(localCloud *cloud.LocalCloud, stop <-chan bool, updates chan<- ServiceRunUpdate) error
RunServices - Runs all the services as containers use the stop channel to stop all running services
func (*Project) RunServicesWithCommand ¶ added in v1.34.0
func (p *Project) RunServicesWithCommand(localCloud *cloud.LocalCloud, stop <-chan bool, updates chan<- ServiceRunUpdate) error
RunServices - Runs all the services locally using a startup command use the stop channel to stop all running services
type ProjectConfiguration ¶ added in v1.34.0
type ProjectConfiguration struct { Name string `yaml:"name"` Directory string `yaml:"-"` Services []ServiceConfiguration `yaml:"services"` Runtimes map[string]RuntimeConfiguration `yaml:"runtimes,omitempty"` Preview []preview.Feature `yaml:"preview,omitempty"` }
func ConfigurationFromFile ¶ added in v1.34.0
func ConfigurationFromFile(fs afero.Fs, filePath string) (*ProjectConfiguration, error)
type RunContainerOption ¶ added in v1.34.0
type RunContainerOption func(*runContainerOptions)
func WithEnvVars ¶ added in v1.34.0
func WithEnvVars(envVars map[string]string) RunContainerOption
func WithNitricEnvironment ¶ added in v1.34.0
func WithNitricEnvironment(environment string) RunContainerOption
func WithNitricHost ¶ added in v1.34.0
func WithNitricHost(host string) RunContainerOption
func WithNitricPort ¶ added in v1.34.0
func WithNitricPort(port string) RunContainerOption
type RuntimeConfiguration ¶ added in v1.34.0
type Service ¶ added in v1.34.0
func (*Service) BuildImage ¶ added in v1.34.0
func (*Service) GetAbsoluteFilePath ¶ added in v1.34.0
func (*Service) GetFilePath ¶ added in v1.34.0
func (*Service) Run ¶ added in v1.34.0
func (s *Service) Run(stop <-chan bool, updates chan<- ServiceRunUpdate, env map[string]string) error
Run - runs the service using the provided command, typically not in a container.
func (*Service) RunContainer ¶ added in v1.34.0
func (s *Service) RunContainer(stop <-chan bool, updates chan<- ServiceRunUpdate, opts ...RunContainerOption) error
RunContainer - Runs a container for the service, blocking until the container exits
type ServiceBuildStatus ¶ added in v1.34.0
type ServiceBuildStatus string
const ( ServiceBuildStatus_InProgress ServiceBuildStatus = "In Progress" ServiceBuildStatus_Complete ServiceBuildStatus = "Complete" ServiceBuildStatus_Error ServiceBuildStatus = "Error" )
type ServiceBuildUpdate ¶ added in v1.34.0
type ServiceBuildUpdate struct { ServiceName string Message string Status ServiceBuildStatus Err error }
type ServiceConfiguration ¶ added in v1.34.0
type ServiceConfiguration struct { // This is the string version Match string `yaml:"match"` // This is the custom runtime version (is custom if not nil, we auto-detect a standard language runtime) Runtime string `yaml:"runtime"` // This allows specifying a particular service type (e.g. "Job"), this is optional and custom service types can be defined for each stack Type string `yaml:"type"` // This is a command that will be use to run these services when using nitric start Start string `yaml:"start"` }
type ServiceRunStatus ¶ added in v1.34.0
type ServiceRunStatus string
const ( ServiceRunStatus_Running ServiceRunStatus = "Running" ServiceRunStatus_Done ServiceRunStatus = "Done" ServiceRunStatus_Error ServiceRunStatus = "Error" )
type ServiceRunUpdate ¶ added in v1.34.0
type ServiceRunUpdate struct { ServiceName string Filepath string Message string Status ServiceRunStatus Err error }
type ServiceRunUpdateWriter ¶ added in v1.34.0
type ServiceRunUpdateWriter struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.