Documentation ¶
Index ¶
- Constants
- func ApplicationMode() bool
- func AsEndpointEnvironmentVariable(endpoint *Endpoint, addresses []string) string
- func AsRestRouteEnvironmentVariable(endpoint *basev0.Endpoint) []string
- func Condensed(es []*basev0.Endpoint) []string
- func ConfigurationFile[C Configuration]() string
- func ContainsRoute(routes []*RestRoute, r *RestRoute) bool
- func EndpointBaseProto(e *Endpoint) *basev0.Endpoint
- func EndpointDestination(e *basev0.Endpoint) string
- func EndpointEnvironmentVariableKey(endpoint *Endpoint) string
- func ExistsAtDir[C Configuration](dir string) bool
- func ExtendDomain(domain string, extension string) string
- func ExtraValidOrganizationName(name string) bool
- func FindEndpointForRoute(ctx context.Context, endpoints []*basev0.Endpoint, route *RestRoute) *basev0.Endpoint
- func FindUp[C Configuration](ctx context.Context) (*string, error)
- func FlattenRestRoutes(_ context.Context, endpoints []*basev0.Endpoint) []*basev0.RestRoute
- func FromProtoAPI(api *basev0.API) string
- func HasRest(_ context.Context, api *basev0.API) *basev0.RestAPI
- func HomeDir() (string, error)
- func InPartialMode() bool
- func IsInitialized(ctx context.Context) (bool, error)
- func Light(e *basev0.Endpoint) *basev0.Endpoint
- func LightAPI(api *basev0.API) *basev0.API
- 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 LoadProviderFromEnvFiles(ctx context.Context, project *Project, env *Environment) ([]*basev0.ProviderInformation, error)
- func LoadSpec(ctx context.Context, content []byte, obj any) error
- func MakeActive(entry string) string
- func MakeInactive(entry string) string
- func MakeRouteUnique(app string, service string, path string) string
- func NewGrpcAPI(ctx context.Context, endpoint *Endpoint, filename string) (*basev0.Endpoint, error)
- func NewHTTPApi(ctx context.Context, endpoint *Endpoint) (*basev0.Endpoint, error)
- func NewRestAPI(ctx context.Context, endpoint *Endpoint) (*basev0.Endpoint, error)
- func NewRestAPIFromOpenAPI(ctx context.Context, endpoint *Endpoint, filename string) (*basev0.Endpoint, error)
- func NewTCPAPI(ctx context.Context, endpoint *Endpoint) (*basev0.Endpoint, error)
- func OverridePath(defaultPath string, path string) *string
- func Path[C Configuration](ctx context.Context, dir string) (string, error)
- func ProviderInformationAsEnvironmentVariables(info *basev0.ProviderInformation) []string
- func ProviderInformationEnv(info *basev0.ProviderInformation, key string, value string) string
- func ProviderInformationEnvKey(info *basev0.ProviderInformation, key string) string
- func ReferenceMatch(entry string, name string) bool
- func RegisterAgent(kind AgentKind, protoKind basev0.Agent_Kind)
- func RestRouteEnvironmentVariableKey(endpoint *basev0.Endpoint, route *basev0.RestRoute) string
- func RestRoutesAsEnvironmentVariable(endpoint *basev0.Endpoint, route *basev0.RestRoute) string
- func RouteUnique(endpoint *basev0.Endpoint, route *basev0.RestRoute) string
- func SaveToDir[C Configuration](ctx context.Context, c *C, dir string) error
- func SerializeAddresses(addresses []string) string
- func SerializeSpec(ctx context.Context, spec any) ([]byte, error)
- func ServiceUnique(app string, service string) string
- func SetLoadWorkspaceUnsafe(w *Workspace)
- func SetMode(m Mode)
- func SolveDir(dir string) (string, error)
- func SolveDirOrCreate(dir string) (string, error)
- func StandardPort(api *basev0.API) (int, error)
- func ToOrganizationDomain(name string) string
- func TypeName[C Configuration]() string
- func ValidOrganization(org *basev0.Organization) error
- func ValidOrganizationDomain(domain string) bool
- func ValidateAgent(agent *basev0.Agent) error
- func ValidateDomain()
- func Version(ctx context.Context) (string, error)
- func WhichAPI(api *basev0.API) (string, error)
- func WhichAPIFromEndpoint(endpoint *basev0.Endpoint) (string, error)
- func WithAPI(ctx context.Context, endpoint *Endpoint, source APISource) (*basev0.Endpoint, error)
- func WorkspaceConfigurationDir() string
- type APISource
- type Agent
- func (p *Agent) AsResource() *wool.Resource
- 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) Proto() *basev0.Agent
- 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) DeleteServiceDependencies(ctx context.Context, ref *ServiceReference) error
- func (app *Application) Dir() string
- func (app *Application) ExistsService(ctx context.Context, 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 *actionsv0.AddService) (*Service, error)
- func (app *Application) Proto() *basev0.Application
- func (app *Application) PublicEndpoints(ctx context.Context) ([]*basev0.Endpoint, error)
- 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
- func (app *Application) Unique() string
- type ApplicationReference
- type ApplicationRestRoute
- type ClientEntry
- type Configuration
- type DockerImage
- type Endpoint
- type EndpointInstance
- type EndpointReference
- type EndpointSummary
- type Environment
- type EnvironmentExistsError
- type EnvironmentReference
- type EnvironmentVariableManager
- func (holder *EnvironmentVariableManager) Add(envs ...string)
- func (holder *EnvironmentVariableManager) Get() []string
- func (holder *EnvironmentVariableManager) GetBase() []string
- func (holder *EnvironmentVariableManager) GetEndpoint(ctx context.Context, unique string) (*EndpointInstance, error)
- func (holder *EnvironmentVariableManager) GetProjectProvider(_ context.Context, key string) (string, error)
- func (holder *EnvironmentVariableManager) GetServiceProvider(_ context.Context, unique string, name string, key string) (string, error)
- 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 Forwarding
- type GrpcAPI
- type HTTPAPI
- type HTTPMethod
- type Info
- type Mode
- type NilAPIError
- type NilEndpointError
- type NoApplicationError
- type Organization
- type Partial
- type Project
- func (project *Project) ActiveApplication(_ context.Context) *string
- func (project *Project) AddApplication(app *ApplicationReference) 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) DeleteServiceDependencies(ctx context.Context, ref *ServiceReference) error
- func (project *Project) Dir() string
- func (project *Project) ExistsApplication(name string) bool
- func (project *Project) FindEnvironment(environment string) (*Environment, 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 *actionsv0.AddApplication) (*Application, error)
- func (project *Project) NewEnvironment(_ context.Context, input *actionsv0.AddEnvironment) (*Environment, error)
- func (project *Project) Proto() *basev0.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 Readme
- type RestAPI
- type RestRoute
- func ConvertRoutes(routes []*basev0.RestRoute, app string, service string) []*RestRoute
- func DetectNewRoutesFromEndpoints(ctx context.Context, known []*RestRoute, endpoints []*basev0.Endpoint) []*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) DeleteServiceDependencies(ctx context.Context, ref *ServiceReference) 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() *ServiceIdentity
- func (s *Service) LoadSettingsFromSpec(t any) error
- func (s *Service) Proto() *basev0.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 ServiceForwarding
- type ServiceIdentity
- type ServiceReference
- type ServiceRestRoute
- type ServiceWithApplication
- type ServiceWithCase
- type TCP
- type UnknownAPIError
- type Visibility
- type Workspace
- func LoadWorkspace(ctx context.Context) (*Workspace, error)
- func LoadWorkspaceFromDirUnsafe(ctx context.Context, dir string) (*Workspace, error)
- func NewWorkspace(ctx context.Context, action *actionsv0.AddWorkspace) (*Workspace, error)
- func ReloadWorkspace(ctx context.Context, workspace *Workspace) (*Workspace, error)
- func (workspace *Workspace) ActiveProject(ctx context.Context) (*ProjectReference, error)
- func (workspace *Workspace) AddProject(ctx context.Context, project *Project) error
- func (workspace *Workspace) AddProjectReference(ctx context.Context, project *Project) 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 *actionsv0.AddProject) (*Project, error)
- func (workspace *Workspace) ProjectNames() []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 *actionsv0.SetProjectActive) error
- func (workspace *Workspace) Unique() string
Constants ¶
const ( ApplicationKind = "application" ApplicationConfigurationName = "application.codefly.yaml" )
const ( AGENT = "agent" PROJECT = "project" APPLICATION = "application" SERVICE = "service" ENDPOINT = "endpoint" )
const AgentConfigurationName = "agent.codefly.yaml"
const EndpointPrefix = "CODEFLY_ENDPOINT__"
const FactoryServiceAgent = "codefly:service:factory"
const InfoConfigurationName = "info.codefly.yaml"
const NA = "NA"
const ProjectConfigurationName = "project.codefly.yaml"
const ProjectProviderOrigin = "ProjectProviderOrigin"
const ProviderPrefix = "CODEFLY_PROVIDER__"
const RestRoutePrefix = "CODEFLY_RESTROUTE__"
const RuntimeServiceAgent = "codefly:service:runtime"
const ServiceAgent = AgentKind("codefly:service")
const ServiceConfigurationName = "service.codefly.yaml"
const Unknown = "unknown"
const WorkspaceConfigurationName = "workspace.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 AsRestRouteEnvironmentVariable ¶ added in v0.0.91
func ConfigurationFile ¶ added in v0.0.42
func ConfigurationFile[C Configuration]() string
func ContainsRoute ¶ added in v0.0.28
func EndpointBaseProto ¶ added in v0.0.65
func EndpointDestination ¶ added in v0.0.81
func EndpointEnvironmentVariableKey ¶ added in v0.0.91
func ExistsAtDir ¶
func ExistsAtDir[C Configuration](dir string) bool
func ExtendDomain ¶
func ExtraValidOrganizationName ¶ added in v0.0.51
func FindEndpointForRoute ¶ added in v0.0.65
func FindUp ¶
func FindUp[C Configuration](ctx context.Context) (*string, error)
FindUp looks for a configuration in the active directory and up
func FlattenRestRoutes ¶ added in v0.0.65
func FromProtoAPI ¶ added in v0.0.65
func InPartialMode ¶ added in v0.0.15
func InPartialMode() bool
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 LoadProviderFromEnvFiles ¶ added in v0.1.6
func LoadProviderFromEnvFiles(ctx context.Context, project *Project, env *Environment) ([]*basev0.ProviderInformation, error)
func MakeActive ¶ added in v0.0.51
func MakeInactive ¶ added in v0.0.51
func MakeRouteUnique ¶ added in v0.0.91
func NewGrpcAPI ¶ added in v0.0.65
func NewHTTPApi ¶ added in v0.0.81
func NewRestAPI ¶ added in v0.0.65
func NewRestAPIFromOpenAPI ¶ added in v0.0.65
func OverridePath ¶ added in v0.0.51
OverridePath is nil if the name is the same as the desired relative path
func ProviderInformationAsEnvironmentVariables ¶ added in v0.1.6
func ProviderInformationAsEnvironmentVariables(info *basev0.ProviderInformation) []string
func ProviderInformationEnv ¶ added in v0.1.6
func ProviderInformationEnv(info *basev0.ProviderInformation, key string, value string) string
func ProviderInformationEnvKey ¶ added in v0.1.6
func ProviderInformationEnvKey(info *basev0.ProviderInformation, key string) string
func ReferenceMatch ¶ added in v0.0.51
func RegisterAgent ¶ added in v0.0.51
func RegisterAgent(kind AgentKind, protoKind basev0.Agent_Kind)
func RestRouteEnvironmentVariableKey ¶ added in v0.0.91
func RestRoutesAsEnvironmentVariable ¶ added in v0.0.91
func RouteUnique ¶ added in v0.0.91
func SerializeAddresses ¶
func ServiceUnique ¶ added in v0.0.81
func SetLoadWorkspaceUnsafe ¶ added in v0.0.51
func SetLoadWorkspaceUnsafe(w *Workspace)
func SolveDirOrCreate ¶
func ToOrganizationDomain ¶ added in v0.0.51
func TypeName ¶
func TypeName[C Configuration]() string
func ValidOrganization ¶ added in v0.0.51
func ValidOrganization(org *basev0.Organization) error
func ValidOrganizationDomain ¶ added in v0.0.51
func ValidateAgent ¶ added in v0.0.51
func ValidateDomain ¶
func ValidateDomain()
func WhichAPIFromEndpoint ¶ added in v0.0.65
func WorkspaceConfigurationDir ¶ added in v0.0.51
func WorkspaceConfigurationDir() string
WorkspaceConfigurationDir returns the directory where the Workspace configuration is stored
Types ¶
type Agent ¶ added in v0.0.23
type Agent struct { Kind AgentKind `yaml:"kind" json:"kind"` Name string `yaml:"name" json:"name"` Version string `yaml:"version" json:"version"` Publisher string `yaml:"publisher" json:"publisher"` }
var CLI *Agent
func AgentFromProto ¶ added in v0.0.51
func ParseAgent ¶ added in v0.0.23
func (*Agent) AsResource ¶ added in v0.0.55
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 basev0.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) DeleteServiceDependencies ¶ added in v0.0.91
func (app *Application) DeleteServiceDependencies(ctx context.Context, ref *ServiceReference) error
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(ctx context.Context, 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 *actionsv0.AddService) (*Service, error)
NewService creates a service in an application
func (*Application) Proto ¶ added in v0.0.51
func (app *Application) Proto() *basev0.Application
func (*Application) PublicEndpoints ¶ added in v0.0.65
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.Dir 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
func (*Application) Unique ¶
func (app *Application) Unique() string
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
func (*DockerImage) FullName ¶ added in v0.1.1
func (image *DockerImage) FullName() string
type Endpoint ¶
type Endpoint struct { Name string `yaml:"name"` Service string `yaml:"service,omitempty"` Application string `yaml:"application,omitempty"` Description string `yaml:"description,omitempty"` Visibility string `yaml:"visibility,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 FromProtoEndpoint ¶ added in v0.0.65
func FromProtoEndpoints ¶ added in v0.0.65
func ParseEndpoint ¶ added in v0.1.6
func (*Endpoint) AsReference ¶ added in v0.0.51
func (e *Endpoint) AsReference() *EndpointReference
type EndpointInstance ¶ added in v0.0.13
func (*EndpointInstance) Address ¶ added in v0.1.6
func (instance *EndpointInstance) Address() (string, error)
func (*EndpointInstance) PortAddress ¶ added in v0.1.6
func (instance *EndpointInstance) PortAddress() (string, error)
type EndpointReference ¶ added in v0.0.9
type EndpointReference struct {
Name string `yaml:"name"`
}
An EndpointReference
type EndpointSummary ¶ added in v0.0.81
func MakeEndpointSummary ¶ added in v0.0.81
func MakeEndpointSummary(endpoints []*basev0.Endpoint) EndpointSummary
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 EnvironmentVariableManager ¶ added in v0.1.6
type EnvironmentVariableManager struct {
// contains filtered or unexported fields
}
func NewEnvironmentVariableManager ¶ added in v0.1.6
func NewEnvironmentVariableManager() *EnvironmentVariableManager
func (*EnvironmentVariableManager) Add ¶ added in v0.1.6
func (holder *EnvironmentVariableManager) Add(envs ...string)
func (*EnvironmentVariableManager) Get ¶ added in v0.1.7
func (holder *EnvironmentVariableManager) Get() []string
func (*EnvironmentVariableManager) GetBase ¶ added in v0.1.8
func (holder *EnvironmentVariableManager) GetBase() []string
func (*EnvironmentVariableManager) GetEndpoint ¶ added in v0.1.6
func (holder *EnvironmentVariableManager) GetEndpoint(ctx context.Context, unique string) (*EndpointInstance, error)
func (*EnvironmentVariableManager) GetProjectProvider ¶ added in v0.1.6
func (*EnvironmentVariableManager) GetServiceProvider ¶ added in v0.1.6
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 Forwarding ¶ added in v0.0.65
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 basev0.HTTPMethod) HTTPMethod
func ConvertMethods ¶ added in v0.0.28
func ConvertMethods(methods []basev0.HTTPMethod) []HTTPMethod
type NilAPIError ¶ added in v0.0.65
type NilAPIError struct {
// contains filtered or unexported fields
}
func (*NilAPIError) Error ¶ added in v0.0.65
func (err *NilAPIError) Error() string
type NilEndpointError ¶ added in v0.0.65
type NilEndpointError struct{}
func (NilEndpointError) Error ¶ added in v0.0.65
func (n NilEndpointError) Error() string
type NoApplicationError ¶
type NoApplicationError struct {
Project string
}
func (NoApplicationError) Error ¶
func (e NoApplicationError) Error() string
type Organization ¶ added in v0.0.51
type Organization struct { // ID must be globally unique ID string `yaml:"id"` Name string `yaml:"name"` Domain string `yaml:"domain"` }
func OrganizationFromProto ¶ added in v0.0.51
func OrganizationFromProto(_ context.Context, m *basev0.Organization) (*Organization, error)
func (*Organization) Proto ¶ added in v0.0.51
func (organization *Organization) Proto() *basev0.Organization
type Project ¶
type Project struct { Name string `yaml:"name"` // ID must be globally unique ID string `yaml:"id,omitempty"` Organization Organization `yaml:"organization"` Domain string `yaml:"domain,omitempty"` Description string `yaml:"description,omitempty"` // Applications in the project Applications []*ApplicationReference `yaml:"applications"` // Environments in the project Environments []*EnvironmentReference `yaml:"environments"` // contains filtered or unexported fields }
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) 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.Dir 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) DeleteServiceDependencies ¶ added in v0.0.91
func (project *Project) DeleteServiceDependencies(ctx context.Context, ref *ServiceReference) error
DeleteServiceDependencies deletes all service dependencies from a 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) 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 *actionsv0.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 *actionsv0.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 ¶
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 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 DetectNewRoutesFromEndpoints ¶ added in v0.0.91
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 are the other services required Dependencies []*ServiceDependency `yaml:"dependencies"` // ProviderDependencies are the providers required ProviderDependencies []string `yaml:"provider-dependencies"` // Endpoints exposed by the service Endpoints []*Endpoint `yaml:"endpoints"` // Spec is the specialized configuration of the service 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) DeleteServiceDependencies ¶ added in v0.0.91
func (s *Service) DeleteServiceDependencies(ctx context.Context, ref *ServiceReference) error
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() *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 ServiceForwarding ¶ added in v0.0.65
type ServiceForwarding struct {
// contains filtered or unexported fields
}
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
func ServiceIdentityFromProto ¶ added in v0.0.71
func ServiceIdentityFromProto(proto *basev0.ServiceIdentity) *ServiceIdentity
func (*ServiceIdentity) AsResource ¶ added in v0.0.55
func (s *ServiceIdentity) AsResource() *wool.Resource
func (*ServiceIdentity) Unique ¶ added in v0.0.55
func (s *ServiceIdentity) Unique() string
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 ServiceWithApplication ¶ added in v0.0.81
func ParseService ¶ added in v0.1.1
func ParseService(input string) (*ServiceWithApplication, error)
func ParseServiceUnique ¶ added in v0.0.81
func ParseServiceUnique(unique string) (*ServiceWithApplication, error)
func (ServiceWithApplication) Unique ¶ added in v0.0.81
func (s ServiceWithApplication) Unique() string
type ServiceWithCase ¶ added in v0.0.26
func ToServiceWithCase ¶ added in v0.0.26
func ToServiceWithCase(svc *Service) *ServiceWithCase
type UnknownAPIError ¶ added in v0.0.65
type UnknownAPIError struct {
// contains filtered or unexported fields
}
func (*UnknownAPIError) Error ¶ added in v0.0.65
func (err *UnknownAPIError) Error() string
type Visibility ¶ added in v0.0.91
type Visibility = string
const ( VisibilityApplication Visibility = "application" VisibilityPublic Visibility = "public" )
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"` // 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) AddProject ¶ added in v0.0.37
func (*Workspace) AddProjectReference ¶ added in v0.0.60
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 *actionsv0.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) 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 *actionsv0.SetProjectActive) error
SetProjectActive sets the active project