Documentation ¶
Index ¶
- func ExtractEndpointEnvironmentVariables(ctx context.Context, nets []*runtimev0.NetworkMapping) ([]string, error)
- func ExtractRestRoutesEnvironmentVariables(ctx context.Context, nets []*runtimev0.NetworkMapping) ([]string, error)
- func GetFreePorts(n int) ([]int, error)
- func LocalizeMapping(mapping *runtimev0.NetworkMapping, local string) *runtimev0.NetworkMapping
- func LocalizeMappings(nm []*runtimev0.NetworkMapping, local string) []*runtimev0.NetworkMapping
- func MappingAsString(mapping *runtimev0.NetworkMapping) string
- func ToDNS(e *basev0.Endpoint) string
- func ToEndpoint(endpoint *basev0.Endpoint) *configurations.Endpoint
- func ToUnique(endpoint *basev0.Endpoint) string
- type Address
- type ApplicationEndpoint
- type ApplicationEndpointInstance
- type ApplicationEndpointInstances
- type DNS
- type FixedStrategy
- type MappingInstance
- type MappingSummary
- type RandomStrategy
- type ServiceManager
- func (pm *ServiceManager) ApplicationEndpointInstance(ctx context.Context, endpoint *basev0.Endpoint) (*ApplicationEndpointInstance, error)
- func (pm *ServiceManager) ApplicationEndpointInstances() []*ApplicationEndpointInstance
- func (pm *ServiceManager) Bind(ctx context.Context, endpoint *basev0.Endpoint, portBinding string) error
- func (pm *ServiceManager) Expose(endpoint *basev0.Endpoint) error
- func (pm *ServiceManager) NetworkMapping(context.Context) ([]*runtimev0.NetworkMapping, error)
- func (pm *ServiceManager) Port(ctx context.Context, endpoint *basev0.Endpoint) (int, error)
- func (pm *ServiceManager) Reserve(ctx context.Context) error
- type Strategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractEndpointEnvironmentVariables ¶ added in v0.1.18
func ExtractEndpointEnvironmentVariables(ctx context.Context, nets []*runtimev0.NetworkMapping) ([]string, error)
ExtractEndpointEnvironmentVariables converts NetworkMapping endpoint data to environment variables
func ExtractRestRoutesEnvironmentVariables ¶ added in v0.1.18
func ExtractRestRoutesEnvironmentVariables(ctx context.Context, nets []*runtimev0.NetworkMapping) ([]string, error)
ExtractRestRoutesEnvironmentVariables converts NetworkMapping endpoint REST data to environment variables
func GetFreePorts ¶
GetFreePorts returns a slice of n free ports
func LocalizeMapping ¶ added in v0.0.91
func LocalizeMapping(mapping *runtimev0.NetworkMapping, local string) *runtimev0.NetworkMapping
func LocalizeMappings ¶ added in v0.0.91
func LocalizeMappings(nm []*runtimev0.NetworkMapping, local string) []*runtimev0.NetworkMapping
func MappingAsString ¶ added in v0.0.81
func MappingAsString(mapping *runtimev0.NetworkMapping) string
func ToEndpoint ¶
func ToEndpoint(endpoint *basev0.Endpoint) *configurations.Endpoint
Types ¶
type ApplicationEndpoint ¶
type ApplicationEndpoint struct { Service string Application string Namespace string Endpoint *basev0.Endpoint PortBinding string // something like 8080/tcp }
An ApplicationEndpoint takes a service Endpoint and embed it so it can be used across the applications
func (ApplicationEndpoint) Clone ¶
func (e ApplicationEndpoint) Clone() ApplicationEndpoint
func (ApplicationEndpoint) Unique ¶
func (e ApplicationEndpoint) Unique() string
type ApplicationEndpointInstance ¶
type ApplicationEndpointInstance struct { ApplicationEndpoint *ApplicationEndpoint Port int Host string }
An ApplicationEndpointInstance is an instance of an ApplicationEndpoint
func (*ApplicationEndpointInstance) Address ¶
func (m *ApplicationEndpointInstance) Address() string
func (*ApplicationEndpointInstance) Name ¶
func (m *ApplicationEndpointInstance) Name() string
func (*ApplicationEndpointInstance) StringPort ¶
func (m *ApplicationEndpointInstance) StringPort() string
type ApplicationEndpointInstances ¶
type ApplicationEndpointInstances struct {
ApplicationEndpointInstances []*ApplicationEndpointInstance
}
func (*ApplicationEndpointInstances) Address ¶
func (pm *ApplicationEndpointInstances) Address(endpoint *basev0.Endpoint) *Address
func (*ApplicationEndpointInstances) First ¶
func (pm *ApplicationEndpointInstances) First() *ApplicationEndpointInstance
type DNS ¶
type DNS struct{}
func (DNS) Reserve ¶
func (r DNS) Reserve(_ context.Context, _ string, es []*ApplicationEndpoint) (*ApplicationEndpointInstances, error)
type FixedStrategy ¶
type FixedStrategy struct{}
func (FixedStrategy) Reserve ¶
func (r FixedStrategy) Reserve(_ context.Context, host string, endpoints []*ApplicationEndpoint) (*ApplicationEndpointInstances, error)
type MappingInstance ¶ added in v0.1.16
func Instance ¶ added in v0.1.16
func Instance(mappings []*runtimev0.NetworkMapping) (*MappingInstance, error)
type MappingSummary ¶ added in v0.0.81
func MakeNetworkMappingSummary ¶ added in v0.0.81
func MakeNetworkMappingSummary(mappings []*runtimev0.NetworkMapping) MappingSummary
type RandomStrategy ¶
type RandomStrategy struct{}
func (RandomStrategy) Reserve ¶
func (r RandomStrategy) Reserve(ctx context.Context, host string, endpoints []*ApplicationEndpoint) (*ApplicationEndpointInstances, error)
type ServiceManager ¶
type ServiceManager struct {
// contains filtered or unexported fields
}
A ServiceManager helps go from a service to applications endpoint instances
func NewServiceDNSManager ¶ added in v0.0.51
func NewServiceManager ¶
func NewServiceManager(endpoints ...*basev0.Endpoint) *ServiceManager
func NewServicePortManager ¶
func NewServicePortManager(_ context.Context) (*ServiceManager, error)
func (*ServiceManager) ApplicationEndpointInstance ¶
func (pm *ServiceManager) ApplicationEndpointInstance(ctx context.Context, endpoint *basev0.Endpoint) (*ApplicationEndpointInstance, error)
func (*ServiceManager) ApplicationEndpointInstances ¶
func (pm *ServiceManager) ApplicationEndpointInstances() []*ApplicationEndpointInstance
func (*ServiceManager) NetworkMapping ¶
func (pm *ServiceManager) NetworkMapping(context.Context) ([]*runtimev0.NetworkMapping, error)
NetworkMapping returns the network mapping for the service to be passed back to codefly
type Strategy ¶
type Strategy interface {
Reserve(ctx context.Context, host string, endpoints []*ApplicationEndpoint) (*ApplicationEndpointInstances, error)
}
Click to show internal directories.
Click to hide internal directories.