Documentation ¶
Index ¶
- Constants
- Variables
- func APIAsStandard(api *basev0.API) (string, error)
- func ApplicationMode() bool
- func AsEndpointEnvironmentVariable(_ context.Context, endpoint *Endpoint, addresses []string) string
- func AsRestRouteEnvironmentVariable(ctx context.Context, endpoint *basev0.Endpoint) []string
- func CloneAPI(api *basev0.API) *basev0.API
- func CloneEndpoint(_ context.Context, endpoint *basev0.Endpoint) *basev0.Endpoint
- func Condensed(es []*basev0.Endpoint) []string
- func ConfigurationFile[C Configuration]() string
- func ConvertHTTPMethodToProto(m HTTPMethod) basev0.HTTPMethod
- func DeserializeAddresses(data string) ([]string, error)
- func EndpointDestination(e *basev0.Endpoint) string
- func EndpointEnvironmentVariableKey(endpoint *Endpoint) string
- func EndpointGRPCAPI(endpoint *basev0.Endpoint) *basev0.GrpcAPI
- func EndpointHash(ctx context.Context, endpoints ...*basev0.Endpoint) (string, error)
- func EndpointRestAPI(endpoint *basev0.Endpoint) *basev0.RestAPI
- func EnvironmentAsEnvironmentVariable(env *Environment) string
- func ExistsAtDir[C Configuration](dir string) bool
- func ExtendDomain(domain string, extension string) string
- func ExtraValidOrganizationName(name string) bool
- func ExtractEndpointEnvironmentVariables(ctx context.Context, nets []*basev0.NetworkMapping) ([]string, error)
- func ExtractPublicNetworkMappings(mappings []*basev0.NetworkMapping) []*basev0.NetworkMapping
- func ExtractRestRoutesEnvironmentVariables(ctx context.Context, nets []*basev0.NetworkMapping) ([]string, 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 FindEndpointForGRPCRoute(ctx context.Context, endpoints []*basev0.Endpoint, route *GRPCRoute) *basev0.Endpoint
- func FindEndpointForRestRoute(ctx context.Context, endpoints []*basev0.Endpoint, route *RestRouteGroup) *basev0.Endpoint
- func FindMapping(mappings []*basev0.NetworkMapping, endpoint *basev0.Endpoint) *basev0.NetworkMapping
- func FindProjectProvider(name string, sources []*basev0.ProviderInformation) (*basev0.ProviderInformation, error)
- func FindServiceProvider(unique string, name string, sources []*basev0.ProviderInformation) (*basev0.ProviderInformation, error)
- func FindUp[C Configuration](ctx context.Context) (*string, error)
- func FromProtoAPI(api *basev0.API) string
- func Hash(data []byte) string
- func HashString(s string) string
- func HomeDir() (string, error)
- func IdentifierKey(identifier string, app string, svc string) string
- func InPartialMode() bool
- func IsGRPC(_ context.Context, api *basev0.API) *basev0.GrpcAPI
- func IsHTTP(_ context.Context, api *basev0.API) bool
- func IsInitialized(ctx context.Context) (bool, error)
- func IsLocal(environment *basev0.Environment) bool
- func IsRest(_ context.Context, api *basev0.API) *basev0.RestAPI
- func Keying(s string) string
- 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 LoadSpec(ctx context.Context, content []byte, obj any) error
- func LocalProto() *basev0.Environment
- func LocalizeMapping(mapping *basev0.NetworkMapping, local string) *basev0.NetworkMapping
- func LocalizeMappings(nm []*basev0.NetworkMapping, local string) []*basev0.NetworkMapping
- func MakeNetworkMappingSummary(mappings []*basev0.NetworkMapping) string
- func MakeProviderInformationSummary(infos []*basev0.ProviderInformation) string
- func NetworkMappingHash(networkMappings ...*basev0.NetworkMapping) (string, error)
- func NetworkMappingInfo(mapping *basev0.NetworkMapping) string
- func NewGrpcAPI(ctx context.Context, endpoint *Endpoint, filename string) (*basev0.Endpoint, error)
- func NewHTTPApi(ctx context.Context, endpoint *Endpoint) (*basev0.Endpoint, error)
- func NewRestAPI(ctx context.Context, endpoint *Endpoint) (*basev0.Endpoint, error)
- func NewRestAPIFromOpenAPI(ctx context.Context, endpoint *Endpoint, filename string) (*basev0.Endpoint, error)
- func NewTCPAPI(ctx context.Context, endpoint *Endpoint) (*basev0.Endpoint, error)
- func OverridePath(defaultPath string, path string) *string
- func ParseOpenAPI(spec []byte) (*openapispec.Swagger, error)
- func Path[C Configuration](ctx context.Context, dir string) (string, error)
- func PortFromAddress(address string) (int, error)
- func ProviderInfoSummary(info *basev0.ProviderInformation) string
- func ProviderInformationAsEnvironmentVariables(info *basev0.ProviderInformation) []string
- func ProviderInformationEnv(info *basev0.ProviderInformation, key string, value string) string
- func ProviderInformationEnvKey(info *basev0.ProviderInformation, key string) string
- func ProviderInformationHash(infos ...*basev0.ProviderInformation) (string, error)
- func ReferenceMatch(entry string, name string) bool
- func RegisterAgent(kind AgentKind, protoKind basev0.Agent_Kind)
- func RestRouteEnvironmentVariableKey(endpoint *basev0.Endpoint, route *basev0.RestRoute) string
- func RestRoutesAsEnvironmentVariable(endpoint *basev0.Endpoint, route *basev0.RestRoute) string
- func SaveToDir[C Configuration](ctx context.Context, c *C, dir string) error
- func SerializeAddresses(addresses []string) string
- func SerializeSpec(ctx context.Context, spec any) ([]byte, error)
- func ServiceUnique(app string, service string) string
- func ServiceUniqueFromEndpoint(endpoint *basev0.Endpoint) string
- func SetLoadWorkspaceUnsafe(w *Workspace)
- func SetMode(m Mode)
- func SplitAddress(address string) (string, string, error)
- func StandardPort(api *basev0.API) (int, error)
- func ToOrganizationName(svc string) string
- func ToOrganizationSourceVersionControl(name string) string
- func TypeName[C Configuration]() string
- func ValidOrganization(org *basev0.Organization) error
- func ValidOrganizationSourceVersionControl(domain string) bool
- func Validate(req proto.Message) error
- func ValidateAgent(agent *basev0.Agent) error
- func ValidateDomain()
- func WhichAPIFromEndpoint(endpoint *basev0.Endpoint) (string, error)
- func WithAPI(ctx context.Context, endpoint *Endpoint, source APISource) (*basev0.Endpoint, error)
- func WorkspaceConfigurationDir() string
- type APISource
- type Agent
- func (p *Agent) AsResource() *wool.Resource
- func (p *Agent) Identifier() string
- func (p *Agent) IsService() bool
- func (p *Agent) Key(kind AgentKind, unique string) string
- func (p *Agent) Of(kind AgentKind) *Agent
- func (p *Agent) Patch() (*Agent, error)
- func (p *Agent) Path() (string, error)
- func (p *Agent) Proto() *basev0.Agent
- func (p *Agent) String() string
- func (p *Agent) Unique() string
- type AgentKind
- type Application
- func (app *Application) 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) SourceVersionControlForService(name string) 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)
- type ClientEntry
- type Configuration
- type DockerImage
- type Endpoint
- type EndpointInstance
- type EndpointReference
- type EndpointSummary
- type Environment
- type EnvironmentExistsError
- type EnvironmentReference
- type EnvironmentVariableManager
- func (holder *EnvironmentVariableManager) Add(envs ...string)
- func (holder *EnvironmentVariableManager) Get() []string
- func (holder *EnvironmentVariableManager) GetBase() []string
- func (holder *EnvironmentVariableManager) GetEndpoint(ctx context.Context, unique string) (*EndpointInstance, error)
- func (holder *EnvironmentVariableManager) GetProjectProvider(_ context.Context, name string, key string) (string, error)
- func (holder *EnvironmentVariableManager) GetServiceProvider(_ context.Context, unique string, name string, key string) (string, error)
- 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 GrpcAPI
- type HTTPAPI
- type HTTPMethod
- type Hasher
- type MappingInstance
- func BuildMappingInstance(mapping *basev0.NetworkMapping) (*MappingInstance, error)
- func GetMappingInstance(mappings []*basev0.NetworkMapping) (*MappingInstance, error)
- func GetMappingInstanceFor(mappings []*basev0.NetworkMapping, api string) (*MappingInstance, error)
- func GetMappingInstanceForName(ctx context.Context, mappings []*basev0.NetworkMapping, api string, ...) (*MappingInstance, error)
- func GetMappingInstancesFor(mappings []*basev0.NetworkMapping, api string) ([]*MappingInstance, error)
- func GetMappingInstancesForName(mappings []*basev0.NetworkMapping, api string, name string) ([]*MappingInstance, error)
- type Mode
- type NewApplicationInput
- type NilAPIError
- type NilEndpointError
- type NoApplicationError
- 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 (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) 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) 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
- 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 RestAPI
- type RestRoute
- 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) DeleteServiceDependencies(ctx context.Context, ref *ServiceReference) error
- func (s *Service) Dir() string
- func (s *Service) Endpoint() string
- func (s *Service) EndpointsFromNames(endpoints []string) ([]*Endpoint, error)
- func (s *Service) ExistsDependency(requirement *Service) (*ServiceDependency, bool)
- func (s *Service) HasEndpoints(_ context.Context, endpoints []string) ([]string, error)
- func (s *Service) Identity() *ServiceIdentity
- func (s *Service) LoadSettingsFromSpec(t any) error
- func (s *Service) Proto() *basev0.Service
- func (s *Service) Reference() *ServiceReference
- func (s *Service) Save(ctx context.Context) error
- func (s *Service) SaveAtDir(ctx context.Context, dir string) error
- func (s *Service) Unique() string
- func (s *Service) UpdateSpecFromSettings(spec any) error
- func (s *Service) Validate() error
- type ServiceDependency
- type ServiceForwarding
- type ServiceIdentity
- type ServiceReference
- type ServiceWithApplication
- type ServiceWithCase
- type TCP
- type UnknownAPIError
- 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 = "endpoint" )
const AgentConfigurationName = "agent.codefly.yaml"
const BuilderServiceAgent = "codefly:service:builder"
const EndpointIdentifier = "ENDPOINT"
const EnvironmentAsEnvironmentVariableKey = "CODEFLY_ENVIRONMENT"
const GRPCRouteFileSuffix = ".grpc.codefly.yaml"
const LocalWorkspace = "local"
const NA = "NA"
const ProjectConfigurationName = "project.codefly.yaml"
const ProjectProviderOrigin = "ProjectProviderOrigin"
const ProviderPrefix = "CODEFLY_PROVIDER__"
const RestRouteFileSuffix = ".rest.codefly.yaml"
const RestRoutePrefix = "CODEFLY_RESTROUTE__"
const RuntimeServiceAgent = "codefly:service:runtime"
const ServiceAgent = AgentKind("codefly:service")
const ServiceConfigurationName = "service.codefly.yaml"
const Unknown = "unknown"
const WorkspaceConfigurationName = "workspace.codefly.yaml"
Variables ¶
var NetworkDNS string
var NetworkPort string
Functions ¶
func ApplicationMode ¶ added in v0.0.51
func ApplicationMode() bool
func AsEndpointEnvironmentVariable ¶ added in v0.0.13
func AsRestRouteEnvironmentVariable ¶ added in v0.0.91
func CloneEndpoint ¶ added in v0.1.25
func ConfigurationFile ¶ added in v0.0.42
func ConfigurationFile[C Configuration]() string
func ConvertHTTPMethodToProto ¶ added in v0.1.37
func ConvertHTTPMethodToProto(m HTTPMethod) basev0.HTTPMethod
func DeserializeAddresses ¶ added in v0.1.11
func EndpointDestination ¶ added in v0.0.81
func EndpointEnvironmentVariableKey ¶ added in v0.0.91
func EndpointGRPCAPI ¶ added in v0.1.20
func EndpointHash ¶ added in v0.1.20
func EndpointRestAPI ¶ added in v0.1.14
func EnvironmentAsEnvironmentVariable ¶ added in v0.1.20
func EnvironmentAsEnvironmentVariable(env *Environment) string
func ExistsAtDir ¶
func ExistsAtDir[C Configuration](dir string) bool
func ExtendDomain ¶
func ExtraValidOrganizationName ¶ added in v0.0.51
func ExtractEndpointEnvironmentVariables ¶ added in v0.1.22
func ExtractEndpointEnvironmentVariables(ctx context.Context, nets []*basev0.NetworkMapping) ([]string, error)
ExtractEndpointEnvironmentVariables converts NetworkMapping endpoint data to environment variables
func ExtractPublicNetworkMappings ¶ added in v0.1.25
func ExtractPublicNetworkMappings(mappings []*basev0.NetworkMapping) []*basev0.NetworkMapping
func ExtractRestRoutesEnvironmentVariables ¶ added in v0.1.22
func ExtractRestRoutesEnvironmentVariables(ctx context.Context, nets []*basev0.NetworkMapping) ([]string, error)
ExtractRestRoutesEnvironmentVariables converts NetworkMapping endpoint REST data to environment variables
func FilePathForGRPC ¶ added in v0.1.35
func FilePathForRest ¶ added in v0.1.35
func FindEndpointForGRPCRoute ¶ added in v0.1.35
func FindEndpointForGRPCRoute(ctx context.Context, endpoints []*basev0.Endpoint, route *GRPCRoute) *basev0.Endpoint
FindEndpointForGRPCRoute finds the endpoint 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 endpoint that matches the route rpcs
func FindMapping ¶ added in v0.1.33
func FindMapping(mappings []*basev0.NetworkMapping, endpoint *basev0.Endpoint) *basev0.NetworkMapping
func FindProjectProvider ¶ added in v0.1.18
func FindProjectProvider(name string, sources []*basev0.ProviderInformation) (*basev0.ProviderInformation, error)
func FindServiceProvider ¶ added in v0.1.26
func FindServiceProvider(unique string, name string, sources []*basev0.ProviderInformation) (*basev0.ProviderInformation, error)
func FindUp ¶
func FindUp[C Configuration](ctx context.Context) (*string, error)
FindUp looks for a configuration in the active directory and up
func FromProtoAPI ¶ added in v0.0.65
func HashString ¶ added in v0.1.20
func IdentifierKey ¶ added in v0.1.13
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 LocalProto ¶ added in v0.1.33
func LocalProto() *basev0.Environment
func LocalizeMapping ¶ added in v0.1.22
func LocalizeMapping(mapping *basev0.NetworkMapping, local string) *basev0.NetworkMapping
func LocalizeMappings ¶ added in v0.1.22
func LocalizeMappings(nm []*basev0.NetworkMapping, local string) []*basev0.NetworkMapping
func MakeNetworkMappingSummary ¶ added in v0.1.20
func MakeNetworkMappingSummary(mappings []*basev0.NetworkMapping) string
func MakeProviderInformationSummary ¶ added in v0.1.24
func MakeProviderInformationSummary(infos []*basev0.ProviderInformation) string
func NetworkMappingHash ¶ added in v0.1.20
func NetworkMappingHash(networkMappings ...*basev0.NetworkMapping) (string, error)
func NetworkMappingInfo ¶ added in v0.1.20
func NetworkMappingInfo(mapping *basev0.NetworkMapping) string
func NewGrpcAPI ¶ added in v0.0.65
func NewHTTPApi ¶ added in v0.0.81
func NewRestAPI ¶ added in v0.0.65
func NewRestAPIFromOpenAPI ¶ added in v0.0.65
func OverridePath ¶ added in v0.0.51
OverridePath is nil if the name is the same as the desired relative path
func ParseOpenAPI ¶ added in v0.1.14
func ParseOpenAPI(spec []byte) (*openapispec.Swagger, error)
func PortFromAddress ¶ added in v0.1.43
func ProviderInfoSummary ¶ added in v0.1.21
func ProviderInfoSummary(info *basev0.ProviderInformation) string
func ProviderInformationAsEnvironmentVariables ¶ added in v0.1.6
func ProviderInformationAsEnvironmentVariables(info *basev0.ProviderInformation) []string
func ProviderInformationEnv ¶ added in v0.1.6
func ProviderInformationEnv(info *basev0.ProviderInformation, key string, value string) string
func ProviderInformationEnvKey ¶ added in v0.1.6
func ProviderInformationEnvKey(info *basev0.ProviderInformation, key string) string
func ProviderInformationHash ¶ added in v0.1.20
func ProviderInformationHash(infos ...*basev0.ProviderInformation) (string, error)
func ReferenceMatch ¶ added in v0.0.51
func RegisterAgent ¶ added in v0.0.51
func RegisterAgent(kind AgentKind, protoKind basev0.Agent_Kind)
func RestRouteEnvironmentVariableKey ¶ added in v0.0.91
func RestRoutesAsEnvironmentVariable ¶ added in v0.0.91
func SerializeAddresses ¶
TODO: want to encode only if we need to
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 SplitAddress ¶ added in v0.1.33
Split address in host and port
func ToOrganizationName ¶ added in v0.1.18
func ToOrganizationSourceVersionControl ¶ added in v0.1.38
func TypeName ¶
func TypeName[C Configuration]() string
func ValidOrganization ¶ added in v0.0.51
func ValidOrganization(org *basev0.Organization) error
func ValidOrganizationSourceVersionControl ¶ added in v0.1.38
func ValidateAgent ¶ added in v0.0.51
func ValidateDomain ¶
func ValidateDomain()
func WhichAPIFromEndpoint ¶ added in v0.0.65
func WorkspaceConfigurationDir ¶ added in v0.0.51
func WorkspaceConfigurationDir() string
WorkspaceConfigurationDir returns the directory where the Workspace configuration is stored
Types ¶
type Agent ¶ added in v0.0.23
type Agent struct { Kind AgentKind `yaml:"kind" json:"kind"` Name string `yaml:"name" json:"name"` Version string `yaml:"version" json:"version"` Publisher string `yaml:"publisher" json:"publisher"` }
var CLI *Agent
func AgentFromProto ¶ added in v0.0.51
func ParseAgent ¶ added in v0.0.23
func (*Agent) AsResource ¶ added in v0.0.55
func (*Agent) Identifier ¶ added in v0.0.23
type AgentKind ¶ added in v0.0.51
type AgentKind string
func AgentKindFromProto ¶ added in v0.0.51
func AgentKindFromProto(kind basev0.Agent_Kind) (*AgentKind, error)
type Application ¶
type Application struct { Kind string `yaml:"kind"` Name string `yaml:"name"` PathOverride *string `yaml:"path,omitempty"` Project string `yaml:"project"` SourceVersionControl string `yaml:"source-version-control"` 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) SourceVersionControlForService ¶ added in v0.1.42
func (app *Application) SourceVersionControlForService(name string) string
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)
type ClientEntry ¶
func (*ClientEntry) Validate ¶
func (c *ClientEntry) Validate() error
type Configuration ¶
type Configuration interface{}
type DockerImage ¶ added in v0.0.26
func (*DockerImage) FullName ¶ added in v0.1.1
func (image *DockerImage) FullName() string
type Endpoint ¶
type Endpoint struct { Name string `yaml:"name,omitempty"` 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 ParseEndpoint ¶ added in v0.1.6
func (*Endpoint) AsReference ¶ added in v0.0.51
func (endpoint *Endpoint) AsReference() *EndpointReference
func (*Endpoint) Identifier ¶ added in v0.1.11
Identifier satisfies this format: - name::api if name != api - api if name == api or name == ""
func (*Endpoint) ServiceUnique ¶ added in v0.1.14
func (*Endpoint) UnknownAPI ¶ added in v0.1.11
type EndpointInstance ¶ added in v0.0.13
func DefaultEndpointInstance ¶ added in v0.1.23
func DefaultEndpointInstance(unique string) *EndpointInstance
func (*EndpointInstance) Address ¶ added in v0.1.6
func (instance *EndpointInstance) Address() (string, error)
func (*EndpointInstance) Port ¶ added in v0.1.25
func (instance *EndpointInstance) Port() (int, error)
func (*EndpointInstance) PortAddress ¶ added in v0.1.6
func (instance *EndpointInstance) PortAddress() (string, error)
type EndpointReference ¶ added in v0.0.9
type EndpointReference struct {
Name string `yaml:"name"`
}
An EndpointReference
type EndpointSummary ¶ added in v0.0.81
func MakeEndpointSummary ¶ added in v0.0.81
func MakeEndpointSummary(endpoints []*basev0.Endpoint) EndpointSummary
type Environment ¶ added in v0.0.17
type Environment struct { Name string `yaml:"name"` Description string `yaml:"description,omitempty"` NetworkType string `yaml:"networkType,omitempty"` }
Environment is a configuration for an environment
func EnvironmentFromProto ¶ added in v0.1.20
func EnvironmentFromProto(environment *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) 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 EnvironmentVariableManager ¶ added in v0.1.6
type EnvironmentVariableManager struct {
// contains filtered or unexported fields
}
func NewEnvironmentVariableManager ¶ added in v0.1.6
func NewEnvironmentVariableManager() *EnvironmentVariableManager
func (*EnvironmentVariableManager) Add ¶ added in v0.1.6
func (holder *EnvironmentVariableManager) Add(envs ...string)
func (*EnvironmentVariableManager) Get ¶ added in v0.1.7
func (holder *EnvironmentVariableManager) Get() []string
func (*EnvironmentVariableManager) GetBase ¶ added in v0.1.8
func (holder *EnvironmentVariableManager) GetBase() []string
func (*EnvironmentVariableManager) GetEndpoint ¶ added in v0.1.6
func (holder *EnvironmentVariableManager) GetEndpoint(ctx context.Context, unique string) (*EndpointInstance, error)
func (*EnvironmentVariableManager) GetProjectProvider ¶ added in v0.1.6
func (*EnvironmentVariableManager) GetServiceProvider ¶ added in v0.1.6
type 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 MappingInstance ¶ added in v0.1.22
func BuildMappingInstance ¶ added in v0.1.25
func BuildMappingInstance(mapping *basev0.NetworkMapping) (*MappingInstance, error)
func GetMappingInstance ¶ added in v0.1.22
func GetMappingInstance(mappings []*basev0.NetworkMapping) (*MappingInstance, error)
GetMappingInstance returns the network mapping instance when there is only one Really a convenience function for Agent
func GetMappingInstanceFor ¶ added in v0.1.25
func GetMappingInstanceFor(mappings []*basev0.NetworkMapping, api string) (*MappingInstance, error)
GetMappingInstanceFor returns the network mapping instance when there is only one Really a convenience function for Agent
func GetMappingInstanceForName ¶ added in v0.1.33
func GetMappingInstanceForName(ctx context.Context, mappings []*basev0.NetworkMapping, api string, name string) (*MappingInstance, error)
func GetMappingInstancesFor ¶ added in v0.1.33
func GetMappingInstancesFor(mappings []*basev0.NetworkMapping, api string) ([]*MappingInstance, error)
GetMappingInstances returns the network mapping instances
func GetMappingInstancesForName ¶ added in v0.1.33
func GetMappingInstancesForName(mappings []*basev0.NetworkMapping, api string, name string) ([]*MappingInstance, error)
GetMappingInstancesForName returns the network mapping instances
type NewApplicationInput ¶ added in v0.1.38
type NewApplicationInput struct {
Name string
}
type NilAPIError ¶ added in v0.0.65
type NilAPIError struct {
// contains filtered or unexported fields
}
func (*NilAPIError) Error ¶ added in v0.0.65
func (err *NilAPIError) Error() string
type NilEndpointError ¶ added in v0.0.65
type NilEndpointError struct{}
func (NilEndpointError) Error ¶ added in v0.0.65
func (n NilEndpointError) Error() string
type NoApplicationError ¶
type NoApplicationError struct {
Project string
}
func (NoApplicationError) Error ¶
func (e NoApplicationError) Error() string
type 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"` SourceVersionControl string `yaml:"domain"` }
func OrganizationFromProto ¶ added in v0.0.51
func OrganizationFromProto(_ context.Context, m *basev0.Organization) (*Organization, error)
func (*Organization) Proto ¶ added in v0.0.51
func (organization *Organization) Proto() *basev0.Organization
type Project ¶
type Project struct { Name string `yaml:"name"` // ID must be globally unique ID string `yaml:"id,omitempty"` 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 LoadProjectFromDir ¶
LoadProjectFromDir loads a Project configuration from a directory
func LoadProjectFromPath ¶ added in v0.0.51
func NewProject ¶
NewProject creates a new project
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) 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) 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 RestRouteGroup ¶ added in v0.1.18
type RestRouteGroup struct { Path string `yaml:"path"` Routes []*RestRoute `yaml:"routes"` Application string `yaml:"-"` Service string `yaml:"-"` }
RestRouteGroup is a rpcs of routes corresponding to the SAME path 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"` SourceVersionControl string `yaml:"source-version-control"` Namespace string `yaml:"namespace"` PathOverride *string `yaml:"path,omitempty"` Agent *Agent `yaml:"agent"` // ServiceDependencies are the other services required ServiceDependencies []*ServiceDependency `yaml:"service-dependencies"` // ProviderDependencies are the providers required ProviderDependencies []string `yaml:"provider-dependencies"` // Endpoints exposed by the service Endpoints []*Endpoint `yaml:"endpoints"` // Spec is the specialized configuration of the service Spec map[string]any `yaml:"spec"` // contains filtered or unexported fields }
A Service
func 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) DeleteServiceDependencies ¶ added in v0.0.91
func (s *Service) DeleteServiceDependencies(ctx context.Context, ref *ServiceReference) error
func (*Service) EndpointsFromNames ¶ added in v0.0.51
EndpointsFromNames return matching endpoints
func (*Service) ExistsDependency ¶ added in v0.0.51
func (s *Service) ExistsDependency(requirement *Service) (*ServiceDependency, bool)
func (*Service) HasEndpoints ¶ added in v0.0.51
func (*Service) Identity ¶ added in v0.0.51
func (s *Service) Identity() *ServiceIdentity
Identity is the proto version of Unique
func (*Service) LoadSettingsFromSpec ¶ added in v0.0.15
func (*Service) Reference ¶
func (s *Service) Reference() *ServiceReference
func (*Service) Unique ¶
Unique identifies a service within a project We use a REST like convention rather then a subdomain one
func (*Service) UpdateSpecFromSettings ¶ added in v0.0.15
type ServiceDependency ¶
type ServiceDependency struct { Name string `yaml:"name"` Application string `yaml:"application,omitempty"` Endpoints []*EndpointReference `yaml:"endpoints,omitempty"` }
func (*ServiceDependency) AsReference ¶
func (s *ServiceDependency) AsReference() *ServiceReference
func (*ServiceDependency) String ¶ added in v0.0.13
func (s *ServiceDependency) String() string
func (*ServiceDependency) Unique ¶ added in v0.0.13
func (s *ServiceDependency) Unique() string
func (*ServiceDependency) UpdateEndpoints ¶ added in v0.0.51
func (s *ServiceDependency) UpdateEndpoints(ctx context.Context, endpoints []*Endpoint) error
type ServiceForwarding ¶ added in v0.0.65
type ServiceForwarding struct {
// contains filtered or unexported fields
}
type ServiceIdentity ¶
type ServiceIdentity struct { Name string Application string Project string Namespace string SourceVersionControl string }
ServiceIdentity defines exactly the scope of the service Name: the name of the service It will be unique within an application Application: the name of the application the service belongs to Recall that application names are unique within a project This is a logical partitioning Namespace: the namespace the service belongs to This is a resource partitioning SourceVersionControl: the domain of the service belongs to This is a responsibility partitioning
func ServiceIdentityFromProto ¶ added in v0.0.71
func ServiceIdentityFromProto(proto *basev0.ServiceIdentity) *ServiceIdentity
func (*ServiceIdentity) AsResource ¶ added in v0.0.55
func (s *ServiceIdentity) AsResource() *wool.Resource
func (*ServiceIdentity) Unique ¶ added in v0.0.55
func (s *ServiceIdentity) Unique() string
type ServiceReference ¶
type ServiceReference struct { Name string `yaml:"name"` PathOverride *string `yaml:"path,omitempty"` Application string `yaml:"application,omitempty"` }
ServiceReference is a reference to a service used by Application configuration
func ParseServiceReference ¶ added in v0.0.15
func ParseServiceReference(input string) (*ServiceReference, error)
func (*ServiceReference) String ¶ added in v0.0.15
func (ref *ServiceReference) String() string
type 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 UnknownAPIError ¶ added in v0.0.65
type UnknownAPIError struct {
// contains filtered or unexported fields
}
func (*UnknownAPIError) Error ¶ added in v0.0.65
func (err *UnknownAPIError) Error() string
type Visibility ¶ added in v0.0.91
type Visibility = string
const ( VisibilityApplication Visibility = "application" VisibilityPublic Visibility = "public" )
type Workspace ¶
type Workspace struct { Name string `yaml:"name"` Organization Organization `yaml:"organization,omitempty"` Domain string `yaml:"domain,omitempty"` // Projects in the Workspace configuration Projects []*ProjectReference `yaml:"projects"` 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
- docker.go
- domain.go
- endpoint.go
- environment.go
- environment_variables.go
- environment_variables_manager.go
- forwarding.go
- grpc.go
- hash.go
- homedir.go
- loader.go
- marshalling.go
- modes.go
- network_mappings.go
- openapi.go
- organization.go
- partial.go
- project.go
- provider_info.go
- readme.go
- references.go
- rest.go
- service.go
- spec.go
- templates.go
- types.go
- validator.go
- workspace.go