Documentation ¶
Index ¶
- func BuildAndRunMigrations(fs afero.Fs, servers map[string]*sql.DatabaseServer, ...) error
- func BuildMigrationImage(fs afero.Fs, dbName string, buildContext *runtime.RuntimeBuildContext, ...) error
- func BuildMigrationImages(fs afero.Fs, migrationBuildContexts map[string]*runtime.RuntimeBuildContext) (chan ServiceBuildUpdate, error)
- func GetTempBuildDir() string
- func NewBuildUpdateWriter(serviceName string, buildUpdateChan chan ServiceBuildUpdate) io.Writer
- func RunMigration(databaseName string, connectionString string) error
- func RunMigrations(servers map[string]*sql.DatabaseServer) error
- type BaseService
- type BaseServiceConfiguration
- type Batch
- func (s *Batch) BuildImage(fs afero.Fs, logs io.Writer) error
- func (s *Batch) GetAbsoluteFilePath() (string, error)
- func (s *Batch) GetFilePath() string
- func (s *Batch) Run(stop <-chan bool, updates chan<- ServiceRunUpdate, env map[string]string) error
- func (s *Batch) RunContainer(stop <-chan bool, updates chan<- ServiceRunUpdate, opts ...RunContainerOption) error
- type BatchConfiguration
- type DatabaseMigrationState
- type LocalMigration
- type Project
- func (p *Project) BuildBatches(fs afero.Fs) (chan ServiceBuildUpdate, error)
- func (p *Project) BuildServices(fs afero.Fs) (chan ServiceBuildUpdate, error)
- func (p *Project) CollectBatchRequirements() ([]*collector.BatchRequirements, error)
- func (p *Project) CollectServicesRequirements() ([]*collector.ServiceRequirements, error)
- func (p *Project) DefaultMigrationImage(fs afero.Fs) (string, bool)
- func (p *Project) GetBatchServices() []Batch
- func (p *Project) GetServices() []Service
- func (p *Project) RunBatches(localCloud *cloud.LocalCloud, stop <-chan bool, ...) error
- func (p *Project) RunBatchesWithCommand(localCloud *cloud.LocalCloud, stop <-chan bool, ...) error
- 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 ¶
func BuildAndRunMigrations ¶ added in v1.53.0
func BuildAndRunMigrations(fs afero.Fs, servers map[string]*sql.DatabaseServer, databasesToMigrate map[string]*resourcespb.SqlDatabaseResource) error
func BuildMigrationImage ¶ added in v1.42.0
func BuildMigrationImages ¶ added in v1.42.0
func BuildMigrationImages(fs afero.Fs, migrationBuildContexts map[string]*runtime.RuntimeBuildContext) (chan ServiceBuildUpdate, error)
FIXME: This is essentially a copy of the project.BuildServiceImages function
func GetTempBuildDir ¶ added in v1.53.0
func GetTempBuildDir() string
func NewBuildUpdateWriter ¶ added in v1.53.0
func NewBuildUpdateWriter(serviceName string, buildUpdateChan chan ServiceBuildUpdate) io.Writer
func RunMigration ¶ added in v1.53.0
Run the migrations
func RunMigrations ¶ added in v1.53.0
func RunMigrations(servers map[string]*sql.DatabaseServer) error
Types ¶
type BaseService ¶ added in v1.54.0
type BaseServiceConfiguration ¶ added in v1.54.0
type BaseServiceConfiguration struct { // The base directory for source files Basedir string `yaml:"basedir"` // 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,omitempty"` // This is a command that will be use to run these services when using nitric start Start string `yaml:"start"` }
func (BaseServiceConfiguration) GetBasedir ¶ added in v1.54.0
func (b BaseServiceConfiguration) GetBasedir() string
func (BaseServiceConfiguration) GetMatch ¶ added in v1.54.0
func (b BaseServiceConfiguration) GetMatch() string
func (BaseServiceConfiguration) GetRuntime ¶ added in v1.54.0
func (b BaseServiceConfiguration) GetRuntime() string
func (BaseServiceConfiguration) GetStart ¶ added in v1.54.0
func (b BaseServiceConfiguration) GetStart() string
type Batch ¶ added in v1.54.0
type Batch struct { Name string // contains filtered or unexported fields }
func (*Batch) BuildImage ¶ added in v1.54.0
FIXME: Duplicate code from service.go
func (*Batch) GetAbsoluteFilePath ¶ added in v1.54.0
func (*Batch) GetFilePath ¶ added in v1.54.0
func (*Batch) Run ¶ added in v1.54.0
Run - runs the service using the provided command, typically not in a container.
func (*Batch) RunContainer ¶ added in v1.54.0
func (s *Batch) RunContainer(stop <-chan bool, updates chan<- ServiceRunUpdate, opts ...RunContainerOption) error
RunContainer - Runs a container for the service, blocking until the container exits
type BatchConfiguration ¶ added in v1.54.0
type BatchConfiguration struct {
BaseServiceConfiguration `yaml:",inline"`
}
type DatabaseMigrationState ¶ added in v1.53.0
type DatabaseMigrationState struct {
*LocalMigration
}
type LocalMigration ¶ added in v1.53.0
type Project ¶
type Project struct { Name string Directory string Preview []preview.Feature LocalConfig localconfig.LocalConfiguration // 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) BuildBatches ¶ added in v1.54.0
func (p *Project) BuildBatches(fs afero.Fs) (chan ServiceBuildUpdate, error)
TODO: Reduce duplicate code BuildBatches - Builds all the batches in the project
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) CollectBatchRequirements ¶ added in v1.54.0
func (p *Project) CollectBatchRequirements() ([]*collector.BatchRequirements, error)
func (*Project) CollectServicesRequirements ¶ added in v1.34.0
func (p *Project) CollectServicesRequirements() ([]*collector.ServiceRequirements, error)
func (*Project) DefaultMigrationImage ¶ added in v1.42.0
DefaultMigrationImage - Returns the default migration image name for the project Also returns ok if image is required or not
func (*Project) GetBatchServices ¶ added in v1.54.0
func (*Project) GetServices ¶ added in v1.34.0
func (*Project) RunBatches ¶ added in v1.54.0
func (p *Project) RunBatches(localCloud *cloud.LocalCloud, stop <-chan bool, updates chan<- ServiceRunUpdate, env map[string]string) error
RunBatches - Runs all the batches as containers use the stop channel to stop all running batches
func (*Project) RunBatchesWithCommand ¶ added in v1.54.0
func (p *Project) RunBatchesWithCommand(localCloud *cloud.LocalCloud, stop <-chan bool, updates chan<- ServiceRunUpdate, env map[string]string) error
RunBatchesWithCommand - Runs all the batches locally using a startup command use the stop channel to stop all running batches
func (*Project) RunServices ¶ added in v1.34.0
func (p *Project) RunServices(localCloud *cloud.LocalCloud, stop <-chan bool, updates chan<- ServiceRunUpdate, env map[string]string) 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, env map[string]string) error
RunServicesWithCommand - 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"` Ports map[string]int `yaml:"ports,omitempty"` Batches []BatchConfiguration `yaml:"batch-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 NewService ¶ added in v1.53.0
func NewService(name, serviceType, filepath string, buildContext runtime.RuntimeBuildContext, startCmd string) *Service
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" ServiceBuildStatus_Skipped ServiceBuildStatus = "Skipped" )
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 { BaseServiceConfiguration `yaml:",inline"` // 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,omitempty"` }
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 Label string Message string Status ServiceRunStatus Err error }
type ServiceRunUpdateWriter ¶ added in v1.34.0
type ServiceRunUpdateWriter struct {
// contains filtered or unexported fields
}