Documentation ¶
Index ¶
- func ConvertToEnvironmentVariables(nets []*runtimev1.NetworkMapping) ([]string, error)
- func GetFreePorts(n int) ([]int, error)
- func ToDns(e *basev1.Endpoint) string
- func ToEndpoint(endpoint *basev1.Endpoint) *configurations.Endpoint
- func ToUnique(endpoint *basev1.Endpoint) string
- type Address
- type ApplicationEndpoint
- type ApplicationEndpointInstance
- type ApplicationEndpointInstances
- type DNS
- type FixedStrategy
- type RandomStrategy
- type ServiceManager
- func NewServiceDnsManager(ctx context.Context, identity *servicev1.ServiceIdentity, ...) (*ServiceManager, error)
- func NewServiceManager(identity *servicev1.ServiceIdentity, endpoints ...*basev1.Endpoint) *ServiceManager
- func NewServicePortManager(ctx context.Context, identity *servicev1.ServiceIdentity, ...) (*ServiceManager, error)
- func (pm *ServiceManager) ApplicationEndpointInstance(endpoint *basev1.Endpoint) (*ApplicationEndpointInstance, error)
- func (pm *ServiceManager) ApplicationEndpointInstances() []*ApplicationEndpointInstance
- func (pm *ServiceManager) Bind(endpoint *basev1.Endpoint, portBinding string) error
- func (pm *ServiceManager) Expose(endpoint *basev1.Endpoint) error
- func (pm *ServiceManager) NetworkMapping() ([]*runtimev1.NetworkMapping, error)
- func (pm *ServiceManager) Port(endpoint *basev1.Endpoint) (int, error)
- func (pm *ServiceManager) Reserve() error
- type Strategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToEnvironmentVariables ¶
func ConvertToEnvironmentVariables(nets []*runtimev1.NetworkMapping) ([]string, error)
ConvertToEnvironmentVariables converts NetworkMapping to environment variables
func GetFreePorts ¶
GetFreePorts returns a slice of n free ports
func ToEndpoint ¶
func ToEndpoint(endpoint *basev1.Endpoint) *configurations.Endpoint
Types ¶
type ApplicationEndpoint ¶
type ApplicationEndpoint struct { Service string Application string Namespace string Endpoint *basev1.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 *basev1.Endpoint) *Address
func (*ApplicationEndpointInstances) First ¶
func (pm *ApplicationEndpointInstances) First() *ApplicationEndpointInstance
type DNS ¶
type DNS struct{}
func (DNS) Reserve ¶
func (r DNS) Reserve(_ string, es []ApplicationEndpoint) (*ApplicationEndpointInstances, error)
type FixedStrategy ¶
type FixedStrategy struct{}
func (FixedStrategy) Reserve ¶
func (r FixedStrategy) Reserve(host string, endpoints []ApplicationEndpoint) (*ApplicationEndpointInstances, error)
type RandomStrategy ¶
type RandomStrategy struct{}
func (RandomStrategy) Reserve ¶
func (r RandomStrategy) Reserve(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 ¶
func NewServiceDnsManager(ctx context.Context, identity *servicev1.ServiceIdentity, endpoints ...*basev1.Endpoint) (*ServiceManager, error)
func NewServiceManager ¶
func NewServiceManager(identity *servicev1.ServiceIdentity, endpoints ...*basev1.Endpoint) *ServiceManager
func NewServicePortManager ¶
func NewServicePortManager(ctx context.Context, identity *servicev1.ServiceIdentity, endpoints ...*basev1.Endpoint) (*ServiceManager, error)
func (*ServiceManager) ApplicationEndpointInstance ¶
func (pm *ServiceManager) ApplicationEndpointInstance(endpoint *basev1.Endpoint) (*ApplicationEndpointInstance, error)
func (*ServiceManager) ApplicationEndpointInstances ¶
func (pm *ServiceManager) ApplicationEndpointInstances() []*ApplicationEndpointInstance
func (*ServiceManager) Bind ¶
func (pm *ServiceManager) Bind(endpoint *basev1.Endpoint, portBinding string) error
func (*ServiceManager) NetworkMapping ¶
func (pm *ServiceManager) NetworkMapping() ([]*runtimev1.NetworkMapping, error)
NetworkMapping returns the network mapping for the service to be passed back to codefly
func (*ServiceManager) Port ¶
func (pm *ServiceManager) Port(endpoint *basev1.Endpoint) (int, error)
func (*ServiceManager) Reserve ¶
func (pm *ServiceManager) Reserve() error
type Strategy ¶
type Strategy interface {
Reserve(host string, endpoints []ApplicationEndpoint) (*ApplicationEndpointInstances, error)
}
Click to show internal directories.
Click to hide internal directories.