Documentation ¶
Index ¶
- Constants
- func APIString(api *basev0.API) string
- func CodeflyDir() string
- func ConfigurationEnvironmentKeyPrefix(conf *basev0.Configuration) string
- func ConfigurationFile[C Configuration]() string
- func ConfigurationHash(conf *basev0.Configuration) string
- func ConfigurationInformationHash(info *basev0.ConfigurationInformation) string
- func ConfigurationInformationsHash(infos ...*basev0.ConfigurationInformation) (string, error)
- func ConfigurationsHash(confs ...*basev0.Configuration) string
- 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 ExtractConfiguration(configurations []*basev0.Configuration, runtimeContext *basev0.RuntimeContext) (*basev0.Configuration, error)
- 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, runtimeContext *basev0.RuntimeContext) []*basev0.Configuration
- func FindConfigurationValue(conf *basev0.Configuration, name string, key string) (string, error)
- func FindConfigurations(configurations []*basev0.Configuration, runtime *basev0.RuntimeContext) []*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 Init(ctx context.Context) (bool, error)
- func IsGRPC(_ context.Context, endpoint *basev0.Endpoint) *basev0.GrpcAPI
- func IsHTTP(_ context.Context, endpoint *basev0.Endpoint) *basev0.HttpAPI
- 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 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 MakeDNSSummary(dns *basev0.DNS) string
- func MakeEndpointAccessSummary(endointAccess *EndpointAccess) string
- func MakeEndpointSummary(endpoint *basev0.Endpoint) string
- func MakeManyConfigurationSummary(confs []*basev0.Configuration) string
- func MakeManyDNSSummary(dns []*basev0.DNS) string
- func MakeManyEndpointAccessSummary(endpointAccesses []*EndpointAccess) string
- func MakeManyNetworkMappingSummary(mappings []*basev0.NetworkMapping) string
- func MakeManyServicesSummary(services []*Service) string
- func MakeNetworkInstanceSummary(instance *basev0.NetworkInstance) string
- func MakeNetworkMappingSummary(mapping *basev0.NetworkMapping) string
- func ModuleMode() bool
- func NameToKey(name string) string
- func NetworkAccessFromRuntimeContext(runtimeContext *basev0.RuntimeContext) *basev0.NetworkAccess
- func NetworkInstanceSummary(value *basev0.NetworkInstance) string
- func NetworkMappingHash(networkMappings ...*basev0.NetworkMapping) string
- func NewAPI(_ context.Context, endpoint *Endpoint, api *basev0.API) (*basev0.Endpoint, error)
- func NewContainerNetworkAccess() *basev0.NetworkAccess
- func NewHTTPNetworkInstance(hostname string, port uint16, secured bool) *basev0.NetworkInstance
- func NewNativeNetworkAccess() *basev0.NetworkAccess
- func NewNetworkInstance(hostname string, port uint16) *basev0.NetworkInstance
- func NewPublicNetworkAccess() *basev0.NetworkAccess
- func NewRuntimeContext(runtimeContext string) (*basev0.RuntimeContext, error)
- func NewRuntimeContextContainer() *basev0.RuntimeContext
- func NewRuntimeContextFree() *basev0.RuntimeContext
- func NewRuntimeContextNative() *basev0.RuntimeContext
- 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 RuntimeContextFromInstance(instance *basev0.NetworkInstance) *basev0.RuntimeContext
- func RuntimeContexts() []string
- func SaveToDir[C Configuration](ctx context.Context, c *C, dir string) error
- 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 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()
- 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 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 ModuleAsEnvironmentVariable(module string) *EnvironmentVariable
- func RestRoutesAsEnvironmentVariable(endpoint *basev0.Endpoint, route *basev0.RestRoute) *EnvironmentVariable
- func RuntimeContextAsEnvironmentVariable(runtimeContext *basev0.RuntimeContext) *EnvironmentVariable
- func ServiceAsEnvironmentVariable(service string) *EnvironmentVariable
- func VersionAsEnvironmentVariable(version string) *EnvironmentVariable
- func WorkspaceAsEnvironmentVariable(workspace string) *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) Endpoints() []*EndpointAccess
- func (holder *EnvironmentVariableManager) Secrets() []*EnvironmentVariable
- func (holder *EnvironmentVariableManager) SetEnvironment(environment *basev0.Environment)
- func (holder *EnvironmentVariableManager) SetIdentity(identity *basev0.ServiceIdentity)
- func (holder *EnvironmentVariableManager) SetRunning(b bool)
- func (holder *EnvironmentVariableManager) SetRuntimeContext(runtimeContext *basev0.RuntimeContext)
- 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 FlatLayout
- 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 Layout
- type LayoutKind
- type Mode
- type Module
- func (mod *Module) AddServiceReference(_ context.Context, ref *ServiceReference) error
- func (mod *Module) DeleteService(ctx context.Context, name string) error
- func (mod *Module) DeleteServiceDependencies(ctx context.Context, ref *ServiceReference) error
- func (mod *Module) Dir() string
- func (mod *Module) ExistsService(ctx context.Context, name string) bool
- func (mod *Module) GetServiceReferences(name string) (*ServiceReference, error)
- func (mod *Module) LoadServiceFromName(ctx context.Context, name string) (*Service, error)
- func (mod *Module) LoadServiceFromReference(ctx context.Context, ref *ServiceReference) (*Service, error)
- func (mod *Module) LoadServices(ctx context.Context) ([]*Service, error)
- func (mod *Module) NewService(ctx context.Context, action *actionsv0.AddService) (*Service, error)
- func (mod *Module) Proto() *basev0.Module
- func (mod *Module) PublicEndpoints(ctx context.Context) ([]*basev0.Endpoint, error)
- func (mod *Module) Reference() *ModuleReference
- func (mod *Module) Save(ctx context.Context) error
- func (mod *Module) SaveToDir(ctx context.Context, dir string) error
- func (mod *Module) ServicePath(_ context.Context, ref *ServiceReference) string
- func (mod *Module) Unique() string
- func (mod *Module) Validate() error
- func (mod *Module) WithDir(dir string)
- type ModuleReference
- func (ref *ModuleReference) AddService(_ context.Context, service *ServiceReference) error
- func (ref *ModuleReference) GetActive(ctx context.Context) (*ServiceReference, error)
- func (ref *ModuleReference) GetActiveService(ctx context.Context) (*ServiceReference, error)
- func (ref *ModuleReference) GetServiceFromName(ctx context.Context, serviceName string) (*ServiceReference, error)
- func (ref *ModuleReference) String() string
- type ModulesLayout
- type NetworkInstance
- type NewModuleInput
- type NoModuleError
- 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 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(_ context.Context, f string) string
- func (s *Service) LocalOrNil(ctx context.Context, f string) *string
- func (s *Service) Proto() *basev0.Service
- 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) UniqueWithWorspace(workspace string) 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 ServiceWithCase
- type ServiceWithModule
- type TCP
- type Visibility
- type Workspace
- func CreateWorkspace(ctx context.Context, action *actionsv0.NewWorkspace) (*Workspace, error)
- func FindWorkspaceUp(ctx context.Context) (*Workspace, error)
- func LoadWorkspaceFromDir(ctx context.Context, dir string) (*Workspace, error)
- func NewWorkspace(ctx context.Context, name string, layout string) (*Workspace, error)
- func Reload(ctx context.Context, workspace *Workspace) (*Workspace, error)
- func (workspace *Workspace) AddModuleReference(modRef *ModuleReference) error
- func (workspace *Workspace) Clone() *Workspace
- func (workspace *Workspace) DeleteModule(ctx context.Context, name string) error
- func (workspace *Workspace) DeleteServiceDependencies(ctx context.Context, ref *ServiceReference) error
- func (workspace *Workspace) Dir() string
- func (workspace *Workspace) ExistsModule(name string) bool
- func (workspace *Workspace) FindUniqueServiceAndModuleByName(ctx context.Context, name string) (*ServiceWithModule, error)
- func (workspace *Workspace) FindUniqueServiceByName(ctx context.Context, name string) (*Service, error)
- func (workspace *Workspace) LoadModuleFromName(ctx context.Context, name string) (*Module, error)
- func (workspace *Workspace) LoadModuleFromReference(ctx context.Context, ref *ModuleReference) (*Module, error)
- func (workspace *Workspace) LoadModules(ctx context.Context) ([]*Module, error)
- func (workspace *Workspace) LoadService(ctx context.Context, input *ServiceWithModule) (*Service, error)
- func (workspace *Workspace) LoadServiceWithModules(ctx context.Context) ([]*ServiceWithModule, error)
- func (workspace *Workspace) LoadServices(ctx context.Context) ([]*Service, error)
- func (workspace *Workspace) ModulePath(ctx context.Context, ref *ModuleReference) string
- func (workspace *Workspace) ModulesNames() []string
- func (workspace *Workspace) NewModule(ctx context.Context, action *actionsv0.NewModule) (*Module, error)
- func (workspace *Workspace) Proto() (*basev0.Workspace, error)
- func (workspace *Workspace) RootModule(ctx context.Context) (*Module, error)
- func (workspace *Workspace) Save(ctx context.Context) error
- func (workspace *Workspace) SaveToDirUnsafe(ctx context.Context, dir string) error
- func (workspace *Workspace) Valid() error
- func (workspace *Workspace) WithDir(dir string)
- func (workspace *Workspace) WithRootModule(ctx context.Context) (*Module, error)
- type WrapperSwagger
Constants ¶
const ( ModuleKind = "module" ModuleConfigurationName = "module.codefly.yaml" )
const ( RuntimeContextNative = "native" RuntimeContextContainer = "container" RuntimeContextFree = "free" NetworkAccessContainer = "container" NetworkAccessNative = "native" NetworkAccessPublic = "public" )
const ( AGENT = "agent" WORKSPACE = "workspace" MODULE = "module" SERVICE = "service" ENDPOINT = "endpoint" )
const AgentConfigurationName = "agent.codefly.yaml"
const BuilderServiceAgent = "codefly:service:builder"
const ConfigurationWorkspace = "workspace"
const EndpointPrefix = "CODEFLY__ENDPOINT"
const EnvironmentPrefix = "CODEFLY__ENVIRONMENT"
const GRPCRouteFileSuffix = ".grpc.codefly.yaml"
const ModulePrefix = "CODEFLY__MODULE"
const RestRouteFileSuffix = ".rest.codefly.yaml"
const RestRoutePrefix = "CODEFLY__REST_ROUTE"
const RunningPrefix = "CODEFLY__RUNNING"
const RuntimeContextPrefix = "CODEFLY__RUNTIME_CONTEXT"
const RuntimeServiceAgent = "codefly:service:runtime"
const ServiceAgent = AgentKind("codefly:service")
const ServiceConfigurationName = "service.codefly.yaml"
const ServiceConfigurationPrefix = "CODEFLY__SERVICE_CONFIGURATION"
const ServicePrefix = "CODEFLY__SERVICE"
const ServiceSecretConfigurationPrefix = "CODEFLY__SERVICE_SECRET_CONFIGURATION"
const VersionPrefix = "CODEFLY__SERVICE_VERSION"
const WorkspaceConfigurationName = "workspace.codefly.yaml"
const WorkspaceConfigurationPrefix = "CODEFLY__WORKSPACE_CONFIGURATION"
const WorkspacePrefix = "CODEFLY__WORKSPACE"
const WorkspaceSecretConfigurationPrefix = "CODEFLY__WORKSPACE_SECRET_CONFIGURATION"
#nosec G101
Variables ¶
This section is empty.
Functions ¶
func CodeflyDir ¶
func CodeflyDir() string
CodeflyDir returns the directory where the Workspace configuration is stored
func ConfigurationEnvironmentKeyPrefix ¶
func ConfigurationEnvironmentKeyPrefix(conf *basev0.Configuration) string
func ConfigurationFile ¶
func ConfigurationFile[C Configuration]() string
func ConfigurationHash ¶
func ConfigurationHash(conf *basev0.Configuration) string
func ConfigurationInformationHash ¶
func ConfigurationInformationHash(info *basev0.ConfigurationInformation) string
func ConfigurationInformationsHash ¶
func ConfigurationInformationsHash(infos ...*basev0.ConfigurationInformation) (string, error)
func ConfigurationsHash ¶
func ConfigurationsHash(confs ...*basev0.Configuration) string
func ConvertHTTPMethodToProto ¶
func ConvertHTTPMethodToProto(m HTTPMethod) basev0.HTTPMethod
func EndpointAsEnvironmentVariableKey ¶
func EndpointAsEnvironmentVariableKey(info *EndpointInformation) string
func EndpointAsEnvironmentVariableKeyBase ¶
func EndpointAsEnvironmentVariableKeyBase(info *EndpointInformation) string
func EndpointDestination ¶
func EndpointHash ¶
func EnvironmentVariableAsStrings ¶
func EnvironmentVariableAsStrings(envs []*EnvironmentVariable) []string
func ExistsAtDir ¶
func ExistsAtDir[C Configuration](dir string) bool
func ExtendDomain ¶
func ExtractConfiguration ¶
func ExtractConfiguration(configurations []*basev0.Configuration, runtimeContext *basev0.RuntimeContext) (*basev0.Configuration, error)
func FilePathForGRPC ¶
func FilePathForRest ¶
func FilterConfigurations ¶
func FilterConfigurations(configurations []*basev0.Configuration, runtimeContext *basev0.RuntimeContext) []*basev0.Configuration
func FindConfigurationValue ¶
func FindConfigurations ¶
func FindConfigurations(configurations []*basev0.Configuration, runtime *basev0.RuntimeContext) []*basev0.Configuration
func FindEndpointForGRPCRoute ¶
func FindEndpointForGRPCRoute(ctx context.Context, endpoints []*basev0.Endpoint, route *GRPCRoute) *basev0.Endpoint
FindEndpointForGRPCRoute finds the info that matches the route rpcs
func FindEndpointForRestRoute ¶
func FindEndpointForRestRoute(ctx context.Context, endpoints []*basev0.Endpoint, route *RestRouteGroup) *basev0.Endpoint
FindEndpointForRestRoute finds the info that matches the route rpcs
func FindGRPCEndpoint ¶
func FindHTTPEndpoint ¶
func FindNetworkInstanceInNetworkMappings ¶
func FindNetworkInstanceInNetworkMappings(_ context.Context, mappings []*basev0.NetworkMapping, endpoint *basev0.Endpoint, networkAccess *basev0.NetworkAccess) (*basev0.NetworkInstance, error)
func FindNetworkMapping ¶
func FindNetworkMapping(_ context.Context, mappings []*basev0.NetworkMapping, endpoint *basev0.Endpoint) (*basev0.NetworkMapping, error)
func FindRestEndpoint ¶
func FindTCPEndpoint ¶
func FindTCPEndpointWithName ¶
func FindUp ¶
func FindUp[C Configuration](ctx context.Context) (*string, error)
FindUp looks for a configuration in the active directory and up
func GetConfigurationValue ¶
func HasPublicEndpoints ¶
func HashString ¶
func InPartialMode ¶
func InPartialMode() bool
func IsLocal ¶
func IsLocal(environment *basev0.Environment) bool
func LoadFromBytes ¶
func LoadFromBytes[C Configuration](content []byte) (*C, error)
func LoadFromDir ¶
func LoadFromDir[C Configuration](ctx context.Context, dir string) (*C, error)
func LoadFromFs ¶
func LoadFromFs[C Configuration](fs shared.FileSystem) (*C, error)
func LoadFromPath ¶
func LoadFromPath[C Configuration](ctx context.Context, p string) (*C, error)
func LocalizeNetworkMapping ¶
func LocalizeNetworkMapping(mappings []*basev0.NetworkMapping, hostname string) []*basev0.NetworkMapping
func MakeConfigurationInformationSummary ¶
func MakeConfigurationInformationSummary(info *basev0.ConfigurationInformation) string
func MakeConfigurationSummary ¶
func MakeConfigurationSummary(conf *basev0.Configuration) string
func MakeConfigurationValueSummary ¶
func MakeConfigurationValueSummary(value *basev0.ConfigurationValue) string
func MakeDNSSummary ¶
func MakeEndpointAccessSummary ¶ added in v0.1.93
func MakeEndpointAccessSummary(endointAccess *EndpointAccess) string
func MakeEndpointSummary ¶
func MakeManyConfigurationSummary ¶
func MakeManyConfigurationSummary(confs []*basev0.Configuration) string
func MakeManyDNSSummary ¶
func MakeManyEndpointAccessSummary ¶ added in v0.1.93
func MakeManyEndpointAccessSummary(endpointAccesses []*EndpointAccess) string
func MakeManyNetworkMappingSummary ¶
func MakeManyNetworkMappingSummary(mappings []*basev0.NetworkMapping) string
func MakeManyServicesSummary ¶
func MakeNetworkInstanceSummary ¶ added in v0.1.93
func MakeNetworkInstanceSummary(instance *basev0.NetworkInstance) string
func MakeNetworkMappingSummary ¶
func MakeNetworkMappingSummary(mapping *basev0.NetworkMapping) string
func ModuleMode ¶
func ModuleMode() bool
func NetworkAccessFromRuntimeContext ¶
func NetworkAccessFromRuntimeContext(runtimeContext *basev0.RuntimeContext) *basev0.NetworkAccess
NetworkAccessFromRuntimeContext returns a NetworkAccess from a runtime instance
func NetworkInstanceSummary ¶
func NetworkInstanceSummary(value *basev0.NetworkInstance) string
func NetworkMappingHash ¶
func NetworkMappingHash(networkMappings ...*basev0.NetworkMapping) string
func NewContainerNetworkAccess ¶
func NewContainerNetworkAccess() *basev0.NetworkAccess
func NewHTTPNetworkInstance ¶
func NewHTTPNetworkInstance(hostname string, port uint16, secured bool) *basev0.NetworkInstance
func NewNativeNetworkAccess ¶
func NewNativeNetworkAccess() *basev0.NetworkAccess
func NewNetworkInstance ¶
func NewNetworkInstance(hostname string, port uint16) *basev0.NetworkInstance
func NewPublicNetworkAccess ¶
func NewPublicNetworkAccess() *basev0.NetworkAccess
func NewRuntimeContext ¶
func NewRuntimeContext(runtimeContext string) (*basev0.RuntimeContext, error)
func NewRuntimeContextContainer ¶
func NewRuntimeContextContainer() *basev0.RuntimeContext
func NewRuntimeContextFree ¶
func NewRuntimeContextFree() *basev0.RuntimeContext
func NewRuntimeContextNative ¶
func NewRuntimeContextNative() *basev0.RuntimeContext
func OverridePath ¶
OverridePath is nil if the name is the same as the desired relative path
func ParseOpenAPI ¶
func ParseOpenAPI(spec []byte) (*openapispec.Swagger, error)
func PortFromAddress ¶
func ReferenceMatch ¶
func RegisterAgent ¶
func RegisterAgent(kind AgentKind, protoKind basev0.Agent_Kind)
func RestRouteEnvironmentVariableKey ¶
func RestRouteEnvironmentVariableKey(info *EndpointInformation, route *basev0.RestRoute) string
func RestRoutes ¶
func RuntimeContextFromInstance ¶
func RuntimeContextFromInstance(instance *basev0.NetworkInstance) *basev0.RuntimeContext
RuntimeContextFromInstance returns a runtime context from a network instance.
func RuntimeContexts ¶
func RuntimeContexts() []string
func ServiceConfigurationKey ¶
func ServiceUnique ¶
func ToOrganizationName ¶
func TypeName ¶
func TypeName[C Configuration]() string
func UniqueToKey ¶
func ValidOrganization ¶
func ValidOrganization(org *basev0.Organization) error
func ValidateAgent ¶
func ValidateDomain ¶
func ValidateDomain()
Types ¶
type Agent ¶
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 ¶
func (*Agent) AsResource ¶
func (*Agent) Identifier ¶
type AgentKind ¶
type AgentKind string
func AgentKindFromProto ¶
func AgentKindFromProto(kind basev0.Agent_Kind) (*AgentKind, error)
type ClientEntry ¶
func (*ClientEntry) Validate ¶
func (c *ClientEntry) Validate() error
type Configuration ¶
type Configuration interface{}
type DockerImage ¶
func NewDockerImage ¶
func NewDockerImage(s string) *DockerImage
func (*DockerImage) FullName ¶
func (image *DockerImage) FullName() string
type Endpoint ¶
type Endpoint struct { Name string `yaml:"name"` Service string `yaml:"service,omitempty"` Module string `yaml:"module,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 ¶
func (*Endpoint) AsReference ¶
func (endpoint *Endpoint) AsReference() *EndpointReference
func (*Endpoint) Information ¶
func (endpoint *Endpoint) Information() *EndpointInformation
func (*Endpoint) ServiceUnique ¶
type EndpointAccess ¶
type EndpointAccess struct { *basev0.Endpoint *basev0.NetworkInstance }
type EndpointInformation ¶
func EndpointInformationFromProto ¶
func EndpointInformationFromProto(endpoint *basev0.Endpoint) *EndpointInformation
func ParseEndpoint ¶
func ParseEndpoint(unique string) (*EndpointInformation, error)
func (*EndpointInformation) Identifier ¶
func (endpoint *EndpointInformation) Identifier() string
Identifier satisfies this format: - name::api if name != api - api if name == api or name == ""
func (*EndpointInformation) UnknownAPI ¶
func (endpoint *EndpointInformation) UnknownAPI() bool
type EndpointReference ¶
type EndpointReference struct {
Name string `yaml:"name"`
}
An EndpointReference
type EndpointSummary ¶
func MakeManyEndpointSummary ¶
func MakeManyEndpointSummary(endpoints []*basev0.Endpoint) EndpointSummary
type Environment ¶
type Environment struct { Name string `yaml:"name"` Description string `yaml:"description,omitempty"` }
Environment is a configuration for an environment
func EnvironmentFromProto ¶
func EnvironmentFromProto(env *basev0.Environment) *Environment
func LocalEnvironment ¶
func LocalEnvironment() *Environment
LocalEnvironment is a local environment that is always available
func (*Environment) Local ¶
func (env *Environment) Local() bool
func (*Environment) Proto ¶
func (env *Environment) Proto() (*basev0.Environment, error)
type EnvironmentExistsError ¶
type EnvironmentExistsError struct {
// contains filtered or unexported fields
}
func (*EnvironmentExistsError) Error ¶
func (err *EnvironmentExistsError) Error() string
type EnvironmentReference ¶
type EnvironmentReference struct {
Name string `yaml:"name"`
}
An EnvironmentReference at the level
func (*EnvironmentReference) String ¶
func (ref *EnvironmentReference) String() string
type EnvironmentVariable ¶
func AsRestRouteEnvironmentVariable ¶
func AsRestRouteEnvironmentVariable(ctx context.Context, endpoint *basev0.Endpoint) []*EnvironmentVariable
func ConfigurationAsEnvironmentVariables ¶
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 ¶
func EndpointAsEnvironmentVariable(endpoint *basev0.Endpoint, instance *basev0.NetworkInstance) *EnvironmentVariable
func Env ¶
func Env(key string, value any) *EnvironmentVariable
func EnvironmentAsEnvironmentVariable ¶
func EnvironmentAsEnvironmentVariable(env *basev0.Environment) *EnvironmentVariable
func ModuleAsEnvironmentVariable ¶
func ModuleAsEnvironmentVariable(module string) *EnvironmentVariable
func RestRoutesAsEnvironmentVariable ¶
func RestRoutesAsEnvironmentVariable(endpoint *basev0.Endpoint, route *basev0.RestRoute) *EnvironmentVariable
func RuntimeContextAsEnvironmentVariable ¶
func RuntimeContextAsEnvironmentVariable(runtimeContext *basev0.RuntimeContext) *EnvironmentVariable
func ServiceAsEnvironmentVariable ¶
func ServiceAsEnvironmentVariable(service string) *EnvironmentVariable
func VersionAsEnvironmentVariable ¶
func VersionAsEnvironmentVariable(version string) *EnvironmentVariable
func WorkspaceAsEnvironmentVariable ¶
func WorkspaceAsEnvironmentVariable(workspace string) *EnvironmentVariable
func (EnvironmentVariable) String ¶
func (v EnvironmentVariable) String() string
func (EnvironmentVariable) ValueAsEncodedString ¶
func (v EnvironmentVariable) ValueAsEncodedString() string
func (EnvironmentVariable) ValueAsString ¶
func (v EnvironmentVariable) ValueAsString() string
type EnvironmentVariableManager ¶
type EnvironmentVariableManager struct {
// contains filtered or unexported fields
}
func NewEnvironmentVariableManager ¶
func NewEnvironmentVariableManager() *EnvironmentVariableManager
func (*EnvironmentVariableManager) AddConfigurations ¶
func (holder *EnvironmentVariableManager) AddConfigurations(configurations ...*basev0.Configuration) error
func (*EnvironmentVariableManager) AddEndpoints ¶
func (holder *EnvironmentVariableManager) AddEndpoints(ctx context.Context, mappings []*basev0.NetworkMapping, networkAccess *basev0.NetworkAccess) error
func (*EnvironmentVariableManager) AddRestRoutes ¶
func (holder *EnvironmentVariableManager) AddRestRoutes(ctx context.Context, mappings []*basev0.NetworkMapping, networkAccess *basev0.NetworkAccess) error
func (*EnvironmentVariableManager) All ¶
func (holder *EnvironmentVariableManager) All() []*EnvironmentVariable
func (*EnvironmentVariableManager) Configurations ¶
func (holder *EnvironmentVariableManager) Configurations() []*EnvironmentVariable
func (*EnvironmentVariableManager) Endpoints ¶ added in v0.1.93
func (holder *EnvironmentVariableManager) Endpoints() []*EndpointAccess
func (*EnvironmentVariableManager) Secrets ¶
func (holder *EnvironmentVariableManager) Secrets() []*EnvironmentVariable
func (*EnvironmentVariableManager) SetEnvironment ¶
func (holder *EnvironmentVariableManager) SetEnvironment(environment *basev0.Environment)
func (*EnvironmentVariableManager) SetIdentity ¶
func (holder *EnvironmentVariableManager) SetIdentity(identity *basev0.ServiceIdentity)
func (*EnvironmentVariableManager) SetRunning ¶
func (holder *EnvironmentVariableManager) SetRunning(b bool)
func (*EnvironmentVariableManager) SetRuntimeContext ¶
func (holder *EnvironmentVariableManager) SetRuntimeContext(runtimeContext *basev0.RuntimeContext)
type ExtendedGRPCRoute ¶
func LoadExtendedGRPCRoute ¶
type ExtendedGRPCRouteLoader ¶
type ExtendedGRPCRouteLoader[T any] struct { // contains filtered or unexported fields }
ExtendedGRPCRouteLoader will return all GRPC route groups in a directory
func (*ExtendedGRPCRouteLoader[T]) Add ¶
func (loader *ExtendedGRPCRouteLoader[T]) Add(route *ExtendedGRPCRoute[T])
func (*ExtendedGRPCRouteLoader[T]) All ¶
func (loader *ExtendedGRPCRouteLoader[T]) All() []*ExtendedGRPCRoute[T]
type ExtendedRestRoute ¶
func NewExtendedRestRoute ¶
func NewExtendedRestRoute[T any](rest RestRoute, value T) *ExtendedRestRoute[T]
type ExtendedRestRouteGroup ¶
type ExtendedRestRouteGroup[T any] struct { Path string `yaml:"path"` Routes []*ExtendedRestRoute[T] `yaml:"routes"` Module string `yaml:"-"` Service string `yaml:"-"` }
func (*ExtendedRestRouteGroup[T]) Add ¶
func (g *ExtendedRestRouteGroup[T]) Add(route ExtendedRestRoute[T])
func (*ExtendedRestRouteGroup[T]) Save ¶
func (g *ExtendedRestRouteGroup[T]) Save(ctx context.Context, dir string) error
func (*ExtendedRestRouteGroup[T]) ServiceUnique ¶
func (g *ExtendedRestRouteGroup[T]) ServiceUnique() string
type ExtendedRouteLoader ¶
type ExtendedRouteLoader[T any] struct { // contains filtered or unexported fields }
ExtendedRouteLoader will return all rest route groups in a directory
func (*ExtendedRouteLoader[T]) AddGroup ¶
func (loader *ExtendedRouteLoader[T]) AddGroup(group *ExtendedRestRouteGroup[T])
func (*ExtendedRouteLoader[T]) All ¶
func (loader *ExtendedRouteLoader[T]) All() []*ExtendedRestRoute[T]
func (*ExtendedRouteLoader[T]) GroupFor ¶
func (loader *ExtendedRouteLoader[T]) GroupFor(unique string, routePath string) *ExtendedRestRouteGroup[T]
func (*ExtendedRouteLoader[T]) Groups ¶
func (loader *ExtendedRouteLoader[T]) Groups() []*ExtendedRestRouteGroup[T]
func (*ExtendedRouteLoader[T]) GroupsFor ¶
func (loader *ExtendedRouteLoader[T]) GroupsFor(unique string) []*ExtendedRestRouteGroup[T]
type FlatLayout ¶
type FlatLayout struct {
// contains filtered or unexported fields
}
func NewFlatLayout ¶
func (FlatLayout) ModulePath ¶
func (f FlatLayout) ModulePath(string) string
func (FlatLayout) ModulesRoot ¶
func (f FlatLayout) ModulesRoot() string
func (FlatLayout) ServicePath ¶
func (f FlatLayout) ServicePath(_ string, name string) string
func (FlatLayout) ServicesRoot ¶
func (f FlatLayout) ServicesRoot(string) string
type Forwarding ¶
type GRPCRoute ¶
type GRPCRoute struct { Name string `yaml:"name"` Package string `yaml:"package"` ServiceName string `yaml:"service-name"` Module string `yaml:"-"` Service string `yaml:"-"` }
func GRPCRouteFromProto ¶
func UnwrapGRPCRoute ¶
func UnwrapGRPCRoute[T any](route *ExtendedGRPCRoute[T]) *GRPCRoute
func (*GRPCRoute) ServiceUnique ¶
type GRPCRouteLoader ¶
type GRPCRouteLoader struct {
// contains filtered or unexported fields
}
GRPCRouteLoader will return all GRPC route groups in a directory
func NewGRPCRouteLoader ¶
func NewGRPCRouteLoader(ctx context.Context, dir string) (*GRPCRouteLoader, error)
func (*GRPCRouteLoader) All ¶
func (loader *GRPCRouteLoader) All() []*GRPCRoute
type HTTPMethod ¶
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 ¶
func ConvertHTTPMethodFromProto(m basev0.HTTPMethod) HTTPMethod
type Layout ¶
type LayoutKind ¶
type LayoutKind = string
const ( LayoutKindFlat LayoutKind = "flat" LayoutKindModules LayoutKind = "modules" )
type Module ¶
type Module struct { Kind string `yaml:"kind"` Name string `yaml:"name"` PathOverride *string `yaml:"path,omitempty"` Description string `yaml:"description,omitempty"` ServiceReferences []*ServiceReference `yaml:"services"` // contains filtered or unexported fields }
An Module is a collection of services that are deployed together.
func LoadModuleFromDirUnsafe ¶
func LoadModuleFromPath ¶
LoadModuleFromPath loads an module from a path
func (*Module) AddServiceReference ¶
func (mod *Module) AddServiceReference(_ context.Context, ref *ServiceReference) error
func (*Module) DeleteService ¶
DeleteService deletes a service from an module
func (*Module) DeleteServiceDependencies ¶
func (mod *Module) DeleteServiceDependencies(ctx context.Context, ref *ServiceReference) error
func (*Module) ExistsService ¶
ExistsService returns true if the service exists in the module
func (*Module) GetServiceReferences ¶
func (mod *Module) GetServiceReferences(name string) (*ServiceReference, error)
func (*Module) LoadServiceFromName ¶
LoadServiceFromName loads a service from a module returns ResourceNotFound error if not found
func (*Module) LoadServiceFromReference ¶
func (*Module) LoadServices ¶
func (*Module) NewService ¶
NewService creates a service in an module
func (*Module) PublicEndpoints ¶
func (*Module) Reference ¶
func (mod *Module) Reference() *ModuleReference
func (*Module) ServicePath ¶
func (mod *Module) ServicePath(_ context.Context, ref *ServiceReference) string
ServicePath returns the absolute path of an Service Cases for Reference.Dir nil: relative path to module with name rel: relative path /abs: absolute path
type ModuleReference ¶
type ModuleReference struct { Name string `yaml:"name"` PathOverride *string `yaml:"path,omitempty"` Services []*ServiceReference `yaml:"services,omitempty"` ActiveService string `yaml:"active-service,omitempty"` }
An ModuleReference
func (*ModuleReference) AddService ¶
func (ref *ModuleReference) AddService(_ context.Context, service *ServiceReference) error
func (*ModuleReference) GetActive ¶
func (ref *ModuleReference) GetActive(ctx context.Context) (*ServiceReference, error)
func (*ModuleReference) GetActiveService ¶
func (ref *ModuleReference) GetActiveService(ctx context.Context) (*ServiceReference, error)
func (*ModuleReference) GetServiceFromName ¶
func (ref *ModuleReference) GetServiceFromName(ctx context.Context, serviceName string) (*ServiceReference, error)
func (*ModuleReference) String ¶
func (ref *ModuleReference) String() string
type ModulesLayout ¶
type ModulesLayout struct {
// contains filtered or unexported fields
}
func NewModulesLayout ¶
func (ModulesLayout) ModulePath ¶
func (f ModulesLayout) ModulePath(module string) string
func (ModulesLayout) ModulesRoot ¶
func (f ModulesLayout) ModulesRoot() string
func (ModulesLayout) ServicePath ¶
func (f ModulesLayout) ServicePath(module string, name string) string
func (ModulesLayout) ServicesRoot ¶
func (f ModulesLayout) ServicesRoot(module string) string
type NetworkInstance ¶
func DefaultNetworkInstance ¶
func DefaultNetworkInstance(api string) *NetworkInstance
func FindNetworkInstanceInEnvironmentVariables ¶
func FindNetworkInstanceInEnvironmentVariables(ctx context.Context, endpointInfo *EndpointInformation, envs []string) (*NetworkInstance, error)
func ParseAddress ¶
func ParseAddress(address string) (*NetworkInstance, error)
type NewModuleInput ¶
type NewModuleInput struct {
Name string
}
type NoModuleError ¶
type NoModuleError struct {
// contains filtered or unexported fields
}
func (NoModuleError) Error ¶
func (e NoModuleError) Error() string
type NonUniqueServiceNameError ¶
type NonUniqueServiceNameError struct {
// contains filtered or unexported fields
}
func (NonUniqueServiceNameError) Error ¶
func (n NonUniqueServiceNameError) Error() string
type OpenAPICombinator ¶
type OpenAPICombinator struct {
// contains filtered or unexported fields
}
func NewOpenAPICombinator ¶
func (*OpenAPICombinator) LoadEndpoints ¶
func (*OpenAPICombinator) Only ¶
func (c *OpenAPICombinator) Only(unique string, path string)
func (*OpenAPICombinator) WithDestination ¶
func (c *OpenAPICombinator) WithDestination(filename string)
func (*OpenAPICombinator) WithVersion ¶
func (c *OpenAPICombinator) WithVersion(version string)
type Organization ¶
type Organization struct { // ID must be globally unique ID string `yaml:"id"` Name string `yaml:"name"` }
func OrganizationFromProto ¶
func OrganizationFromProto(_ context.Context, m *basev0.Organization) (*Organization, error)
func (*Organization) Proto ¶
func (organization *Organization) Proto() *basev0.Organization
type RestRoute ¶
type RestRoute struct { Path string Method HTTPMethod }
func RestRouteFromProto ¶
func UnwrapRestRoute ¶
func UnwrapRestRoute[T any](route *ExtendedRestRoute[T]) *RestRoute
type RestRouteAccess ¶
type RestRouteAccess struct {
// contains filtered or unexported fields
}
func ExtractRestRoutes ¶ added in v0.1.95
func ExtractRestRoutes(ctx context.Context, mappings []*basev0.NetworkMapping, networkAccess *basev0.NetworkAccess) ([]*RestRouteAccess, error)
type RestRouteGroup ¶
type RestRouteGroup struct { // HTTP Path Path string `yaml:"path"` // Routes for each HTTP Method Routes []*RestRoute `yaml:"routes"` Module 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 ¶
func DetectNewRoutesFromEndpoints(ctx context.Context, endpoints []*basev0.Endpoint, known []*RestRouteGroup) []*RestRouteGroup
func LoadRestRouteGroup ¶
func LoadRestRouteGroup(ctx context.Context, p string) (*RestRouteGroup, error)
func UnwrapRestRouteGroup ¶
func UnwrapRestRouteGroup[T any](group *ExtendedRestRouteGroup[T]) *RestRouteGroup
func (*RestRouteGroup) Delete ¶
func (g *RestRouteGroup) Delete(ctx context.Context, dir string) error
Delete a route
func (*RestRouteGroup) ServiceUnique ¶
func (g *RestRouteGroup) ServiceUnique() string
type RestRouteLoader ¶
type RestRouteLoader struct {
// contains filtered or unexported fields
}
RestRouteLoader will return all rest route groups in a directory
func NewRestRouteLoader ¶
func NewRestRouteLoader(ctx context.Context, dir string) (*RestRouteLoader, error)
func (*RestRouteLoader) All ¶
func (loader *RestRouteLoader) All() []*RestRoute
func (*RestRouteLoader) GroupFor ¶
func (loader *RestRouteLoader) GroupFor(unique string, routePath string) *RestRouteGroup
func (*RestRouteLoader) Groups ¶
func (loader *RestRouteLoader) Groups() []*RestRouteGroup
func (*RestRouteLoader) GroupsFor ¶
func (loader *RestRouteLoader) GroupsFor(unique string) []*RestRouteGroup
type RouteUnique ¶
type RouteUnique struct {
// contains filtered or unexported fields
}
func (RouteUnique) String ¶
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 Module running
type Service ¶
type Service struct { Name string `yaml:"name"` Description string `yaml:"description,omitempty"` Version string `yaml:"version"` Module string `yaml:"module"` PathOverride *string `yaml:"path,omitempty"` Agent *Agent `yaml:"agent"` // ServiceDependencies are the other services required ServiceDependencies []*ServiceDependency `yaml:"service-dependencies,omitempty"` // Dependencies ConfigurationDependencies []string `yaml:"workspace-configuration-dependencies,omitempty"` // Endpoints exposed by the service Endpoints []*Endpoint `yaml:"endpoints,omitempty"` // Spec is the specialized configuration of the service Spec map[string]any `yaml:"spec,omitempty"` // contains filtered or unexported fields }
A Service
func LoadServiceFromDir ¶
LoadServiceFromDir loads a service from a directory
func LoadServiceFromPath ¶
LoadServiceFromPath loads an service from a path
func ReloadService ¶
ReloadService from directory
func (*Service) AddDependency ¶
func (s *Service) AddDependency(ctx context.Context, requirement *Service, requiredEndpoints []*Endpoint) error
AddDependency adds a dependency to the service
func (*Service) BaseEndpoint ¶
func (*Service) DeleteServiceDependencies ¶
func (s *Service) DeleteServiceDependencies(ctx context.Context, ref *ServiceReference) error
func (*Service) EndpointsFromNames ¶
EndpointsFromNames return matching endpoints
func (*Service) ExistsDependency ¶
func (s *Service) ExistsDependency(requirement *Service) (*ServiceDependency, bool)
func (*Service) HasEndpoints ¶
func (*Service) Identity ¶
func (s *Service) Identity() *ServiceIdentity
Identity is the proto version of Unique
func (*Service) LoadEndpoints ¶
func (*Service) LoadSettingsFromSpec ¶
func (*Service) Reference ¶
func (s *Service) Reference() *ServiceReference
func (*Service) Unique ¶
Unique identifies a service within a We use a REST like convention rather then a subdomain one
func (*Service) UniqueWithWorspace ¶
func (*Service) UpdateSpecFromSettings ¶
type ServiceDependency ¶
type ServiceDependency struct { Name string `yaml:"name"` Module string `yaml:"module,omitempty"` Endpoints []*EndpointReference `yaml:"endpoints,omitempty"` }
func (*ServiceDependency) AsReference ¶
func (s *ServiceDependency) AsReference() *ServiceReference
func (*ServiceDependency) String ¶
func (s *ServiceDependency) String() string
func (*ServiceDependency) Unique ¶
func (s *ServiceDependency) Unique() string
func (*ServiceDependency) UpdateEndpoints ¶
func (s *ServiceDependency) UpdateEndpoints(ctx context.Context, endpoints []*Endpoint) error
type ServiceForwarding ¶
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 module Module: the name of the module the service belongs to Recall that module names are unique within a workspace Workspace: the name of the workspace the service belongs to
func ServiceIdentityFromProto ¶
func ServiceIdentityFromProto(proto *basev0.ServiceIdentity) *ServiceIdentity
func (*ServiceIdentity) AsAgentResource ¶
func (s *ServiceIdentity) AsAgentResource() *wool.Resource
func (*ServiceIdentity) AsResource ¶
func (s *ServiceIdentity) AsResource() *wool.Resource
func (*ServiceIdentity) Clone ¶
func (s *ServiceIdentity) Clone() *ServiceIdentity
func (*ServiceIdentity) Unique ¶
func (s *ServiceIdentity) Unique() string
type ServiceReference ¶
type ServiceReference struct { Name string `yaml:"name"` Module string `yaml:"module,omitempty"` PathOverride *string `yaml:"path,omitempty"` }
ServiceReference is a reference to a service used by Module configuration
func ParseServiceReference ¶
func ParseServiceReference(input string) (*ServiceReference, error)
func (*ServiceReference) String ¶
func (ref *ServiceReference) String() string
type ServiceWithCase ¶
func ToServiceWithCase ¶
func ToServiceWithCase(svc *Service) *ServiceWithCase
type ServiceWithModule ¶
func ParseServiceWithOptionalModule ¶
func ParseServiceWithOptionalModule(input string) (*ServiceWithModule, error)
func (ServiceWithModule) String ¶
func (s ServiceWithModule) String() string
func (ServiceWithModule) Unique ¶
func (s ServiceWithModule) Unique() string
type Visibility ¶
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" // VisibilityModule represents an endpoint from other modules inside the system VisibilityModule Visibility = "module" // VisibilityPrivate represents an endpoint that is only accessible within the module VisibilityPrivate Visibility = "private" )
type Workspace ¶
type Workspace struct { Name string `yaml:"name"` Description string `yaml:"description,omitempty"` Layout string `yaml:"layout"` // Modules in the Workspace Modules []*ModuleReference `yaml:"modules,omitempty"` // contains filtered or unexported fields }
func CreateWorkspace ¶
CreateWorkspace creates a new Workspace
func LoadWorkspaceFromDir ¶
LoadWorkspaceFromDir loads a Workspace configuration from a directory
func NewWorkspace ¶
func (*Workspace) AddModuleReference ¶
func (workspace *Workspace) AddModuleReference(modRef *ModuleReference) error
AddModuleReference adds an module to the
func (*Workspace) DeleteModule ¶
DeleteModule deletes an module from the
func (*Workspace) DeleteServiceDependencies ¶
func (workspace *Workspace) DeleteServiceDependencies(ctx context.Context, ref *ServiceReference) error
DeleteServiceDependencies deletes all service dependencies from a
func (*Workspace) ExistsModule ¶
ExistsModule returns true if the module exists in the
func (*Workspace) FindUniqueServiceAndModuleByName ¶
func (workspace *Workspace) FindUniqueServiceAndModuleByName(ctx context.Context, name string) (*ServiceWithModule, error)
FindUniqueServiceAndModuleByName finds a service by name returns ResourceNotFound error if not found
func (*Workspace) FindUniqueServiceByName ¶
func (workspace *Workspace) FindUniqueServiceByName(ctx context.Context, name string) (*Service, error)
FindUniqueServiceByName finds a service by name returns ResourceNotFound error if not found
func (*Workspace) LoadModuleFromName ¶
LoadModuleFromName loads an module from a name
func (*Workspace) LoadModuleFromReference ¶
func (workspace *Workspace) LoadModuleFromReference(ctx context.Context, ref *ModuleReference) (*Module, error)
LoadModuleFromReference loads an module from a reference
func (*Workspace) LoadModules ¶
LoadModules returns the modules in the
func (*Workspace) LoadService ¶
func (workspace *Workspace) LoadService(ctx context.Context, input *ServiceWithModule) (*Service, error)
LoadService loads a service from a reference returns NotFoundError if not found
func (*Workspace) LoadServiceWithModules ¶
func (workspace *Workspace) LoadServiceWithModules(ctx context.Context) ([]*ServiceWithModule, error)
func (*Workspace) LoadServices ¶
func (*Workspace) ModulePath ¶
func (workspace *Workspace) ModulePath(ctx context.Context, ref *ModuleReference) string
ModulePath returns the absolute path of an module Cases for Reference.Dir nil: relative path to with name rel: relative path /abs: absolute path
func (*Workspace) ModulesNames ¶
ModulesNames returns the names of the modules in the
func (*Workspace) NewModule ¶
func (workspace *Workspace) NewModule(ctx context.Context, action *actionsv0.NewModule) (*Module, error)
NewModule creates an module in a workspace
func (*Workspace) RootModule ¶
RootModule only applies to Flat layout
func (*Workspace) SaveToDirUnsafe ¶
type WrapperSwagger ¶
type WrapperSwagger struct {
// contains filtered or unexported fields
}
Source Files ¶
- agent.go
- api.go
- case.go
- configuration.go
- dns.go
- docker.go
- domain.go
- endpoint.go
- environment.go
- environment_variables_manager.go
- forwarding.go
- global.go
- grpc.go
- hash.go
- layout.go
- loader.go
- marshalling.go
- modes.go
- module.go
- network.go
- network_mappings.go
- openapi.go
- organization.go
- readme.go
- references.go
- rest.go
- runtime.go
- service.go
- spec.go
- templates.go
- types.go
- validator.go
- workspace.go