Documentation ¶
Index ¶
- Constants
- func APIString(api *basev0.API) string
- func ApplicationMode() bool
- func ConfigurationEnvironmentKeyPrefix(conf *basev0.Configuration) string
- func ConfigurationFile[C Configuration]() string
- func ConfigurationInformationHash(info *basev0.ConfigurationInformation) string
- func ConfigurationInformationsHash(infos ...*basev0.ConfigurationInformation) (string, error)
- func ConvertHTTPMethodToProto(m HTTPMethod) basev0.HTTPMethod
- func ConvertSpec(spec map[string]any) (*basev0.Specs, error)
- func ConvertToAnyPb(value any) (*anypb.Any, error)
- func EndpointAsEnvironmentVariableKey(info *EndpointInformation) string
- func EndpointAsEnvironmentVariableKeyBase(info *EndpointInformation) string
- func EndpointDestination(e *basev0.Endpoint) string
- func EndpointHash(ctx context.Context, endpoints ...*basev0.Endpoint) (string, error)
- func EndpointRestAPI(endpoint *basev0.Endpoint) *basev0.RestAPI
- func EnvironmentVariableAsStrings(envs []EnvironmentVariable) []string
- func ExistsAtDir[C Configuration](dir string) bool
- func ExtendDomain(domain string, extension string) string
- func FilePathForGRPC(ctx context.Context, dir string, unique string, name string) (string, error)
- func FilePathForRest(ctx context.Context, dir string, unique string, routePath string) (string, error)
- func FilterConfigurations(configurations []*basev0.Configuration, scope basev0.NetworkScope) []*basev0.Configuration
- func FindConfigurations(configurations []*basev0.Configuration, scope basev0.NetworkScope) []*basev0.Configuration
- func FindEndpointForGRPCRoute(ctx context.Context, endpoints []*basev0.Endpoint, route *GRPCRoute) *basev0.Endpoint
- func FindEndpointForRestRoute(ctx context.Context, endpoints []*basev0.Endpoint, route *RestRouteGroup) *basev0.Endpoint
- func FindGRPCEndpoint(ctx context.Context, endpoints []*basev0.Endpoint) (*basev0.Endpoint, error)
- func FindHTTPEndpoint(ctx context.Context, endpoints []*basev0.Endpoint) (*basev0.Endpoint, error)
- func FindNetworkInstanceInNetworkMappings(_ context.Context, mappings []*basev0.NetworkMapping, ...) (*basev0.NetworkInstance, error)
- func FindNetworkMapping(_ context.Context, mappings []*basev0.NetworkMapping, ...) (*basev0.NetworkMapping, error)
- func FindRestEndpoint(ctx context.Context, endpoints []*basev0.Endpoint) (*basev0.Endpoint, error)
- func FindTCPEndpoint(ctx context.Context, endpoints []*basev0.Endpoint) (*basev0.Endpoint, error)
- func FindTCPEndpointWithName(ctx context.Context, name string, endpoints []*basev0.Endpoint) (*basev0.Endpoint, error)
- func FindUp[C Configuration](ctx context.Context) (*string, error)
- func FindValueInEnvironmentVariables(ctx context.Context, key string, envs []string) (string, error)
- func FromAnyPb[T any](v *anypb.Any) (*T, error)
- func GetConfigurationValue(ctx context.Context, conf *basev0.Configuration, name string, key string) (string, error)
- func GroupKey(endpoint *basev0.Endpoint, group *basev0.RestRouteGroup) string
- func HasConfigurationInformation(_ context.Context, conf *basev0.Configuration, name string) bool
- func HasPublicEndpoints(endpoints []*basev0.Endpoint) bool
- func Hash(data []byte) string
- func HashString(s string) string
- func HomeDir() (string, error)
- func InPartialMode() bool
- func IsGRPC(_ context.Context, endpoint *basev0.Endpoint) *basev0.GrpcAPI
- func IsHTTP(_ context.Context, endpoint *basev0.Endpoint) *basev0.HttpAPI
- func IsInitialized(ctx context.Context) (bool, error)
- func IsLocal(environment *basev0.Environment) bool
- func IsRest(_ context.Context, endpoint *basev0.Endpoint) *basev0.RestAPI
- func IsTCP(_ context.Context, endpoint *basev0.Endpoint) *basev0.TcpAPI
- 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 Configuration](fs shared.FileSystem) (*C, error)
- func LoadFromPath[C Configuration](ctx context.Context, p string) (*C, error)
- func LoadGrpcAPI(_ context.Context, f *string) (*basev0.GrpcAPI, error)
- func LoadHTTPAPI(_ context.Context) (*basev0.HttpAPI, error)
- func LoadRestAPI(ctx context.Context, f *string) (*basev0.RestAPI, error)
- func LoadSpec(ctx context.Context, content []byte, obj any) error
- func LoadTCPAPI(_ context.Context) (*basev0.TcpAPI, error)
- func LocalProto() *basev0.Environment
- func LocalizeNetworkMapping(mappings []*basev0.NetworkMapping, hostname string) []*basev0.NetworkMapping
- func MakeConfigurationInformationSummary(info *basev0.ConfigurationInformation) string
- func MakeConfigurationSummary(conf *basev0.Configuration) string
- func MakeConfigurationValueSummary(value *basev0.ConfigurationValue) string
- func MakeEndpointSummary(endpoint *basev0.Endpoint) string
- func MakeManyConfigurationSummary(confs []*basev0.Configuration) string
- func MakeManyNetworkMappingSummary(mappings []*basev0.NetworkMapping) string
- func MakeNetworkMappingSummary(mapping *basev0.NetworkMapping) string
- func NameToKey(name string) string
- func NetworkInstanceSummary(value *basev0.NetworkInstance) string
- func NetworkMappingHash(networkMappings ...*basev0.NetworkMapping) (string, error)
- func NewAPI(_ context.Context, endpoint *Endpoint, api *basev0.API) (*basev0.Endpoint, error)
- func NewHTTPNetworkInstance(hostname string, port uint16, secured bool) *basev0.NetworkInstance
- func NewNetworkInstance(hostname string, port uint16) *basev0.NetworkInstance
- func OverridePath(defaultPath string, path string) *string
- func ParseOpenAPI(spec []byte) (*openapispec.Swagger, error)
- func Path[C Configuration](ctx context.Context, dir string) (string, error)
- func PortFromAddress(address string) (uint16, error)
- func ReferenceMatch(entry string, name string) bool
- func RegisterAgent(kind AgentKind, protoKind basev0.Agent_Kind)
- func RestRouteEnvironmentVariableKey(info *EndpointInformation, route *basev0.RestRoute) string
- func RestRoutes(rest *basev0.RestAPI) string
- func SaveToDir[C Configuration](ctx context.Context, c *C, dir string) error
- func ScopeAsString(scope basev0.NetworkScope) string
- func ScopeString(scope basev0.NetworkScope) string
- func SerializeSpec(ctx context.Context, spec any) ([]byte, error)
- func ServiceConfigurationEnvironmentKeyPrefixFromUnique(unique string) string
- func ServiceConfigurationKey(service *Service, name string, key string) string
- func ServiceConfigurationKeyFromUnique(unique string, name string, key string) string
- func ServiceSecretConfigurationEnvironmentKeyPrefixFromUnique(unique string) string
- func ServiceSecretConfigurationKey(service *Service, name string, key string) string
- func ServiceSecretConfigurationKeyFromUnique(unique string, name string, key string) string
- func ServiceUnique(app string, service string) string
- func ServiceUniqueFromEndpoint(endpoint *basev0.Endpoint) string
- func SetLoadWorkspaceUnsafe(w *Workspace)
- func SetMode(m Mode)
- func ToGrpcAPI(grpc *basev0.GrpcAPI) *basev0.API
- func ToHTTPAPI(http *basev0.HttpAPI) *basev0.API
- func ToOrganizationName(svc string) string
- func ToOrganizationSourceVersionControl(name string) string
- func ToRestAPI(rest *basev0.RestAPI) *basev0.API
- func ToTCPAPI(tcp *basev0.TcpAPI) *basev0.API
- func TypeName[C Configuration]() string
- func UniqueToKey(origin string) string
- func ValidOrganization(org *basev0.Organization) error
- func Validate(req proto.Message) error
- func ValidateAgent(agent *basev0.Agent) error
- func ValidateDomain()
- func WorkspaceConfigurationDir() string
- 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) AddServiceReference(_ context.Context, ref *ServiceReference) 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) 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) ServicePath(_ context.Context, ref *ServiceReference) string
- func (app *Application) Unique() string
- func (app *Application) Validate() error
- type ApplicationReference
- func (ref *ApplicationReference) AddService(_ context.Context, service *ServiceReference) error
- func (ref *ApplicationReference) GetActive(ctx context.Context) (*ServiceReference, error)
- func (ref *ApplicationReference) GetActiveService(ctx context.Context) (*ServiceReference, error)
- func (ref *ApplicationReference) GetServiceFromName(ctx context.Context, serviceName string) (*ServiceReference, error)
- func (ref *ApplicationReference) String() string
- type ClientEntry
- type Configuration
- type DockerImage
- type Endpoint
- type EndpointAccess
- type EndpointInformation
- type EndpointReference
- type EndpointSummary
- type Environment
- type EnvironmentExistsError
- type EnvironmentReference
- type EnvironmentVariable
- func AsRestRouteEnvironmentVariable(ctx context.Context, endpoint *basev0.Endpoint) []EnvironmentVariable
- func ConfigurationAsEnvironmentVariables(conf *basev0.Configuration, secret bool) []EnvironmentVariable
- func EndpointAsEnvironmentVariable(endpoint *basev0.Endpoint, instance *basev0.NetworkInstance) EnvironmentVariable
- func Env(key string, value any) EnvironmentVariable
- func EnvironmentAsEnvironmentVariable(env *basev0.Environment) EnvironmentVariable
- func RestRoutesAsEnvironmentVariable(endpoint *basev0.Endpoint, route *basev0.RestRoute) EnvironmentVariable
- type EnvironmentVariableManager
- func (holder *EnvironmentVariableManager) AddConfigurations(configurations ...*basev0.Configuration) error
- func (holder *EnvironmentVariableManager) AddEndpoints(ctx context.Context, mappings []*basev0.NetworkMapping, ...) error
- func (holder *EnvironmentVariableManager) AddRestRoutes(ctx context.Context, mappings []*basev0.NetworkMapping, ...) error
- func (holder *EnvironmentVariableManager) All() []EnvironmentVariable
- func (holder *EnvironmentVariableManager) Configurations() []EnvironmentVariable
- func (holder *EnvironmentVariableManager) Secrets() []EnvironmentVariable
- func (holder *EnvironmentVariableManager) SetEnvironment(environment *basev0.Environment)
- func (holder *EnvironmentVariableManager) SetNetworkScope(scope basev0.NetworkScope)
- func (holder *EnvironmentVariableManager) SetRunning(b bool)
- type ExtendedGRPCRoute
- type ExtendedGRPCRouteLoader
- type ExtendedRestRoute
- type ExtendedRestRouteGroup
- type ExtendedRouteLoader
- func (loader *ExtendedRouteLoader[T]) AddGroup(group *ExtendedRestRouteGroup[T])
- func (loader *ExtendedRouteLoader[T]) All() []*ExtendedRestRoute[T]
- func (loader *ExtendedRouteLoader[T]) GroupFor(unique string, routePath string) *ExtendedRestRouteGroup[T]
- func (loader *ExtendedRouteLoader[T]) Groups() []*ExtendedRestRouteGroup[T]
- func (loader *ExtendedRouteLoader[T]) GroupsFor(unique string) []*ExtendedRestRouteGroup[T]
- func (loader *ExtendedRouteLoader[T]) Load(ctx context.Context) error
- func (loader *ExtendedRouteLoader[T]) Save(ctx context.Context) error
- type Forwarding
- type GRPCRoute
- func DetectNewGRPCRoutesFromEndpoints(ctx context.Context, endpoints []*basev0.Endpoint, known []*GRPCRoute) []*GRPCRoute
- func GRPCRouteFromProto(e *basev0.Endpoint, grpc *basev0.GrpcAPI, rpc *basev0.RPC) *GRPCRoute
- func LoadGRPCRoute(ctx context.Context, p string) (*GRPCRoute, error)
- func UnwrapGRPCRoute[T any](route *ExtendedGRPCRoute[T]) *GRPCRoute
- type GRPCRouteLoader
- type HTTPAPI
- type HTTPMethod
- type Hasher
- type Mode
- type NetworkInstance
- type NewApplicationInput
- type NoApplicationError
- type NonUniqueServiceNameError
- type OpenAPICombinator
- func (c *OpenAPICombinator) Combine(ctx context.Context) (*basev0.Endpoint, error)
- func (c *OpenAPICombinator) LoadEndpoints(ctx context.Context, endpoints ...*basev0.Endpoint) error
- func (c *OpenAPICombinator) Only(unique string, path string)
- func (c *OpenAPICombinator) WithDestination(filename string)
- func (c *OpenAPICombinator) WithVersion(version string)
- type Organization
- type Partial
- type Project
- func CreateProject(ctx context.Context, action *actionsv0.NewProject) (*Project, error)
- func LoadProjectFromDir(ctx context.Context, dir string) (*Project, error)
- func LoadProjectFromPath(ctx context.Context) (*Project, error)
- func NewProject(ctx context.Context, name string) (*Project, error)
- func ReloadProject(ctx context.Context, project *Project) (*Project, error)
- func (project *Project) AddApplicationReference(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) FindUniqueService(ctx context.Context, name string) (*Service, 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) LoadService(ctx context.Context, input *ServiceWithApplication) (*Service, error)
- func (project *Project) LoadServices(ctx context.Context) ([]*Service, error)
- func (project *Project) NewApplication(ctx context.Context, action *actionsv0.NewApplication) (*Application, error)
- func (project *Project) NewEnvironment(_ context.Context, input *actionsv0.AddEnvironment) (*Environment, error)
- func (project *Project) Proto() (*basev0.Project, error)
- func (project *Project) Reference() *ProjectReference
- func (project *Project) Save(ctx context.Context) error
- func (project *Project) SaveToDirUnsafe(ctx context.Context, dir string) error
- func (project *Project) Unique() string
- type ProjectReference
- func (ref *ProjectReference) AddApplication(ctx context.Context, application *ApplicationReference) error
- func (ref *ProjectReference) GetActiveApplication(ctx context.Context) (*ApplicationReference, error)
- func (ref *ProjectReference) GetApplicationFromName(ctx context.Context, applicationName string) (*ApplicationReference, error)
- func (ref *ProjectReference) String() string
- type Readme
- type RestRoute
- type RestRouteAccess
- type RestRouteGroup
- type RestRouteLoader
- func (loader *RestRouteLoader) All() []*RestRoute
- func (loader *RestRouteLoader) GroupFor(unique string, routePath string) *RestRouteGroup
- func (loader *RestRouteLoader) Groups() []*RestRouteGroup
- func (loader *RestRouteLoader) GroupsFor(unique string) []*RestRouteGroup
- func (loader *RestRouteLoader) Load(ctx context.Context) error
- type RouteUnique
- type RunningOptions
- type Service
- func (s *Service) AddDependency(ctx context.Context, requirement *Service, requiredEndpoints []*Endpoint) error
- func (s *Service) BaseEndpoint(name string) *Endpoint
- func (s *Service) DeleteServiceDependencies(ctx context.Context, ref *ServiceReference) error
- func (s *Service) Dir() 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) LoadEndpoints(ctx context.Context) ([]*basev0.Endpoint, error)
- func (s *Service) LoadSettingsFromSpec(t any) error
- func (s *Service) Local(f string) string
- func (s *Service) LocalOrNil(f string) *string
- func (s *Service) Proto() *basev0.Service
- func (s *Service) ProviderDirectory(ctx context.Context, env *Environment) (string, error)
- func (s *Service) Reference() *ServiceReference
- 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) UniqueWithProject() string
- func (s *Service) UpdateSpecFromSettings(spec any) error
- func (s *Service) Validate() error
- func (s *Service) WithDir(dir string)
- type ServiceDependency
- type ServiceForwarding
- type ServiceIdentity
- type ServiceReference
- type ServiceWithApplication
- type ServiceWithCase
- type TCP
- type Visibility
- type Workspace
- func LoadWorkspace(ctx context.Context, name string) (*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) AddApplicationReference(ctx context.Context, projectName string, application *ApplicationReference) error
- func (workspace *Workspace) AddProjectReference(ctx context.Context, ref *ProjectReference) error
- func (workspace *Workspace) AddService(ctx context.Context, projectName string, applicationName string, ...) error
- func (workspace *Workspace) DeleteApplication(ctx context.Context, projectName string, name string) error
- func (workspace *Workspace) DeleteProject(ctx context.Context, name string) error
- func (workspace *Workspace) DeleteService(ctx context.Context, projectName string, appName string, name string) error
- func (workspace *Workspace) Dir() string
- func (workspace *Workspace) FindProjectReference(name string) (*ProjectReference, error)
- func (workspace *Workspace) GetActiveProject(ctx context.Context) (*ProjectReference, error)
- func (workspace *Workspace) HasProject(name string) bool
- func (workspace *Workspace) LoadActiveApplication(ctx context.Context, projectName string) (*Application, error)
- func (workspace *Workspace) LoadActiveProject(ctx context.Context) (*Project, error)
- func (workspace *Workspace) LoadActiveService(ctx context.Context, projectName string, applicationName string) (*Service, 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) ProjectNames() []string
- func (workspace *Workspace) Save(ctx context.Context) error
- func (workspace *Workspace) SetActiveService(ctx context.Context, projectName string, applicationName string, ...) error
- func (workspace *Workspace) SetApplicationActive(ctx context.Context, project string, name string) error
- func (workspace *Workspace) SetProjectActive(ctx context.Context, project string) error
- func (workspace *Workspace) Unique() string
- type WrapperSwagger
Constants ¶
const ( ApplicationKind = "application" ApplicationConfigurationName = "application.codefly.yaml" )
const ( AGENT = "agent" PROJECT = "project" APPLICATION = "application" SERVICE = "service" ENDPOINT = "info" )
const AgentConfigurationName = "agent.codefly.yaml"
const BuilderServiceAgent = "codefly:service:builder"
const ConfigurationPrefix = "CODEFLY__CONFIGURATION"
const ConfigurationProjectOrigin = "_project.configuration"
const EndpointPrefix = "CODEFLY__ENDPOINT"
const EnvironmentPrefix = "CODEFLY_ENVIRONMENT"
const GRPCRouteFileSuffix = ".grpc.codefly.yaml"
const LocalWorkspace = "local"
const ProjectConfigurationName = "project.codefly.yaml"
const ProjectConfigurationPrefix = "CODEFLY__PROJECT_CONFIGURATION"
const ProjectSecretConfigurationPrefix = "CODEFLY__PROJECT_SECRET_CONFIGURATION"
const RestRouteFileSuffix = ".rest.codefly.yaml"
const RestRoutePrefix = "CODEFLY__REST_ROUTE"
const RunningPrefix = "CODEFLY__RUNNING"
const RuntimeServiceAgent = "codefly:service:runtime"
const ServiceAgent = AgentKind("codefly:service")
const ServiceConfigurationName = "service.codefly.yaml"
const ServiceConfigurationPrefix = "CODEFLY__SERVICE_CONFIGURATION"
const ServiceSecretConfigurationPrefix = "CODEFLY__SERVICE_SECRET_CONFIGURATION"
const WorkspaceConfigurationName = "workspace.codefly.yaml"
Variables ¶
This section is empty.
Functions ¶
func ApplicationMode ¶ added in v0.0.51
func ApplicationMode() bool
func ConfigurationEnvironmentKeyPrefix ¶ added in v0.1.62
func ConfigurationEnvironmentKeyPrefix(conf *basev0.Configuration) string
func ConfigurationFile ¶ added in v0.0.42
func ConfigurationFile[C Configuration]() string
func ConfigurationInformationHash ¶ added in v0.1.62
func ConfigurationInformationHash(info *basev0.ConfigurationInformation) string
func ConfigurationInformationsHash ¶ added in v0.1.62
func ConfigurationInformationsHash(infos ...*basev0.ConfigurationInformation) (string, error)
func ConvertHTTPMethodToProto ¶ added in v0.1.37
func ConvertHTTPMethodToProto(m HTTPMethod) basev0.HTTPMethod
func EndpointAsEnvironmentVariableKey ¶ added in v0.1.64
func EndpointAsEnvironmentVariableKey(info *EndpointInformation) string
func EndpointAsEnvironmentVariableKeyBase ¶ added in v0.1.81
func EndpointAsEnvironmentVariableKeyBase(info *EndpointInformation) string
func EndpointDestination ¶ added in v0.0.81
func EndpointHash ¶ added in v0.1.20
func EndpointRestAPI ¶ added in v0.1.14
func EnvironmentVariableAsStrings ¶ added in v0.1.81
func EnvironmentVariableAsStrings(envs []EnvironmentVariable) []string
func ExistsAtDir ¶
func ExistsAtDir[C Configuration](dir string) bool
func ExtendDomain ¶
func FilePathForGRPC ¶ added in v0.1.35
func FilePathForRest ¶ added in v0.1.35
func FilterConfigurations ¶ added in v0.1.64
func FilterConfigurations(configurations []*basev0.Configuration, scope basev0.NetworkScope) []*basev0.Configuration
func FindConfigurations ¶ added in v0.1.62
func FindConfigurations(configurations []*basev0.Configuration, scope basev0.NetworkScope) []*basev0.Configuration
func FindEndpointForGRPCRoute ¶ added in v0.1.35
func FindEndpointForGRPCRoute(ctx context.Context, endpoints []*basev0.Endpoint, route *GRPCRoute) *basev0.Endpoint
FindEndpointForGRPCRoute finds the info that matches the route rpcs
func FindEndpointForRestRoute ¶ added in v0.1.35
func FindEndpointForRestRoute(ctx context.Context, endpoints []*basev0.Endpoint, route *RestRouteGroup) *basev0.Endpoint
FindEndpointForRestRoute finds the info that matches the route rpcs
func FindGRPCEndpoint ¶ added in v0.1.81
func FindHTTPEndpoint ¶ added in v0.1.64
func FindNetworkInstanceInNetworkMappings ¶ added in v0.1.81
func FindNetworkInstanceInNetworkMappings(_ context.Context, mappings []*basev0.NetworkMapping, endpoint *basev0.Endpoint, scope basev0.NetworkScope) (*basev0.NetworkInstance, error)
func FindNetworkMapping ¶ added in v0.1.55
func FindNetworkMapping(_ context.Context, mappings []*basev0.NetworkMapping, endpoint *basev0.Endpoint) (*basev0.NetworkMapping, error)
func FindRestEndpoint ¶ added in v0.1.62
func FindTCPEndpoint ¶ added in v0.1.62
func FindTCPEndpointWithName ¶ added in v0.1.63
func FindUp ¶
func FindUp[C Configuration](ctx context.Context) (*string, error)
FindUp looks for a configuration in the active directory and up
func FindValueInEnvironmentVariables ¶ added in v0.1.81
func GetConfigurationValue ¶ added in v0.1.62
func GroupKey ¶ added in v0.1.53
func GroupKey(endpoint *basev0.Endpoint, group *basev0.RestRouteGroup) string
func HasConfigurationInformation ¶ added in v0.1.82
func HasPublicEndpoints ¶ added in v0.1.81
func HashString ¶ added in v0.1.20
func InPartialMode ¶ added in v0.0.15
func InPartialMode() bool
func IsLocal ¶ added in v0.1.25
func IsLocal(environment *basev0.Environment) 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 Configuration](fs shared.FileSystem) (*C, error)
func LoadFromPath ¶
func LoadFromPath[C Configuration](ctx context.Context, p string) (*C, error)
func LoadGrpcAPI ¶ added in v0.1.62
func LoadRestAPI ¶ added in v0.1.62
func LocalProto ¶ added in v0.1.33
func LocalProto() *basev0.Environment
func LocalizeNetworkMapping ¶ added in v0.1.83
func LocalizeNetworkMapping(mappings []*basev0.NetworkMapping, hostname string) []*basev0.NetworkMapping
func MakeConfigurationInformationSummary ¶ added in v0.1.62
func MakeConfigurationInformationSummary(info *basev0.ConfigurationInformation) string
func MakeConfigurationSummary ¶ added in v0.1.62
func MakeConfigurationSummary(conf *basev0.Configuration) string
func MakeConfigurationValueSummary ¶ added in v0.1.62
func MakeConfigurationValueSummary(value *basev0.ConfigurationValue) string
func MakeEndpointSummary ¶ added in v0.0.81
func MakeManyConfigurationSummary ¶ added in v0.1.62
func MakeManyConfigurationSummary(confs []*basev0.Configuration) string
func MakeManyNetworkMappingSummary ¶ added in v0.1.62
func MakeManyNetworkMappingSummary(mappings []*basev0.NetworkMapping) string
func BuildMappingInstance(mapping *basev0.NetworkMapping) (*MappingInstance, error) { address := mapping.Address port, err := PortFromAddress(address) if err != nil { return nil, fmt.Errorf("invalid network port") } return &MappingInstance{ Address: address, Port: port, }, nil }
func MakeNetworkMappingSummary ¶ added in v0.1.20
func MakeNetworkMappingSummary(mapping *basev0.NetworkMapping) string
func NetworkInstanceSummary ¶ added in v0.1.69
func NetworkInstanceSummary(value *basev0.NetworkInstance) string
func NetworkMappingHash ¶ added in v0.1.20
func NetworkMappingHash(networkMappings ...*basev0.NetworkMapping) (string, error)
func NewHTTPNetworkInstance ¶ added in v0.1.71
func NewHTTPNetworkInstance(hostname string, port uint16, secured bool) *basev0.NetworkInstance
func NewNetworkInstance ¶ added in v0.1.64
func NewNetworkInstance(hostname string, port uint16) *basev0.NetworkInstance
func OverridePath ¶ added in v0.0.51
OverridePath is nil if the name is the same as the desired relative path
func ParseOpenAPI ¶ added in v0.1.14
func ParseOpenAPI(spec []byte) (*openapispec.Swagger, error)
func PortFromAddress ¶ added in v0.1.43
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 RestRouteEnvironmentVariableKey(info *EndpointInformation, route *basev0.RestRoute) string
func RestRoutes ¶ added in v0.1.75
func ScopeAsString ¶ added in v0.1.69
func ScopeAsString(scope basev0.NetworkScope) string
func ScopeString ¶ added in v0.1.62
func ScopeString(scope basev0.NetworkScope) string
func ServiceConfigurationEnvironmentKeyPrefixFromUnique ¶ added in v0.1.69
func ServiceConfigurationKey ¶ added in v0.1.69
func ServiceConfigurationKeyFromUnique ¶ added in v0.1.81
func ServiceSecretConfigurationEnvironmentKeyPrefixFromUnique ¶ added in v0.1.69
func ServiceSecretConfigurationKey ¶ added in v0.1.69
func ServiceSecretConfigurationKeyFromUnique ¶ added in v0.1.81
func ServiceUnique ¶ added in v0.0.81
func ServiceUniqueFromEndpoint ¶ added in v0.1.31
func SetLoadWorkspaceUnsafe ¶ added in v0.0.51
func SetLoadWorkspaceUnsafe(w *Workspace)
func ToOrganizationName ¶ added in v0.1.18
func ToOrganizationSourceVersionControl ¶ added in v0.1.38
func TypeName ¶
func TypeName[C Configuration]() string
func UniqueToKey ¶ added in v0.1.62
func ValidOrganization ¶ added in v0.0.51
func ValidOrganization(org *basev0.Organization) error
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
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"` Description string `yaml:"description,omitempty"` ServiceReferences []*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) AddServiceReference ¶ added in v0.1.38
func (app *Application) AddServiceReference(_ context.Context, ref *ServiceReference) 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) 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) 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) Unique ¶
func (app *Application) Unique() string
func (*Application) Validate ¶ added in v0.1.18
func (app *Application) Validate() error
type ApplicationReference ¶ added in v0.0.9
type ApplicationReference struct { Name string `yaml:"name"` PathOverride *string `yaml:"path,omitempty"` Services []*ServiceReference `yaml:"services,omitempty"` ActiveService string `yaml:"active-service,omitempty"` }
An ApplicationReference
func (*ApplicationReference) AddService ¶ added in v0.1.18
func (ref *ApplicationReference) AddService(_ context.Context, service *ServiceReference) error
func (*ApplicationReference) GetActive ¶ added in v0.1.18
func (ref *ApplicationReference) GetActive(ctx context.Context) (*ServiceReference, error)
func (*ApplicationReference) GetActiveService ¶ added in v0.1.18
func (ref *ApplicationReference) GetActiveService(ctx context.Context) (*ServiceReference, error)
func (*ApplicationReference) GetServiceFromName ¶ added in v0.1.18
func (ref *ApplicationReference) GetServiceFromName(ctx context.Context, serviceName string) (*ServiceReference, error)
func (*ApplicationReference) String ¶ added in v0.1.48
func (ref *ApplicationReference) String() string
type ClientEntry ¶
func (*ClientEntry) Validate ¶
func (c *ClientEntry) Validate() error
type Configuration ¶
type Configuration interface{}
type DockerImage ¶ added in v0.0.26
func NewDockerImage ¶ added in v0.1.84
func NewDockerImage(s string) *DockerImage
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"` }
Endpoint is the fundamental entity that standardize communication between services.
func EndpointFromProto ¶ added in v0.1.22
func FromProtoEndpoints ¶ added in v0.0.65
func (*Endpoint) AsReference ¶ added in v0.0.51
func (endpoint *Endpoint) AsReference() *EndpointReference
func (*Endpoint) Information ¶ added in v0.1.53
func (endpoint *Endpoint) Information() *EndpointInformation
func (*Endpoint) ServiceUnique ¶ added in v0.1.14
type EndpointAccess ¶ added in v0.1.64
type EndpointAccess struct { *basev0.Endpoint *basev0.NetworkInstance }
type EndpointInformation ¶ added in v0.1.53
func EndpointInformationFromProto ¶ added in v0.1.64
func EndpointInformationFromProto(endpoint *basev0.Endpoint) *EndpointInformation
func ParseEndpoint ¶ added in v0.1.6
func ParseEndpoint(unique string) (*EndpointInformation, error)
func (*EndpointInformation) Identifier ¶ added in v0.1.53
func (endpoint *EndpointInformation) Identifier() string
Identifier satisfies this format: - name::api if name != api - api if name == api or name == ""
func (*EndpointInformation) UnknownAPI ¶ added in v0.1.53
func (endpoint *EndpointInformation) UnknownAPI() bool
type EndpointReference ¶ added in v0.0.9
type EndpointReference struct {
Name string `yaml:"name"`
}
An EndpointReference
type EndpointSummary ¶ added in v0.0.81
func MakeManyEndpointSummary ¶ added in v0.1.62
func MakeManyEndpointSummary(endpoints []*basev0.Endpoint) EndpointSummary
type Environment ¶ added in v0.0.17
type Environment struct { Name string `yaml:"name"` Description string `yaml:"description,omitempty"` LoadBalancer string `yaml:"loadBalancer,omitempty"` }
Environment is a configuration for an environment
func EnvironmentFromProto ¶ added in v0.1.20
func EnvironmentFromProto(env *basev0.Environment) *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
func (*Environment) Local ¶ added in v0.1.83
func (env *Environment) Local() bool
func (*Environment) Proto ¶ added in v0.1.20
func (env *Environment) Proto() (*basev0.Environment, error)
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 EnvironmentVariable ¶ added in v0.1.81
func AsRestRouteEnvironmentVariable ¶ added in v0.0.91
func AsRestRouteEnvironmentVariable(ctx context.Context, endpoint *basev0.Endpoint) []EnvironmentVariable
func ConfigurationAsEnvironmentVariables ¶ added in v0.1.62
func ConfigurationAsEnvironmentVariables(conf *basev0.Configuration, secret bool) []EnvironmentVariable
ConfigurationAsEnvironmentVariables converts a configuration to a list of environment variables the secret flag decides if we return secret or regular values
func EndpointAsEnvironmentVariable ¶ added in v0.1.64
func EndpointAsEnvironmentVariable(endpoint *basev0.Endpoint, instance *basev0.NetworkInstance) EnvironmentVariable
func Env ¶ added in v0.1.81
func Env(key string, value any) EnvironmentVariable
func EnvironmentAsEnvironmentVariable ¶ added in v0.1.20
func EnvironmentAsEnvironmentVariable(env *basev0.Environment) EnvironmentVariable
func RestRoutesAsEnvironmentVariable ¶ added in v0.0.91
func RestRoutesAsEnvironmentVariable(endpoint *basev0.Endpoint, route *basev0.RestRoute) EnvironmentVariable
func (EnvironmentVariable) String ¶ added in v0.1.81
func (v EnvironmentVariable) String() string
func (EnvironmentVariable) ValueAsEncodedString ¶ added in v0.1.82
func (v EnvironmentVariable) ValueAsEncodedString() string
func (EnvironmentVariable) ValueAsString ¶ added in v0.1.81
func (v EnvironmentVariable) ValueAsString() 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) AddConfigurations ¶ added in v0.1.62
func (holder *EnvironmentVariableManager) AddConfigurations(configurations ...*basev0.Configuration) error
func (*EnvironmentVariableManager) AddEndpoints ¶ added in v0.1.73
func (holder *EnvironmentVariableManager) AddEndpoints(ctx context.Context, mappings []*basev0.NetworkMapping, scope basev0.NetworkScope) error
func (*EnvironmentVariableManager) AddRestRoutes ¶ added in v0.1.73
func (holder *EnvironmentVariableManager) AddRestRoutes(ctx context.Context, mappings []*basev0.NetworkMapping, scope basev0.NetworkScope) error
func (*EnvironmentVariableManager) All ¶ added in v0.1.64
func (holder *EnvironmentVariableManager) All() []EnvironmentVariable
func (*EnvironmentVariableManager) Configurations ¶ added in v0.1.64
func (holder *EnvironmentVariableManager) Configurations() []EnvironmentVariable
func (*EnvironmentVariableManager) Secrets ¶ added in v0.1.64
func (holder *EnvironmentVariableManager) Secrets() []EnvironmentVariable
func (*EnvironmentVariableManager) SetEnvironment ¶ added in v0.1.62
func (holder *EnvironmentVariableManager) SetEnvironment(environment *basev0.Environment)
func (*EnvironmentVariableManager) SetNetworkScope ¶ added in v0.1.69
func (holder *EnvironmentVariableManager) SetNetworkScope(scope basev0.NetworkScope)
func (*EnvironmentVariableManager) SetRunning ¶ added in v0.1.64
func (holder *EnvironmentVariableManager) SetRunning(b bool)
type ExtendedGRPCRoute ¶ added in v0.1.35
func LoadExtendedGRPCRoute ¶ added in v0.1.35
type ExtendedGRPCRouteLoader ¶ added in v0.1.35
type ExtendedGRPCRouteLoader[T any] struct { // contains filtered or unexported fields }
ExtendedGRPCRouteLoader will return all GRPC route groups in a directory
func NewExtendedGRPCRouteLoader ¶ added in v0.1.35
func (*ExtendedGRPCRouteLoader[T]) Add ¶ added in v0.1.35
func (loader *ExtendedGRPCRouteLoader[T]) Add(route *ExtendedGRPCRoute[T])
func (*ExtendedGRPCRouteLoader[T]) All ¶ added in v0.1.35
func (loader *ExtendedGRPCRouteLoader[T]) All() []*ExtendedGRPCRoute[T]
type ExtendedRestRoute ¶ added in v0.0.13
func NewExtendedRestRoute ¶ added in v0.0.13
func NewExtendedRestRoute[T any](rest RestRoute, value T) *ExtendedRestRoute[T]
type ExtendedRestRouteGroup ¶ added in v0.1.18
type ExtendedRestRouteGroup[T any] struct { Path string `yaml:"path"` Routes []*ExtendedRestRoute[T] `yaml:"routes"` Application string `yaml:"-"` Service string `yaml:"-"` }
func LoadExtendedRestRouteGroup ¶ added in v0.1.18
func (*ExtendedRestRouteGroup[T]) Add ¶ added in v0.1.18
func (g *ExtendedRestRouteGroup[T]) Add(route ExtendedRestRoute[T])
func (*ExtendedRestRouteGroup[T]) Save ¶ added in v0.1.18
func (g *ExtendedRestRouteGroup[T]) Save(ctx context.Context, dir string) error
func (*ExtendedRestRouteGroup[T]) ServiceUnique ¶ added in v0.1.18
func (g *ExtendedRestRouteGroup[T]) ServiceUnique() string
type ExtendedRouteLoader ¶ added in v0.1.18
type ExtendedRouteLoader[T any] struct { // contains filtered or unexported fields }
ExtendedRouteLoader will return all rest route groups in a directory
func NewExtendedRestRouteLoader ¶ added in v0.1.35
func (*ExtendedRouteLoader[T]) AddGroup ¶ added in v0.1.18
func (loader *ExtendedRouteLoader[T]) AddGroup(group *ExtendedRestRouteGroup[T])
func (*ExtendedRouteLoader[T]) All ¶ added in v0.1.18
func (loader *ExtendedRouteLoader[T]) All() []*ExtendedRestRoute[T]
func (*ExtendedRouteLoader[T]) GroupFor ¶ added in v0.1.18
func (loader *ExtendedRouteLoader[T]) GroupFor(unique string, routePath string) *ExtendedRestRouteGroup[T]
func (*ExtendedRouteLoader[T]) Groups ¶ added in v0.1.18
func (loader *ExtendedRouteLoader[T]) Groups() []*ExtendedRestRouteGroup[T]
func (*ExtendedRouteLoader[T]) GroupsFor ¶ added in v0.1.18
func (loader *ExtendedRouteLoader[T]) GroupsFor(unique string) []*ExtendedRestRouteGroup[T]
type Forwarding ¶ added in v0.0.65
type GRPCRoute ¶ added in v0.1.35
type GRPCRoute struct { Name string `yaml:"name"` Package string `yaml:"package"` ServiceName string `yaml:"service-name"` Application string `yaml:"-"` Service string `yaml:"-"` }
func DetectNewGRPCRoutesFromEndpoints ¶ added in v0.1.35
func GRPCRouteFromProto ¶ added in v0.1.35
func LoadGRPCRoute ¶ added in v0.1.35
func UnwrapGRPCRoute ¶ added in v0.1.35
func UnwrapGRPCRoute[T any](route *ExtendedGRPCRoute[T]) *GRPCRoute
func (*GRPCRoute) ServiceUnique ¶ added in v0.1.35
type GRPCRouteLoader ¶ added in v0.1.35
type GRPCRouteLoader struct {
// contains filtered or unexported fields
}
GRPCRouteLoader will return all GRPC route groups in a directory
func NewGRPCRouteLoader ¶ added in v0.1.35
func NewGRPCRouteLoader(ctx context.Context, dir string) (*GRPCRouteLoader, error)
func (*GRPCRouteLoader) All ¶ added in v0.1.35
func (loader *GRPCRouteLoader) All() []*GRPCRoute
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 ConvertHTTPMethodFromProto ¶ added in v0.1.37
func ConvertHTTPMethodFromProto(m basev0.HTTPMethod) HTTPMethod
type NetworkInstance ¶ added in v0.1.81
func DefaultNetworkInstance ¶ added in v0.1.81
func DefaultNetworkInstance(api string) *NetworkInstance
func FindNetworkInstanceInEnvironmentVariables ¶ added in v0.1.81
func FindNetworkInstanceInEnvironmentVariables(ctx context.Context, endpointInfo *EndpointInformation, envs []string) (*NetworkInstance, error)
func ParseAddress ¶ added in v0.1.81
func ParseAddress(address string) (*NetworkInstance, error)
type NewApplicationInput ¶ added in v0.1.38
type NewApplicationInput struct {
Name string
}
type NoApplicationError ¶
type NoApplicationError struct {
Project string
}
func (NoApplicationError) Error ¶
func (e NoApplicationError) Error() string
type NonUniqueServiceNameError ¶ added in v0.1.78
type NonUniqueServiceNameError struct {
// contains filtered or unexported fields
}
func (NonUniqueServiceNameError) Error ¶ added in v0.1.78
func (n NonUniqueServiceNameError) Error() string
type OpenAPICombinator ¶ added in v0.1.14
type OpenAPICombinator struct {
// contains filtered or unexported fields
}
func NewOpenAPICombinator ¶ added in v0.1.14
func (*OpenAPICombinator) LoadEndpoints ¶ added in v0.1.14
func (*OpenAPICombinator) Only ¶ added in v0.1.14
func (c *OpenAPICombinator) Only(unique string, path string)
func (*OpenAPICombinator) WithDestination ¶ added in v0.1.14
func (c *OpenAPICombinator) WithDestination(filename string)
func (*OpenAPICombinator) WithVersion ¶ added in v0.1.14
func (c *OpenAPICombinator) WithVersion(version string)
type Organization ¶ added in v0.0.51
type Organization struct { // ID must be globally unique ID string `yaml:"id"` Name string `yaml:"name"` }
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"` 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 CreateProject ¶ added in v0.1.53
CreateProject creates a new project
func LoadProjectFromDir ¶
LoadProjectFromDir loads a Project configuration from a directory
func LoadProjectFromPath ¶ added in v0.0.51
func ReloadProject ¶ added in v0.1.18
func (*Project) AddApplicationReference ¶ added in v0.1.38
func (project *Project) AddApplicationReference(app *ApplicationReference) error
AddApplicationReference 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) FindUniqueService ¶ added in v0.1.78
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) LoadService ¶ added in v0.1.31
func (*Project) LoadServices ¶ added in v0.1.62
func (*Project) NewApplication ¶ added in v0.0.51
func (project *Project) NewApplication(ctx context.Context, action *actionsv0.NewApplication) (*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) Reference ¶ added in v0.1.18
func (project *Project) Reference() *ProjectReference
func (*Project) SaveToDirUnsafe ¶ added in v0.0.51
type ProjectReference ¶
type ProjectReference struct { Name string `yaml:"name"` Path string `yaml:"path"` Applications []*ApplicationReference `yaml:"applications"` ActiveApplication string `yaml:"active-application"` }
ProjectReference is a reference to a project used by Workspace configuration
func (*ProjectReference) AddApplication ¶ added in v0.1.18
func (ref *ProjectReference) AddApplication(ctx context.Context, application *ApplicationReference) error
func (*ProjectReference) GetActiveApplication ¶ added in v0.1.18
func (ref *ProjectReference) GetActiveApplication(ctx context.Context) (*ApplicationReference, error)
GetActiveApplication returns the active application returns nil if no active application
func (*ProjectReference) GetApplicationFromName ¶ added in v0.1.18
func (ref *ProjectReference) GetApplicationFromName(ctx context.Context, applicationName string) (*ApplicationReference, error)
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 Method HTTPMethod }
func RestRouteFromProto ¶ added in v0.1.18
func UnwrapRestRoute ¶ added in v0.1.35
func UnwrapRestRoute[T any](route *ExtendedRestRoute[T]) *RestRoute
type RestRouteAccess ¶ added in v0.1.64
type RestRouteAccess struct {
// contains filtered or unexported fields
}
type RestRouteGroup ¶ added in v0.1.18
type RestRouteGroup struct { // HTTP Path Path string `yaml:"path"` // Routes for each HTTP Method Routes []*RestRoute `yaml:"routes"` Application string `yaml:"-"` Service string `yaml:"-"` }
RestRouteGroup holds all the routes corresponding to the SAME path Each Route corresponds to a DIFFERENT HTTP method HTTP methods correspond to individual routes
func DetectNewRoutesFromEndpoints ¶ added in v0.0.91
func DetectNewRoutesFromEndpoints(ctx context.Context, endpoints []*basev0.Endpoint, known []*RestRouteGroup) []*RestRouteGroup
func LoadRestRouteGroup ¶ added in v0.1.18
func LoadRestRouteGroup(ctx context.Context, p string) (*RestRouteGroup, error)
func UnwrapRestRouteGroup ¶ added in v0.1.35
func UnwrapRestRouteGroup[T any](group *ExtendedRestRouteGroup[T]) *RestRouteGroup
func (*RestRouteGroup) Delete ¶ added in v0.1.18
func (g *RestRouteGroup) Delete(ctx context.Context, dir string) error
Delete a route
func (*RestRouteGroup) Save ¶ added in v0.1.18
func (g *RestRouteGroup) Save(ctx context.Context, dir string) error
func (*RestRouteGroup) ServiceUnique ¶ added in v0.1.18
func (g *RestRouteGroup) ServiceUnique() string
type RestRouteLoader ¶ added in v0.1.35
type RestRouteLoader struct {
// contains filtered or unexported fields
}
RestRouteLoader will return all rest route groups in a directory
func NewRestRouteLoader ¶ added in v0.1.35
func NewRestRouteLoader(ctx context.Context, dir string) (*RestRouteLoader, error)
func (*RestRouteLoader) All ¶ added in v0.1.35
func (loader *RestRouteLoader) All() []*RestRoute
func (*RestRouteLoader) GroupFor ¶ added in v0.1.35
func (loader *RestRouteLoader) GroupFor(unique string, routePath string) *RestRouteGroup
func (*RestRouteLoader) Groups ¶ added in v0.1.35
func (loader *RestRouteLoader) Groups() []*RestRouteGroup
func (*RestRouteLoader) GroupsFor ¶ added in v0.1.35
func (loader *RestRouteLoader) GroupsFor(unique string) []*RestRouteGroup
type RouteUnique ¶ added in v0.0.91
type RouteUnique struct {
// contains filtered or unexported fields
}
func (RouteUnique) String ¶ added in v0.1.18
func (r RouteUnique) String() string
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"` Project string `yaml:"project,omitempty"` PathOverride *string `yaml:"path,omitempty"` Agent *Agent `yaml:"agent"` // ServiceDependencies are the other services required ServiceDependencies []*ServiceDependency `yaml:"service-dependencies"` // ProjectDependencies ProjectConfigurationDependencies []string `yaml:"project-configuration-dependencies"` // Endpoints exposed by the service Endpoints []*Endpoint `yaml:"endpoints"` // Spec is the specialized configuration of the service Spec map[string]any `yaml:"spec"` // RuntimeSpec are additional specs passed on by the runtime RuntimeSpec map[string]any `yaml:"-"` // contains filtered or unexported fields }
A Service
func LoadServiceFromDir ¶
LoadServiceFromDir 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) BaseEndpoint ¶ added in v0.1.55
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) LoadEndpoints ¶ added in v0.1.62
func (*Service) LoadSettingsFromSpec ¶ added in v0.0.15
func (*Service) LocalOrNil ¶ added in v0.1.84
func (*Service) ProviderDirectory ¶ added in v0.1.48
func (*Service) Reference ¶
func (s *Service) Reference() *ServiceReference
func (*Service) Unique ¶
Unique identifies a service within a project We use a REST like convention rather then a subdomain one
func (*Service) UniqueWithProject ¶ added in v0.1.84
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 Project the service belongs to
func ServiceIdentityFromProto ¶ added in v0.0.71
func ServiceIdentityFromProto(proto *basev0.ServiceIdentity) *ServiceIdentity
func (*ServiceIdentity) AsAgentResource ¶ added in v0.1.83
func (s *ServiceIdentity) AsAgentResource() *wool.Resource
func (*ServiceIdentity) AsResource ¶ added in v0.0.55
func (s *ServiceIdentity) AsResource() *wool.Resource
func (*ServiceIdentity) Clone ¶ added in v0.1.33
func (s *ServiceIdentity) Clone() *ServiceIdentity
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 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)
ParseServiceUnique returns a Service/Application pair from a unique or an 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 Visibility ¶ added in v0.0.91
type Visibility = string
const ( // VisibilityExternal represents an endpoint that exists outside the system VisibilityExternal Visibility = "external" // VisibilityPublic represents a deployed endpoint that is accessible from outside the system VisibilityPublic Visibility = "public" // VisibilityApplication represents an endpoint from other applications inside the system VisibilityApplication Visibility = "application" // VisibilityPrivate represents an endpoint that is only accessible within the application VisibilityPrivate Visibility = "private" )
type Workspace ¶
type Workspace struct { Name string `yaml:"name"` Organization Organization `yaml:"organization,omitempty"` // Projects in the Workspace configuration Projects []*ProjectReference `yaml:"projects"` ActiveProject string `yaml:"active-project,omitempty"` // 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) AddApplicationReference ¶ added in v0.1.38
func (*Workspace) AddProjectReference ¶ added in v0.0.60
func (workspace *Workspace) AddProjectReference(ctx context.Context, ref *ProjectReference) error
func (*Workspace) AddService ¶ added in v0.1.18
func (*Workspace) DeleteApplication ¶ added in v0.1.33
func (*Workspace) DeleteProject ¶ added in v0.0.37
func (*Workspace) DeleteService ¶ added in v0.1.33
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) GetActiveProject ¶ added in v0.1.18
func (workspace *Workspace) GetActiveProject(ctx context.Context) (*ProjectReference, error)
GetActiveProject returns the active project If no projects in workspace, returns nil
func (*Workspace) HasProject ¶ added in v0.1.38
HasProject returns true if the project exists
func (*Workspace) LoadActiveApplication ¶ added in v0.1.18
func (workspace *Workspace) LoadActiveApplication(ctx context.Context, projectName string) (*Application, error)
LoadActiveApplication loads the active application If no active application, returns nil
func (*Workspace) LoadActiveProject ¶ added in v0.0.51
LoadActiveProject load the active project if exists returns nil if no active project
func (*Workspace) LoadActiveService ¶ added in v0.1.18
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) ProjectNames ¶ added in v0.0.51
ProjectNames returns the names of the projects in the Workspace configuration
func (*Workspace) SetActiveService ¶ added in v0.1.18
func (*Workspace) SetApplicationActive ¶ added in v0.1.38
func (*Workspace) SetProjectActive ¶ added in v0.0.51
SetProjectActive sets the active project
type WrapperSwagger ¶ added in v0.1.14
type WrapperSwagger struct {
// contains filtered or unexported fields
}
Source Files ¶
- agent.go
- api.go
- application.go
- case.go
- configuration_information.go
- docker.go
- domain.go
- endpoint.go
- environment.go
- environment_variables_manager.go
- forwarding.go
- grpc.go
- hash.go
- homedir.go
- loader.go
- marshalling.go
- modes.go
- network.go
- network_mappings.go
- openapi.go
- organization.go
- partial.go
- project.go
- readme.go
- references.go
- rest.go
- service.go
- spec.go
- templates.go
- types.go
- validator.go
- workspace.go