Documentation ¶
Index ¶
- Constants
- func ApplicationMode() bool
- func AsEndpointEnvironmentVariable(app string, service string, endpoint *Endpoint, addresses []string) string
- func AsEndpointEnvironmentVariableKey(app string, service string, endpoint *Endpoint) string
- func ConfigurationFile[C Configuration]() string
- func ContainsRoute(routes []*RestRoute, r *RestRoute) bool
- func ExistsAtDir[C Configuration](dir string) bool
- func ExtendDomain(domain string, extension string) string
- func ExtraValidOrganizationName(name string) bool
- func FindUp[C Configuration](ctx context.Context) (*string, error)
- func HomeDir() string
- func InPartialMode() bool
- func IsInitialized(_ context.Context) bool
- func LoadFromBytes[C Configuration](content []byte) (*C, error)
- func LoadFromDir[C Configuration](ctx context.Context, dir string) (*C, error)
- func LoadFromFs[C any](fs shared.FileSystem) (*C, error)
- func LoadFromPath[C Configuration](ctx context.Context, p string) (*C, error)
- func LoadSpec(content []byte, obj any) error
- func MakeActive(entry string) string
- func MakeInactive(entry string) string
- func OverridePath(name string, path string) *string
- func ParseAgent(ctx context.Context, k AgentKind, s string) (*basev1.Agent, error)
- func ParseEndpointEnvironmentVariableKey(key string) (string, error)
- func ParseRestRouteEnvironmentVariable(env string) (string, []string)
- func Path[C Configuration](dir string) string
- func ReferenceMatch(entry string, name string) bool
- func RegisterAgent(kind AgentKind, protoKind basev1.Agent_Kind)
- func RestRouteAsEnvironmentVariable(reference string, addresses []string) string
- func SaveToDir[C Configuration](ctx context.Context, c *C, dir string) error
- func SerializeAddresses(addresses []string) string
- func SerializeSpec(spec any) ([]byte, error)
- func SetLoadWorkspaceUnsafe(w *Workspace)
- func SetMode(m Mode)
- func SolveDir(dir string) string
- func SolveDirOrCreate(dir string) string
- func SupportedAPI(kind string) error
- func ToOrganizationDomain(name string) string
- func TypeName[C Configuration]() string
- func ValidOrganization(org *basev1.Organization) error
- func ValidOrganizationDomain(domain string) bool
- func ValidateAgent(agent *basev1.Agent) error
- func ValidateDomain()
- func Version() (string, error)
- func WorkspaceConfigurationDir() string
- type Agent
- func (p *Agent) Identifier() string
- func (p *Agent) IsService() bool
- func (p *Agent) Key(kind AgentKind, unique string) string
- func (p *Agent) Of(kind AgentKind) *Agent
- func (p *Agent) Patch() (*Agent, error)
- func (p *Agent) Path() (string, error)
- func (p *Agent) String() string
- func (p *Agent) Unique() string
- type AgentKind
- type Application
- func (app *Application) ActiveService(_ context.Context) *string
- func (app *Application) AddService(_ context.Context, service *Service) error
- func (app *Application) DeleteService(ctx context.Context, name string) error
- func (app *Application) Dir() string
- func (app *Application) ExistsService(name string) bool
- func (app *Application) GetServiceReferences(name string) (*ServiceReference, error)
- func (app *Application) LoadActiveService(ctx context.Context) (*Service, error)
- func (app *Application) LoadServiceFromName(ctx context.Context, name string) (*Service, error)
- func (app *Application) LoadServiceFromReference(ctx context.Context, ref *ServiceReference) (*Service, error)
- func (app *Application) LoadServices(ctx context.Context) ([]*Service, error)
- func (app *Application) NewService(ctx context.Context, action *actionsv1.AddService) (*Service, error)
- func (app *Application) Proto() *basev1.Application
- func (app *Application) Reference() *ApplicationReference
- func (app *Application) Save(ctx context.Context) error
- func (app *Application) SaveToDir(ctx context.Context, dir string) error
- func (app *Application) ServiceDomain(name string) string
- func (app *Application) ServicePath(_ context.Context, ref *ServiceReference) string
- func (app *Application) SetActiveService(ctx context.Context, name string) error
- type ApplicationReference
- type ApplicationRestRoute
- type ClientEntry
- type Configuration
- type DockerImage
- type Endpoint
- type EndpointInstance
- type EndpointReference
- type Environment
- type EnvironmentExistsError
- type EnvironmentReference
- type ExtendedRestRoute
- func LoadApplicationExtendedRoutes[T any](_ context.Context, dir string) ([]*ExtendedRestRoute[T], error)
- func LoadExtendedRestRoute[T any](p string, app string, service string) (*ExtendedRestRoute[T], error)
- func LoadExtendedRoutes[T any](dir string, app string, service string) ([]*ExtendedRestRoute[T], error)
- func LoadServiceExtendedRoutes[T any](dir string, app string) ([]*ExtendedRestRoute[T], error)
- func NewExtendedRestRoute[T any](rest RestRoute, value T) *ExtendedRestRoute[T]
- type HTTPMethod
- type Info
- type Mode
- type NoApplicationError
- type Organization
- type Partial
- type Project
- func (project *Project) ActiveApplication() *string
- func (project *Project) AddApplication(app *ApplicationReference) error
- func (project *Project) AddPartial(partial Partial) error
- func (project *Project) ApplicationPath(_ context.Context, ref *ApplicationReference) string
- func (project *Project) ApplicationsNames() []string
- func (project *Project) DeleteApplication(ctx context.Context, name string) error
- func (project *Project) Dir() string
- func (project *Project) ExistsApplication(name string) bool
- func (project *Project) FindEnvironment(environment string) (*Environment, error)
- func (project *Project) GetPartial(name string) (*Partial, error)
- func (project *Project) LoadActiveApplication(ctx context.Context) (*Application, error)
- func (project *Project) LoadApplicationFromName(ctx context.Context, name string) (*Application, error)
- func (project *Project) LoadApplicationFromReference(ctx context.Context, ref *ApplicationReference) (*Application, error)
- func (project *Project) LoadApplications(ctx context.Context) ([]*Application, error)
- func (project *Project) NewApplication(ctx context.Context, action *actionsv1.AddApplication) (*Application, error)
- func (project *Project) NewEnvironment(_ context.Context, input *actionsv1.AddEnvironment) (*Environment, error)
- func (project *Project) Proto() *basev1.Project
- func (project *Project) Save(ctx context.Context) error
- func (project *Project) SaveToDirUnsafe(ctx context.Context, dir string) error
- func (project *Project) SetActiveApplication(_ context.Context, name string) error
- func (project *Project) Unique() string
- type ProjectReference
- type ProviderReference
- type Readme
- type RestRoute
- func ConvertRoutes(routes []*basev1.RestRoute, app string, service string) []*RestRoute
- func DetectNewRoutes(known []*RestRoute, routes []*RestRoute) []*RestRoute
- func LoadApplicationRoutes(ctx context.Context, dir string) ([]*RestRoute, error)
- func LoadRoute(ctx context.Context, p string, app string, service string) (*RestRoute, error)
- func LoadRoutes(ctx context.Context, dir string, app string, service string) ([]*RestRoute, error)
- func LoadServiceRoutes(ctx context.Context, dir string, app string) ([]*RestRoute, error)
- func UnwrapRoute[T any](route *ExtendedRestRoute[T]) *RestRoute
- func UnwrapRoutes[T any](routes []*ExtendedRestRoute[T]) []*RestRoute
- type RunningOptions
- type Service
- func (s *Service) AddDependency(ctx context.Context, requirement *Service, requiredEndpoints []*Endpoint) error
- func (s *Service) Dir() string
- func (s *Service) Endpoint() string
- func (s *Service) EndpointsFromNames(endpoints []string) ([]*Endpoint, error)
- func (s *Service) ExistsDependency(requirement *Service) (*ServiceDependency, bool)
- func (s *Service) HasEndpoints(_ context.Context, endpoints []string) ([]string, error)
- func (s *Service) Identity() *basev1.ServiceIdentity
- func (s *Service) LoadSettingsFromSpec(t any) error
- func (s *Service) Proto() *basev1.Service
- func (s *Service) Reference() (*ServiceReference, error)
- func (s *Service) Save(ctx context.Context) error
- func (s *Service) SaveAtDir(ctx context.Context, dir string) error
- func (s *Service) Unique() string
- func (s *Service) UpdateSpecFromSettings(spec any) error
- type ServiceDependency
- type ServiceIdentity
- type ServiceReference
- type ServiceRestRoute
- type ServiceWithCase
- type Workspace
- func LoadWorkspace(ctx context.Context) (*Workspace, error)
- func LoadWorkspaceFromDirUnsafe(ctx context.Context, dir string) (*Workspace, error)
- func NewWorkspace(ctx context.Context, action *actionsv1.AddWorkspace) (*Workspace, error)
- func ReloadWorkspace(ctx context.Context, workspace *Workspace) (*Workspace, error)
- func (workspace *Workspace) ActiveProject(ctx context.Context) (*ProjectReference, error)
- func (workspace *Workspace) DeleteProject(ctx context.Context, name string) error
- func (workspace *Workspace) Dir() string
- func (workspace *Workspace) ExistsProject(name string) bool
- func (workspace *Workspace) FindProjectReference(name string) (*ProjectReference, error)
- func (workspace *Workspace) LoadActiveProject(ctx context.Context) (*Project, error)
- func (workspace *Workspace) LoadProjectFromDir(ctx context.Context, dir string) (*Project, error)
- func (workspace *Workspace) LoadProjectFromName(ctx context.Context, name string) (*Project, error)
- func (workspace *Workspace) LoadProjectFromReference(ctx context.Context, ref *ProjectReference) (*Project, error)
- func (workspace *Workspace) LoadProjects(ctx context.Context) ([]*Project, error)
- func (workspace *Workspace) NewProject(ctx context.Context, action *actionsv1.AddProject) (*Project, error)
- func (workspace *Workspace) ProjectNames() []string
- func (workspace *Workspace) ProjectPath(_ context.Context, ref *ProjectReference) string
- func (workspace *Workspace) ProjectRoot() string
- func (workspace *Workspace) ReloadProject(ctx context.Context, project *Project) (*Project, error)
- func (workspace *Workspace) Save(ctx context.Context) error
- func (workspace *Workspace) SetProjectActive(ctx context.Context, input *actionsv1.SetProjectActive) error
Constants ¶
const ( ApplicationKind = "application" ApplicationConfigurationName = "application.codefly.yaml" )
const ( Unknown = "unknown" Grpc = "grpc" Rest = "rest" TCP = "tcp" )
const AgentConfigurationName = "agent.codefly.yaml"
const EndpointPrefix = "CODEFLY_ENDPOINT__"
const FactoryServiceAgent = "codefly:service:factory"
const InfoConfigurationName = "info.codefly.yaml"
const ProjectConfigurationName = "project.codefly.yaml"
const RestRoutePrefix = "CODEFLY-RESTROUTE_"
const RuntimeServiceAgent = "codefly:service:runtime"
const ServiceAgent = AgentKind("codefly:service")
const ServiceConfigurationName = "service.codefly.yaml"
const WorkspaceConfigurationName = "codefly.yaml"
Variables ¶
This section is empty.
Functions ¶
func ApplicationMode ¶ added in v0.0.51
func ApplicationMode() bool
func AsEndpointEnvironmentVariable ¶ added in v0.0.13
func AsEndpointEnvironmentVariableKey ¶ added in v0.0.13
func ConfigurationFile ¶ added in v0.0.42
func ConfigurationFile[C Configuration]() string
func ContainsRoute ¶ added in v0.0.28
func ExistsAtDir ¶
func ExistsAtDir[C Configuration](dir string) bool
func ExtendDomain ¶
func ExtraValidOrganizationName ¶ added in v0.0.51
func FindUp ¶
func FindUp[C Configuration](ctx context.Context) (*string, error)
FindUp looks for a configuration in the active directory and up
func InPartialMode ¶ added in v0.0.15
func InPartialMode() bool
func IsInitialized ¶ added in v0.0.51
func LoadFromBytes ¶ added in v0.0.13
func LoadFromBytes[C Configuration](content []byte) (*C, error)
func LoadFromDir ¶
func LoadFromDir[C Configuration](ctx context.Context, dir string) (*C, error)
func LoadFromFs ¶ added in v0.0.42
func LoadFromFs[C any](fs shared.FileSystem) (*C, error)
func LoadFromPath ¶
func LoadFromPath[C Configuration](ctx context.Context, p string) (*C, error)
func MakeActive ¶ added in v0.0.51
func MakeInactive ¶ added in v0.0.51
func OverridePath ¶ added in v0.0.51
OverridePath is nil if the name is the same as the desired relative path
func ParseAgent ¶ added in v0.0.23
func ParseEndpointEnvironmentVariableKey ¶ added in v0.0.13
func ParseRestRouteEnvironmentVariable ¶ added in v0.0.13
func Path ¶
func Path[C Configuration](dir string) string
func ReferenceMatch ¶ added in v0.0.51
func RegisterAgent ¶ added in v0.0.51
func RegisterAgent(kind AgentKind, protoKind basev1.Agent_Kind)
func RestRouteAsEnvironmentVariable ¶ added in v0.0.13
func SerializeAddresses ¶
func SerializeSpec ¶
func SetLoadWorkspaceUnsafe ¶ added in v0.0.51
func SetLoadWorkspaceUnsafe(w *Workspace)
func SolveDirOrCreate ¶
func SupportedAPI ¶ added in v0.0.51
func ToOrganizationDomain ¶ added in v0.0.51
func TypeName ¶
func TypeName[C Configuration]() string
func ValidOrganization ¶ added in v0.0.51
func ValidOrganization(org *basev1.Organization) error
func ValidOrganizationDomain ¶ added in v0.0.51
func ValidateAgent ¶ added in v0.0.51
func ValidateDomain ¶
func ValidateDomain()
func WorkspaceConfigurationDir ¶ added in v0.0.51
func WorkspaceConfigurationDir() string
WorkspaceConfigurationDir returns the directory where the Workspace configuration is stored Initialized to the default user folder
Types ¶
type Agent ¶ added in v0.0.23
type Agent struct { Kind AgentKind `yaml:"kind"` Name string `yaml:"name"` Version string `yaml:"version"` Publisher string `yaml:"publisher"` }
func AgentFromProto ¶ added in v0.0.51
func (*Agent) Identifier ¶ added in v0.0.23
type AgentKind ¶ added in v0.0.51
type AgentKind string
func AgentKindFromProto ¶ added in v0.0.51
func AgentKindFromProto(kind basev1.Agent_Kind) (*AgentKind, error)
type Application ¶
type Application struct { Kind string `yaml:"kind"` Name string `yaml:"name"` PathOverride *string `yaml:"path,omitempty"` Project string `yaml:"project"` Domain string `yaml:"domain"` Description string `yaml:"description,omitempty"` Services []*ServiceReference `yaml:"services"` // contains filtered or unexported fields }
An Application is a collection of services that are deployed together.
func LoadApplicationFromDirUnsafe ¶ added in v0.0.51
func LoadApplicationFromDirUnsafe(ctx context.Context, dir string) (*Application, error)
func LoadApplicationFromPath ¶ added in v0.0.51
func LoadApplicationFromPath(ctx context.Context) (*Application, error)
LoadApplicationFromPath loads an application from a path
func ReloadApplication ¶ added in v0.0.51
func ReloadApplication(ctx context.Context, app *Application) (*Application, error)
func (*Application) ActiveService ¶ added in v0.0.51
func (app *Application) ActiveService(_ context.Context) *string
func (*Application) AddService ¶
func (app *Application) AddService(_ context.Context, service *Service) error
func (*Application) DeleteService ¶ added in v0.0.51
func (app *Application) DeleteService(ctx context.Context, name string) error
DeleteService deletes a service from an application
func (*Application) Dir ¶
func (app *Application) Dir() string
Dir returns the directory of the application
func (*Application) ExistsService ¶ added in v0.0.51
func (app *Application) ExistsService(name string) bool
ExistsService returns true if the service exists in the application
func (*Application) GetServiceReferences ¶
func (app *Application) GetServiceReferences(name string) (*ServiceReference, error)
func (*Application) LoadActiveService ¶ added in v0.0.51
func (app *Application) LoadActiveService(ctx context.Context) (*Service, error)
func (*Application) LoadServiceFromName ¶ added in v0.0.13
func (*Application) LoadServiceFromReference ¶ added in v0.0.36
func (app *Application) LoadServiceFromReference(ctx context.Context, ref *ServiceReference) (*Service, error)
func (*Application) LoadServices ¶ added in v0.0.51
func (app *Application) LoadServices(ctx context.Context) ([]*Service, error)
func (*Application) NewService ¶ added in v0.0.51
func (app *Application) NewService(ctx context.Context, action *actionsv1.AddService) (*Service, error)
NewService creates a service in an application
func (*Application) Proto ¶ added in v0.0.51
func (app *Application) Proto() *basev1.Application
func (*Application) Reference ¶ added in v0.0.15
func (app *Application) Reference() *ApplicationReference
func (*Application) SaveToDir ¶ added in v0.0.51
func (app *Application) SaveToDir(ctx context.Context, dir string) error
func (*Application) ServiceDomain ¶
func (app *Application) ServiceDomain(name string) string
func (*Application) ServicePath ¶ added in v0.0.51
func (app *Application) ServicePath(_ context.Context, ref *ServiceReference) string
ServicePath returns the absolute path of an Service Cases for Reference.Path nil: relative path to application with name rel: relative path /abs: absolute path
func (*Application) SetActiveService ¶ added in v0.0.51
func (app *Application) SetActiveService(ctx context.Context, name string) error
type ApplicationReference ¶ added in v0.0.9
type ApplicationReference struct { Name string `yaml:"name"` PathOverride *string `yaml:"path,omitempty"` }
An ApplicationReference
func (*ApplicationReference) IsActive ¶ added in v0.0.51
func (ref *ApplicationReference) IsActive() (*ApplicationReference, bool)
IsActive returns true if the project is marked as active
func (*ApplicationReference) MarkAsActive ¶ added in v0.0.51
func (ref *ApplicationReference) MarkAsActive()
MarkAsActive marks a project as active
type ApplicationRestRoute ¶ added in v0.0.13
type ApplicationRestRoute struct { ServiceRestRoutes []*ServiceRestRoute Name string }
type ClientEntry ¶
func (*ClientEntry) Validate ¶
func (c *ClientEntry) Validate() error
type Configuration ¶
type Configuration interface{}
type DockerImage ¶ added in v0.0.26
type Endpoint ¶
type Endpoint struct { Name string `yaml:"name"` Description string `yaml:"description,omitempty"` Visibility string `yaml:"scope,omitempty"` API string `yaml:"api,omitempty"` // FailOver indicates that this endpoint should fail over to another endpoint FailOver *Endpoint `yaml:"fail-over,omitempty"` }
Endpoint is the fundamental entity that standardize communication between services.
func (*Endpoint) AsReference ¶ added in v0.0.51
func (e *Endpoint) AsReference() *EndpointReference
type EndpointInstance ¶ added in v0.0.13
func ParseEndpointEnvironmentVariable ¶ added in v0.0.13
func ParseEndpointEnvironmentVariable(env string) (*EndpointInstance, error)
type EndpointReference ¶ added in v0.0.9
type EndpointReference struct {
Name string `yaml:"name"`
}
An EndpointReference
type Environment ¶ added in v0.0.17
type Environment struct { Name string `yaml:"name"` Description string `yaml:"description,omitempty"` }
Environment is a configuration for an environment
func LoadEnvironmentFromReference ¶ added in v0.0.31
func LoadEnvironmentFromReference(ref *EnvironmentReference) (*Environment, error)
func Local ¶ added in v0.0.17
func Local() *Environment
Local is a local environment that is always available
type EnvironmentExistsError ¶ added in v0.0.51
type EnvironmentExistsError struct {
// contains filtered or unexported fields
}
func (*EnvironmentExistsError) Error ¶ added in v0.0.51
func (err *EnvironmentExistsError) Error() string
type EnvironmentReference ¶ added in v0.0.31
type EnvironmentReference struct {
Name string `yaml:"name"`
}
An EnvironmentReference at the Project level
func (*EnvironmentReference) String ¶ added in v0.0.51
func (ref *EnvironmentReference) String() string
type ExtendedRestRoute ¶ added in v0.0.13
func LoadApplicationExtendedRoutes ¶ added in v0.0.13
func LoadExtendedRestRoute ¶ added in v0.0.13
func LoadExtendedRoutes ¶ added in v0.0.13
func LoadServiceExtendedRoutes ¶ added in v0.0.13
func LoadServiceExtendedRoutes[T any](dir string, app string) ([]*ExtendedRestRoute[T], error)
func NewExtendedRestRoute ¶ added in v0.0.13
func NewExtendedRestRoute[T any](rest RestRoute, value T) *ExtendedRestRoute[T]
type HTTPMethod ¶ added in v0.0.51
type HTTPMethod string
const ( HTTPMethodGet HTTPMethod = "GET" HTTPMethodPut HTTPMethod = "PUT" HTTPMethodPost HTTPMethod = "POST" HTTPMethodDelete HTTPMethod = "DELETE" HTTPMethodPatch HTTPMethod = "PATCH" HTTPMethodOptions HTTPMethod = "OPTIONS" HTTPMethodHead HTTPMethod = "HEAD" )
func ConvertMethod ¶ added in v0.0.28
func ConvertMethod(m basev1.HTTPMethod) HTTPMethod
func ConvertMethods ¶ added in v0.0.28
func ConvertMethods(methods []basev1.HTTPMethod) []HTTPMethod
type NoApplicationError ¶
type NoApplicationError struct {
Project string
}
func (NoApplicationError) Error ¶
func (e NoApplicationError) Error() string
type Organization ¶ added in v0.0.51
func OrganizationFromProto ¶ added in v0.0.51
func OrganizationFromProto(_ context.Context, m *basev1.Organization) (*Organization, error)
func (*Organization) Proto ¶ added in v0.0.51
func (organization *Organization) Proto() *basev1.Organization
type Project ¶
type Project struct { Name string `yaml:"name"` PathOverride *string `yaml:"path,omitempty"` Organization Organization `yaml:"organization"` Domain string `yaml:"domain,omitempty"` Description string `yaml:"description,omitempty"` // Applications in the project Applications []*ApplicationReference `yaml:"applications"` // Partials are a convenient way to run several applications Partials []*Partial `yaml:"partials"` // Providers in the project Providers []*ProviderReference `yaml:"providers"` // Environments in the project Environments []*EnvironmentReference `yaml:"environments"` // contains filtered or unexported fields }
func ActiveDefaultProject ¶ added in v0.0.51
func LoadProjectFromDirUnsafe ¶ added in v0.0.51
LoadProjectFromDirUnsafe loads a Project configuration from a directory
func LoadProjectFromPath ¶ added in v0.0.51
func (*Project) ActiveApplication ¶ added in v0.0.51
ActiveApplication returns the active application
func (*Project) AddApplication ¶ added in v0.0.9
func (project *Project) AddApplication(app *ApplicationReference) error
AddApplication adds an application to the project
func (*Project) AddPartial ¶ added in v0.0.13
func (*Project) ApplicationPath ¶ added in v0.0.51
func (project *Project) ApplicationPath(_ context.Context, ref *ApplicationReference) string
ApplicationPath returns the absolute path of an application Cases for Reference.Path nil: relative path to project with name rel: relative path /abs: absolute path
func (*Project) ApplicationsNames ¶ added in v0.0.51
ApplicationsNames returns the names of the applications in the project
func (*Project) DeleteApplication ¶ added in v0.0.51
DeleteApplication deletes an application from the project
func (*Project) ExistsApplication ¶ added in v0.0.51
ExistsApplication returns true if the application exists in the project
func (*Project) FindEnvironment ¶ added in v0.0.31
func (project *Project) FindEnvironment(environment string) (*Environment, error)
func (*Project) GetPartial ¶ added in v0.0.13
func (*Project) LoadActiveApplication ¶ added in v0.0.51
func (project *Project) LoadActiveApplication(ctx context.Context) (*Application, error)
LoadActiveApplication decides which application is active: - only 1: it is active - more than 1: use the activeApplication internal field
func (*Project) LoadApplicationFromName ¶ added in v0.0.51
func (project *Project) LoadApplicationFromName(ctx context.Context, name string) (*Application, error)
LoadApplicationFromName loads an application from a name
func (*Project) LoadApplicationFromReference ¶ added in v0.0.13
func (project *Project) LoadApplicationFromReference(ctx context.Context, ref *ApplicationReference) (*Application, error)
LoadApplicationFromReference loads an application from a reference
func (*Project) LoadApplications ¶ added in v0.0.51
func (project *Project) LoadApplications(ctx context.Context) ([]*Application, error)
LoadApplications returns the applications in the project
func (*Project) NewApplication ¶ added in v0.0.51
func (project *Project) NewApplication(ctx context.Context, action *actionsv1.AddApplication) (*Application, error)
NewApplication creates an application in a project
func (*Project) NewEnvironment ¶ added in v0.0.51
func (project *Project) NewEnvironment(_ context.Context, input *actionsv1.AddEnvironment) (*Environment, error)
func (*Project) SaveToDirUnsafe ¶ added in v0.0.51
func (*Project) SetActiveApplication ¶ added in v0.0.51
SetActiveApplication sets the active application
type ProjectReference ¶
type ProjectReference struct { Name string `yaml:"name"` PathOverride *string `yaml:"path,omitempty"` }
ProjectReference is a reference to a project used by Workspace configuration
func (*ProjectReference) IsActive ¶ added in v0.0.51
func (ref *ProjectReference) IsActive() (*ProjectReference, bool)
IsActive returns true if the project is marked as active and return the clean reference for Loading
func (*ProjectReference) MarkAsActive ¶ added in v0.0.51
func (ref *ProjectReference) MarkAsActive()
MarkAsActive marks a project as active using the * convention
func (*ProjectReference) MarkAsInactive ¶ added in v0.0.51
func (ref *ProjectReference) MarkAsInactive()
MarkAsInactive marks a project as inactive using the * convention
func (*ProjectReference) String ¶ added in v0.0.51
func (ref *ProjectReference) String() string
type ProviderReference ¶ added in v0.0.9
type ProviderReference struct { Name string `yaml:"name"` RelativePathOverride *string `yaml:"relative-path,omitempty"` }
A ProviderReference
type RestRoute ¶ added in v0.0.13
type RestRoute struct { Path string Methods []HTTPMethod Application string `yaml:"-"` Service string `yaml:"-"` }
func ConvertRoutes ¶ added in v0.0.28
func DetectNewRoutes ¶ added in v0.0.28
func LoadApplicationRoutes ¶ added in v0.0.13
func LoadRoutes ¶ added in v0.0.13
func LoadServiceRoutes ¶ added in v0.0.13
func UnwrapRoute ¶ added in v0.0.32
func UnwrapRoute[T any](route *ExtendedRestRoute[T]) *RestRoute
func UnwrapRoutes ¶ added in v0.0.13
func UnwrapRoutes[T any](routes []*ExtendedRestRoute[T]) []*RestRoute
type RunningOptions ¶
type RunningOptions struct { Quiet bool `yaml:"quiet,omitempty"` Persistence bool `yaml:"persistence,omitempty"` }
RunningOptions of the ServiceReference can tweak running behavior of service Note: this is not a part of the Service configuration but part of the Application running
type Service ¶
type Service struct { Name string `yaml:"name"` Description string `yaml:"description,omitempty"` Version string `yaml:"version"` Application string `yaml:"application"` Domain string `yaml:"domain"` Namespace string `yaml:"namespace"` PathOverride *string `yaml:"path,omitempty"` Agent *Agent `yaml:"agent"` Dependencies []*ServiceDependency `yaml:"dependencies"` Endpoints []*Endpoint `yaml:"endpoints"` Spec map[string]any `yaml:"spec"` // contains filtered or unexported fields }
A Service
func LoadServiceFromDirUnsafe ¶ added in v0.0.51
LoadServiceFromDirUnsafe loads a service from a directory
func LoadServiceFromPath ¶ added in v0.0.51
LoadServiceFromPath loads an service from a path
func ReloadService ¶ added in v0.0.51
ReloadService from directory
func (*Service) AddDependency ¶ added in v0.0.51
func (s *Service) AddDependency(ctx context.Context, requirement *Service, requiredEndpoints []*Endpoint) error
AddDependency adds a dependency to the service
func (*Service) EndpointsFromNames ¶ added in v0.0.51
EndpointsFromNames return matching endpoints
func (*Service) ExistsDependency ¶ added in v0.0.51
func (s *Service) ExistsDependency(requirement *Service) (*ServiceDependency, bool)
func (*Service) HasEndpoints ¶ added in v0.0.51
func (*Service) Identity ¶ added in v0.0.51
func (s *Service) Identity() *basev1.ServiceIdentity
Identity is the proto version of Unique
func (*Service) LoadSettingsFromSpec ¶ added in v0.0.15
func (*Service) Reference ¶
func (s *Service) Reference() (*ServiceReference, error)
func (*Service) Unique ¶
Unique identifies a service within a project We use a REST like convention rather then a subdomain one
func (*Service) UpdateSpecFromSettings ¶ added in v0.0.15
type ServiceDependency ¶
type ServiceDependency struct { Name string `yaml:"name"` Application string `yaml:"application,omitempty"` Endpoints []*EndpointReference `yaml:"endpoints,omitempty"` }
func (*ServiceDependency) AsReference ¶
func (s *ServiceDependency) AsReference() *ServiceReference
func (*ServiceDependency) String ¶ added in v0.0.13
func (s *ServiceDependency) String() string
func (*ServiceDependency) Unique ¶ added in v0.0.13
func (s *ServiceDependency) Unique() string
func (*ServiceDependency) UpdateEndpoints ¶ added in v0.0.51
func (s *ServiceDependency) UpdateEndpoints(ctx context.Context, endpoints []*Endpoint) error
type ServiceIdentity ¶
ServiceIdentity defines exactly the scope of the service Name: the name of the service It will be unique within an application Application: the name of the application the service belongs to Recall that application names are unique within a project This is a logical partitioning Namespace: the namespace the service belongs to This is a resource partitioning Domain: the domain of the service belongs to This is a responsibility partitioning
func Identity ¶
func Identity(conf *Service) *ServiceIdentity
type ServiceReference ¶
type ServiceReference struct { Name string `yaml:"name"` PathOverride *string `yaml:"path,omitempty"` Application string `yaml:"application,omitempty"` }
ServiceReference is a reference to a service used by Application configuration
func ParseServiceReference ¶ added in v0.0.15
func ParseServiceReference(input string) (*ServiceReference, error)
func (*ServiceReference) String ¶ added in v0.0.15
func (ref *ServiceReference) String() string
type ServiceRestRoute ¶ added in v0.0.13
type ServiceWithCase ¶ added in v0.0.26
func ToServiceWithCase ¶ added in v0.0.26
func ToServiceWithCase(svc *Service) *ServiceWithCase
type Workspace ¶
type Workspace struct { Name string `yaml:"name"` Organization Organization `yaml:"organization,omitempty"` Domain string `yaml:"domain,omitempty"` // Projects in the Workspace configuration Projects []*ProjectReference `yaml:"projects"` // Configuration ProjectsRoot string `yaml:"projects-root"` // contains filtered or unexported fields }
Workspace configuration for codefly CLI
func LoadWorkspace ¶ added in v0.0.51
LoadWorkspace returns the active Workspace configuration
func LoadWorkspaceFromDirUnsafe ¶ added in v0.0.51
LoadWorkspaceFromDirUnsafe loads a Workspace configuration from a directory
func NewWorkspace ¶ added in v0.0.51
NewWorkspace creates a new workspace
func ReloadWorkspace ¶ added in v0.0.51
ReloadWorkspace a project configuration
func (*Workspace) ActiveProject ¶ added in v0.0.51
func (workspace *Workspace) ActiveProject(ctx context.Context) (*ProjectReference, error)
func (*Workspace) DeleteProject ¶ added in v0.0.37
func (*Workspace) ExistsProject ¶ added in v0.0.51
ExistsProject returns true if the project exists
func (*Workspace) FindProjectReference ¶ added in v0.0.51
func (workspace *Workspace) FindProjectReference(name string) (*ProjectReference, error)
FindProjectReference finds a project reference by name
func (*Workspace) LoadActiveProject ¶ added in v0.0.51
LoadActiveProject loads the active project
func (*Workspace) LoadProjectFromDir ¶ added in v0.0.51
LoadProjectFromDir loads a project from a directory
func (*Workspace) LoadProjectFromName ¶ added in v0.0.51
LoadProjectFromName loads a project from a name
func (*Workspace) LoadProjectFromReference ¶ added in v0.0.51
func (workspace *Workspace) LoadProjectFromReference(ctx context.Context, ref *ProjectReference) (*Project, error)
LoadProjectFromReference loads a project from a reference
func (*Workspace) LoadProjects ¶ added in v0.0.51
LoadProjects loads all the projects in the Workspace
func (*Workspace) NewProject ¶ added in v0.0.51
func (workspace *Workspace) NewProject(ctx context.Context, action *actionsv1.AddProject) (*Project, error)
NewProject creates a new project in a workspace
func (*Workspace) ProjectNames ¶ added in v0.0.51
ProjectNames returns the names of the projects in the Workspace configuration
func (*Workspace) ProjectPath ¶ added in v0.0.51
func (workspace *Workspace) ProjectPath(_ context.Context, ref *ProjectReference) string
ProjectPath returns the absolute path of a project Cases for Reference.Path nil: relative path to workspace with name rel: relative path /abs: absolute path
func (*Workspace) ProjectRoot ¶ added in v0.0.51
ProjectRoot returns the absolute path to the Workspace project root
func (*Workspace) ReloadProject ¶ added in v0.0.51
ReloadProject a project configuration
func (*Workspace) SetProjectActive ¶ added in v0.0.51
func (workspace *Workspace) SetProjectActive(ctx context.Context, input *actionsv1.SetProjectActive) error
SetProjectActive sets the active project