configurations

package
v0.1.43 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 38 Imported by: 4

README

Conventions for environment variables

Key

CODEFLY_{TYPE}{APP}{SVC}___{KEY}

Documentation

Index

Constants

View Source
const (
	ApplicationKind              = "application"
	ApplicationConfigurationName = "application.codefly.yaml"
)
View Source
const (
	AGENT = "agent"

	PROJECT     = "project"
	APPLICATION = "application"
	SERVICE     = "service"
	ENDPOINT    = "endpoint"
)
View Source
const AgentConfigurationName = "agent.codefly.yaml"
View Source
const BuilderServiceAgent = "codefly:service:builder"
View Source
const EndpointIdentifier = "ENDPOINT"
View Source
const EnvironmentAsEnvironmentVariableKey = "CODEFLY_ENVIRONMENT"
View Source
const GRPCRouteFileSuffix = ".grpc.codefly.yaml"
View Source
const LocalWorkspace = "local"
View Source
const NA = "NA"
View Source
const ProjectConfigurationName = "project.codefly.yaml"
View Source
const ProjectProviderOrigin = "ProjectProviderOrigin"
View Source
const ProviderPrefix = "CODEFLY_PROVIDER__"
View Source
const RestRouteFileSuffix = ".rest.codefly.yaml"
View Source
const RestRoutePrefix = "CODEFLY_RESTROUTE__"
View Source
const RuntimeServiceAgent = "codefly:service:runtime"
View Source
const ServiceAgent = AgentKind("codefly:service")
View Source
const ServiceConfigurationName = "service.codefly.yaml"
View Source
const Unknown = "unknown"
View Source
const WorkspaceConfigurationName = "workspace.codefly.yaml"

Variables

View Source
var NetworkDNS string
View Source
var NetworkPort string

Functions

func APIAsStandard added in v0.1.25

func APIAsStandard(api *basev0.API) (string, error)

func ApplicationMode added in v0.0.51

func ApplicationMode() bool

func AsEndpointEnvironmentVariable added in v0.0.13

func AsEndpointEnvironmentVariable(_ context.Context, endpoint *Endpoint, addresses []string) string

func AsRestRouteEnvironmentVariable added in v0.0.91

func AsRestRouteEnvironmentVariable(ctx context.Context, endpoint *basev0.Endpoint) []string

func CloneAPI added in v0.1.25

func CloneAPI(api *basev0.API) *basev0.API

func CloneEndpoint added in v0.1.25

func CloneEndpoint(_ context.Context, endpoint *basev0.Endpoint) *basev0.Endpoint

func Condensed added in v0.0.65

func Condensed(es []*basev0.Endpoint) []string

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 DeserializeAddresses(data string) ([]string, error)

func EndpointDestination added in v0.0.81

func EndpointDestination(e *basev0.Endpoint) string

func EndpointEnvironmentVariableKey added in v0.0.91

func EndpointEnvironmentVariableKey(endpoint *Endpoint) string

func EndpointGRPCAPI added in v0.1.20

func EndpointGRPCAPI(endpoint *basev0.Endpoint) *basev0.GrpcAPI

func EndpointHash added in v0.1.20

func EndpointHash(ctx context.Context, endpoints ...*basev0.Endpoint) (string, error)

func EndpointRestAPI added in v0.1.14

func EndpointRestAPI(endpoint *basev0.Endpoint) *basev0.RestAPI

func EnvironmentAsEnvironmentVariable added in v0.1.20

func EnvironmentAsEnvironmentVariable(env *Environment) string

func ExistsAtDir

func ExistsAtDir[C Configuration](dir string) bool

func ExtendDomain

func ExtendDomain(domain string, extension string) string

func ExtraValidOrganizationName added in v0.0.51

func ExtraValidOrganizationName(name string) bool

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 FilePathForGRPC(ctx context.Context, dir string, unique string, name string) (string, error)

func FilePathForRest added in v0.1.35

func FilePathForRest(ctx context.Context, dir string, unique string, routePath string) (string, error)

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 FromProtoAPI(api *basev0.API) string

func Hash added in v0.1.20

func Hash(data []byte) string

func HashString added in v0.1.20

func HashString(s string) string

func HomeDir

func HomeDir() (string, error)

func IdentifierKey added in v0.1.13

func IdentifierKey(identifier string, app string, svc string) string

func InPartialMode added in v0.0.15

func InPartialMode() bool

func IsGRPC added in v0.1.31

func IsGRPC(_ context.Context, api *basev0.API) *basev0.GrpcAPI

func IsHTTP added in v0.1.43

func IsHTTP(_ context.Context, api *basev0.API) bool

func IsInitialized added in v0.0.51

func IsInitialized(ctx context.Context) (bool, error)

func IsLocal added in v0.1.25

func IsLocal(environment *basev0.Environment) bool

func IsRest added in v0.1.31

func IsRest(_ context.Context, api *basev0.API) *basev0.RestAPI

func Keying added in v0.1.13

func Keying(s string) string

func Light added in v0.0.65

func Light(e *basev0.Endpoint) *basev0.Endpoint

func LightAPI added in v0.0.65

func LightAPI(api *basev0.API) *basev0.API

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 LoadSpec

func LoadSpec(ctx context.Context, content []byte, obj any) 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 NewGrpcAPI(ctx context.Context, endpoint *Endpoint, filename string) (*basev0.Endpoint, error)

func NewHTTPApi added in v0.0.81

func NewHTTPApi(ctx context.Context, endpoint *Endpoint) (*basev0.Endpoint, error)

func NewRestAPI added in v0.0.65

func NewRestAPI(ctx context.Context, endpoint *Endpoint) (*basev0.Endpoint, error)

func NewRestAPIFromOpenAPI added in v0.0.65

func NewRestAPIFromOpenAPI(ctx context.Context, endpoint *Endpoint, filename string) (*basev0.Endpoint, error)

func NewTCPAPI added in v0.1.6

func NewTCPAPI(ctx context.Context, endpoint *Endpoint) (*basev0.Endpoint, error)

func OverridePath added in v0.0.51

func OverridePath(defaultPath string, path string) *string

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 Path

func Path[C Configuration](ctx context.Context, dir string) (string, error)

func PortFromAddress added in v0.1.43

func PortFromAddress(address string) (int, error)

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 ReferenceMatch(entry string, name string) bool

func RegisterAgent added in v0.0.51

func RegisterAgent(kind AgentKind, protoKind basev0.Agent_Kind)

func RestRouteEnvironmentVariableKey added in v0.0.91

func RestRouteEnvironmentVariableKey(endpoint *basev0.Endpoint, route *basev0.RestRoute) string

func RestRoutesAsEnvironmentVariable added in v0.0.91

func RestRoutesAsEnvironmentVariable(endpoint *basev0.Endpoint, route *basev0.RestRoute) string

func SaveToDir

func SaveToDir[C Configuration](ctx context.Context, c *C, dir string) error

func SerializeAddresses

func SerializeAddresses(addresses []string) string

TODO: want to encode only if we need to

func SerializeSpec

func SerializeSpec(ctx context.Context, spec any) ([]byte, error)

func ServiceUnique added in v0.0.81

func ServiceUnique(app string, service string) string

func ServiceUniqueFromEndpoint added in v0.1.31

func ServiceUniqueFromEndpoint(endpoint *basev0.Endpoint) string

func SetLoadWorkspaceUnsafe added in v0.0.51

func SetLoadWorkspaceUnsafe(w *Workspace)

func SetMode added in v0.0.15

func SetMode(m Mode)

func SplitAddress added in v0.1.33

func SplitAddress(address string) (string, string, error)

Split address in host and port

func StandardPort added in v0.0.65

func StandardPort(api *basev0.API) (int, error)

func ToOrganizationName added in v0.1.18

func ToOrganizationName(svc string) string

func ToOrganizationSourceVersionControl added in v0.1.38

func ToOrganizationSourceVersionControl(name string) string

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 ValidOrganizationSourceVersionControl(domain string) bool

func Validate added in v0.1.18

func Validate(req proto.Message) error

func ValidateAgent added in v0.0.51

func ValidateAgent(agent *basev0.Agent) error

func ValidateDomain

func ValidateDomain()

func WhichAPIFromEndpoint added in v0.0.65

func WhichAPIFromEndpoint(endpoint *basev0.Endpoint) (string, error)

func WithAPI added in v0.0.65

func WithAPI(ctx context.Context, endpoint *Endpoint, source APISource) (*basev0.Endpoint, error)

func WorkspaceConfigurationDir added in v0.0.51

func WorkspaceConfigurationDir() string

WorkspaceConfigurationDir returns the directory where the Workspace configuration is stored

Types

type APISource added in v0.0.65

type APISource interface {
	Proto() (*basev0.API, error)
}

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 AgentFromProto(agent *basev0.Agent) *Agent

func LoadAgent added in v0.0.51

func LoadAgent(ctx context.Context, action *basev0.Agent) (*Agent, error)

func ParseAgent added in v0.0.23

func ParseAgent(ctx context.Context, k AgentKind, s string) (*Agent, error)

func (*Agent) AsResource added in v0.0.55

func (p *Agent) AsResource() *wool.Resource

func (*Agent) Identifier added in v0.0.23

func (p *Agent) Identifier() string

func (*Agent) IsService added in v0.0.51

func (p *Agent) IsService() bool

func (*Agent) Key added in v0.0.23

func (p *Agent) Key(kind AgentKind, unique string) string

func (*Agent) Of added in v0.0.23

func (p *Agent) Of(kind AgentKind) *Agent

func (*Agent) Patch added in v0.0.23

func (p *Agent) Patch() (*Agent, error)

func (*Agent) Path added in v0.0.23

func (p *Agent) Path() (string, error)

func (*Agent) Proto added in v0.0.55

func (p *Agent) Proto() *basev0.Agent

func (*Agent) String added in v0.0.23

func (p *Agent) String() string

func (*Agent) Unique added in v0.0.23

func (p *Agent) Unique() string

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 (app *Application) LoadServiceFromName(ctx context.Context, name string) (*Service, error)

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 (app *Application) PublicEndpoints(ctx context.Context) ([]*basev0.Endpoint, error)

func (*Application) Reference added in v0.0.15

func (app *Application) Reference() *ApplicationReference

func (*Application) Save

func (app *Application) Save(ctx context.Context) error

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

type ClientEntry struct {
	Name string   `yaml:"name"`
	APIs []string `yaml:"apis"`
}

func (*ClientEntry) Validate

func (c *ClientEntry) Validate() error

type Configuration

type Configuration interface{}

type DockerImage added in v0.0.26

type DockerImage struct {
	Repository string
	Name       string
	Tag        string
}

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 EndpointFromProto(e *basev0.Endpoint) *Endpoint

func FromProtoEndpoints added in v0.0.65

func FromProtoEndpoints(es ...*basev0.Endpoint) ([]*Endpoint, error)

func ParseEndpoint added in v0.1.6

func ParseEndpoint(unique string) (*Endpoint, error)

func (*Endpoint) AsReference added in v0.0.51

func (endpoint *Endpoint) AsReference() *EndpointReference

func (*Endpoint) Identifier added in v0.1.11

func (endpoint *Endpoint) Identifier() string

Identifier satisfies this format: - name::api if name != api - api if name == api or name == ""

func (*Endpoint) Proto added in v0.1.37

func (endpoint *Endpoint) Proto() *basev0.Endpoint

func (*Endpoint) ServiceUnique added in v0.1.14

func (endpoint *Endpoint) ServiceUnique() string

func (*Endpoint) Unique added in v0.0.13

func (endpoint *Endpoint) Unique() string

func (*Endpoint) UnknownAPI added in v0.1.11

func (endpoint *Endpoint) UnknownAPI() bool

type EndpointInstance added in v0.0.13

type EndpointInstance struct {
	*Endpoint
	Addresses []string
}

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

type EndpointSummary struct {
	Count   int
	Uniques []string
}

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 (holder *EnvironmentVariableManager) GetProjectProvider(_ context.Context, name string, key string) (string, error)

func (*EnvironmentVariableManager) GetServiceProvider added in v0.1.6

func (holder *EnvironmentVariableManager) GetServiceProvider(_ context.Context, unique string, name string, key string) (string, error)

type ExtendedGRPCRoute added in v0.1.35

type ExtendedGRPCRoute[T any] struct {
	GRPCRoute `yaml:",inline"`

	Extension T `yaml:"extension"`
}

func LoadExtendedGRPCRoute added in v0.1.35

func LoadExtendedGRPCRoute[T any](ctx context.Context, p string) (*ExtendedGRPCRoute[T], error)

func (*ExtendedGRPCRoute[T]) Save added in v0.1.35

func (g *ExtendedGRPCRoute[T]) Save(ctx context.Context, dir string) error

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 NewExtendedGRPCRouteLoader[T any](ctx context.Context, dir string) (*ExtendedGRPCRouteLoader[T], error)

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]

func (*ExtendedGRPCRouteLoader[T]) Load added in v0.1.35

func (loader *ExtendedGRPCRouteLoader[T]) Load(ctx context.Context) error

func (*ExtendedGRPCRouteLoader[T]) Save added in v0.1.35

func (loader *ExtendedGRPCRouteLoader[T]) Save(ctx context.Context) error

type ExtendedRestRoute added in v0.0.13

type ExtendedRestRoute[T any] struct {
	RestRoute `yaml:",inline"`

	Extension T `yaml:"extension"`
}

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 LoadExtendedRestRouteGroup[T any](ctx context.Context, p string) (*ExtendedRestRouteGroup[T], error)

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 NewExtendedRestRouteLoader[T any](ctx context.Context, dir string) (*ExtendedRouteLoader[T], error)

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]

func (*ExtendedRouteLoader[T]) Load added in v0.1.18

func (loader *ExtendedRouteLoader[T]) Load(ctx context.Context) error

func (*ExtendedRouteLoader[T]) Save added in v0.1.18

func (loader *ExtendedRouteLoader[T]) Save(ctx context.Context) error

type Forwarding added in v0.0.65

type Forwarding interface {
	Forward(r *RestRoute) (*RestRoute, error)
}

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 DetectNewGRPCRoutesFromEndpoints(ctx context.Context, endpoints []*basev0.Endpoint, known []*GRPCRoute) []*GRPCRoute

func GRPCRouteFromProto added in v0.1.35

func GRPCRouteFromProto(e *basev0.Endpoint, grpc *basev0.GrpcAPI, rpc *basev0.RPC) *GRPCRoute

func LoadGRPCRoute added in v0.1.35

func LoadGRPCRoute(ctx context.Context, p string) (*GRPCRoute, error)

func UnwrapGRPCRoute added in v0.1.35

func UnwrapGRPCRoute[T any](route *ExtendedGRPCRoute[T]) *GRPCRoute

func (*GRPCRoute) Delete added in v0.1.35

func (g *GRPCRoute) Delete(ctx context.Context, dir string) error

func (*GRPCRoute) Route added in v0.1.35

func (g *GRPCRoute) Route() string

A Route in gRPC is defined as: /package.Service/Method

func (*GRPCRoute) Save added in v0.1.35

func (g *GRPCRoute) Save(ctx context.Context, dir string) error

func (*GRPCRoute) ServiceUnique added in v0.1.35

func (g *GRPCRoute) ServiceUnique() string

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

func (*GRPCRouteLoader) Load added in v0.1.35

func (loader *GRPCRouteLoader) Load(ctx context.Context) error

func (*GRPCRouteLoader) Save added in v0.1.35

func (loader *GRPCRouteLoader) Save(ctx context.Context) error

type GrpcAPI added in v0.0.65

type GrpcAPI struct {
	// contains filtered or unexported fields
}

func (*GrpcAPI) Proto added in v0.0.65

func (grpc *GrpcAPI) Proto() (*basev0.API, error)

type HTTPAPI added in v0.0.81

type HTTPAPI struct{}

func (*HTTPAPI) Proto added in v0.0.81

func (h *HTTPAPI) Proto() (*basev0.API, error)

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 Hasher added in v0.1.20

type Hasher struct {
	// contains filtered or unexported fields
}

func NewHasher added in v0.1.20

func NewHasher() *Hasher

func (*Hasher) Add added in v0.1.20

func (h *Hasher) Add(s string)

func (*Hasher) Hash added in v0.1.20

func (h *Hasher) Hash() string

type MappingInstance added in v0.1.22

type MappingInstance struct {
	Address string
	Port    int
}

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 Mode added in v0.0.15

type Mode = string
const (
	ModeApplication Mode = "application"
	ModePartial     Mode = "partial"
	ModeService     Mode = "service"
)

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 NewOpenAPICombinator(ctx context.Context, target *Endpoint, endpoints ...*basev0.Endpoint) (*OpenAPICombinator, error)

func (*OpenAPICombinator) Combine added in v0.1.14

func (c *OpenAPICombinator) Combine(ctx context.Context) (*basev0.Endpoint, error)

func (*OpenAPICombinator) LoadEndpoints added in v0.1.14

func (c *OpenAPICombinator) LoadEndpoints(ctx context.Context, endpoints ...*basev0.Endpoint) error

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 Partial added in v0.0.13

type Partial struct {
	Name    string `yaml:"name"`
	Project string `yaml:"project"`
	// Applications in the partial of the project
	Applications []string `yaml:"applications"`
}

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

func LoadProjectFromDir(ctx context.Context, dir string) (*Project, error)

LoadProjectFromDir loads a Project configuration from a directory

func LoadProjectFromPath added in v0.0.51

func LoadProjectFromPath(ctx context.Context) (*Project, error)

func NewProject

func NewProject(ctx context.Context, action *actionsv0.NewProject) (*Project, error)

NewProject creates a new project

func ReloadProject added in v0.1.18

func ReloadProject(ctx context.Context, project *Project) (*Project, error)

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

func (project *Project) ApplicationsNames() []string

ApplicationsNames returns the names of the applications in the project

func (*Project) DeleteApplication added in v0.0.51

func (project *Project) DeleteApplication(ctx context.Context, name string) error

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) Dir

func (project *Project) Dir() string

Dir is the directory of the project

func (*Project) ExistsApplication added in v0.0.51

func (project *Project) ExistsApplication(name string) bool

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 *Project) LoadService(ctx context.Context, input *ServiceWithApplication) (*Service, error)

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) Proto added in v0.0.51

func (project *Project) Proto() *basev0.Project

func (*Project) Reference added in v0.1.18

func (project *Project) Reference() *ProjectReference

func (*Project) Save

func (project *Project) Save(ctx context.Context) error

func (*Project) SaveToDirUnsafe added in v0.0.51

func (project *Project) SaveToDirUnsafe(ctx context.Context, dir string) error

func (*Project) Unique

func (project *Project) Unique() string

Unique returns the unique name of the project Currently, we don't insure uniqueness across workspaces

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 Readme added in v0.0.26

type Readme struct {
	Content string
}

type RestAPI added in v0.0.65

type RestAPI struct {
	// contains filtered or unexported fields
}

func (*RestAPI) Proto added in v0.0.65

func (rest *RestAPI) Proto() (*basev0.API, error)

type RestRoute added in v0.0.13

type RestRoute struct {
	Path   string
	Method HTTPMethod
}

func RestRouteFromProto added in v0.1.18

func RestRouteFromProto(r *basev0.RestRoute) *RestRoute

func UnwrapRestRoute added in v0.1.35

func UnwrapRestRoute[T any](route *ExtendedRestRoute[T]) *RestRoute

func (RestRoute) Proto added in v0.1.37

func (r RestRoute) Proto() *basev0.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

func (*RestRouteLoader) Load added in v0.1.35

func (loader *RestRouteLoader) Load(ctx context.Context) error

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

func LoadServiceFromDir(ctx context.Context, dir string) (*Service, error)

LoadServiceFromDir loads a service from a directory

func LoadServiceFromPath added in v0.0.51

func LoadServiceFromPath(ctx context.Context) (*Service, error)

LoadServiceFromPath loads an service from a path

func ReloadService added in v0.0.51

func ReloadService(ctx context.Context, service *Service) (*Service, error)

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) Dir

func (s *Service) Dir() string

func (*Service) Endpoint

func (s *Service) Endpoint() string

func (*Service) EndpointsFromNames added in v0.0.51

func (s *Service) EndpointsFromNames(endpoints []string) ([]*Endpoint, error)

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 (s *Service) HasEndpoints(_ context.Context, endpoints []string) ([]string, error)

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 (s *Service) LoadSettingsFromSpec(t any) error

func (*Service) Proto added in v0.0.51

func (s *Service) Proto() *basev0.Service

func (*Service) Reference

func (s *Service) Reference() *ServiceReference

func (*Service) Save

func (s *Service) Save(ctx context.Context) error

func (*Service) SaveAtDir

func (s *Service) SaveAtDir(ctx context.Context, dir string) error

func (*Service) Unique

func (s *Service) Unique() string

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

func (s *Service) UpdateSpecFromSettings(spec any) error

func (*Service) Validate added in v0.1.18

func (s *Service) Validate() error

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
}

func (ServiceForwarding) Forward added in v0.0.65

func (s ServiceForwarding) Forward(r *RestRoute) (*RestRoute, error)

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

type ServiceWithApplication struct {
	Name        string
	Application string
}

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

type ServiceWithCase struct {
	Name      shared.Case
	Unique    shared.Case
	Domain    string
	Namespace string
}

func ToServiceWithCase added in v0.0.26

func ToServiceWithCase(svc *Service) *ServiceWithCase

type TCP added in v0.0.51

type TCP struct{}

func NewTCP added in v0.0.65

func NewTCP() (*TCP, error)

func (*TCP) Proto added in v0.0.65

func (*TCP) Proto() (*basev0.API, error)

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

func LoadWorkspace(ctx context.Context, name string) (*Workspace, error)

LoadWorkspace returns the active Workspace configuration

func LoadWorkspaceFromDirUnsafe added in v0.0.51

func LoadWorkspaceFromDirUnsafe(ctx context.Context, dir string) (*Workspace, error)

LoadWorkspaceFromDirUnsafe loads a Workspace configuration from a directory

func NewWorkspace added in v0.0.51

func NewWorkspace(ctx context.Context, action *actionsv0.AddWorkspace) (*Workspace, error)

NewWorkspace creates a new workspace

func ReloadWorkspace added in v0.0.51

func ReloadWorkspace(ctx context.Context, workspace *Workspace) (*Workspace, error)

ReloadWorkspace a project configuration

func (*Workspace) AddApplicationReference added in v0.1.38

func (workspace *Workspace) AddApplicationReference(ctx context.Context, projectName string, application *ApplicationReference) error

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 *Workspace) AddService(ctx context.Context, projectName string, applicationName string, service *ServiceReference) error

func (*Workspace) DeleteApplication added in v0.1.33

func (workspace *Workspace) DeleteApplication(ctx context.Context, projectName string, name string) error

func (*Workspace) DeleteProject added in v0.0.37

func (workspace *Workspace) DeleteProject(ctx context.Context, name string) error

func (*Workspace) DeleteService added in v0.1.33

func (workspace *Workspace) DeleteService(ctx context.Context, projectName string, appName string, name string) error

func (*Workspace) Dir

func (workspace *Workspace) Dir() string

Dir returns the absolute path to the Workspace configuration directory

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

func (workspace *Workspace) HasProject(name string) bool

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

func (workspace *Workspace) LoadActiveProject(ctx context.Context) (*Project, error)

LoadActiveProject load the active project if exists returns nil if no active project

func (*Workspace) LoadActiveService added in v0.1.18

func (workspace *Workspace) LoadActiveService(ctx context.Context, projectName string, applicationName string) (*Service, error)

func (*Workspace) LoadProjectFromDir added in v0.0.51

func (workspace *Workspace) LoadProjectFromDir(ctx context.Context, dir string) (*Project, error)

LoadProjectFromDir loads a project from a directory

func (*Workspace) LoadProjectFromName added in v0.0.51

func (workspace *Workspace) LoadProjectFromName(ctx context.Context, name string) (*Project, error)

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

func (workspace *Workspace) LoadProjects(ctx context.Context) ([]*Project, error)

LoadProjects loads all the projects in the Workspace

func (*Workspace) ProjectNames added in v0.0.51

func (workspace *Workspace) ProjectNames() []string

ProjectNames returns the names of the projects in the Workspace configuration

func (*Workspace) Save added in v0.0.51

func (workspace *Workspace) Save(ctx context.Context) error

Save Workspaces

func (*Workspace) SetActiveService added in v0.1.18

func (workspace *Workspace) SetActiveService(ctx context.Context, projectName string, applicationName string, serviceName string) error

func (*Workspace) SetApplicationActive added in v0.1.38

func (workspace *Workspace) SetApplicationActive(ctx context.Context, project string, name string) error

func (*Workspace) SetProjectActive added in v0.0.51

func (workspace *Workspace) SetProjectActive(ctx context.Context, project string) error

SetProjectActive sets the active project

func (*Workspace) Unique added in v0.0.55

func (workspace *Workspace) Unique() string

type WrapperSwagger added in v0.1.14

type WrapperSwagger struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL