Documentation ¶
Index ¶
- type Connector
- type ConnectorImpl
- func (c *ConnectorImpl) ExposeService(name string, port int, remoteAddr string, destAddr string, direction string) (string, error)
- func (c *ConnectorImpl) GenerateLeafCert(rootKey, rootCA string, host, ips []string, dir string) (*types.CertBundle, error)
- func (c *ConnectorImpl) GenerateLocalCertBundle(out string) (*types.CertBundle, error)
- func (c *ConnectorImpl) GetLocalCertBundle(dir string) (*types.CertBundle, error)
- func (c *ConnectorImpl) IsRunning() bool
- func (c *ConnectorImpl) ListServices() ([]*shipyard.Service, error)
- func (c *ConnectorImpl) RemoveService(id string) error
- func (c *ConnectorImpl) Start(cb *types.CertBundle) error
- func (c *ConnectorImpl) Stop() error
- type ConnectorOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector interface { // Start the Connector, returns an error on failure Start(*types.CertBundle) error // Stop the Connector, returns an error on failure Stop() error // IsRunning returns true when the Connector is running IsRunning() bool // GenerateLocalCertBundle generates a root CA and leaf certificate for // securing connector communications for the local instance // this function is a convenience function which wraps other // methods GenerateLocalCertBundle(out string) (*types.CertBundle, error) // Fetches the local certificate bundle from the given directory // if any of the required files do not exist an error and a nil // CertBundle will be returned GetLocalCertBundle(dir string) (*types.CertBundle, error) // Generates a Leaf certificate for securing a connector GenerateLeafCert( privateKey, rootCA string, hosts, ips []string, dir string) (*types.CertBundle, error) // ExposeService allows you to expose a local or remote // service with another connector ExposeService( name string, port int, remoteAddr string, destAddr string, direction string, ) (string, error) // RemoveService removes a previously exposed service RemoveService(id string) error // ListServices returns a slice of active services ListServices() ([]*shipyard.Service, error) }
func NewConnector ¶
func NewConnector(opts ConnectorOptions) Connector
NewConnector creates a new connector with the given options
type ConnectorImpl ¶
type ConnectorImpl struct {
// contains filtered or unexported fields
}
ConnectorImpl is a concrete implementation of the Connector interface
func (*ConnectorImpl) ExposeService ¶
func (c *ConnectorImpl) ExposeService( name string, port int, remoteAddr string, destAddr string, direction string, ) (string, error)
ExposeService allows you to expose a local or remote service with another connector
func (*ConnectorImpl) GenerateLeafCert ¶
func (c *ConnectorImpl) GenerateLeafCert( rootKey, rootCA string, host, ips []string, dir string) (*types.CertBundle, error)
GenerateLeafCert generates a x509 leaf certificate with the given details
func (*ConnectorImpl) GenerateLocalCertBundle ¶
func (c *ConnectorImpl) GenerateLocalCertBundle(out string) (*types.CertBundle, error)
creates a CA and local leaf cert
func (*ConnectorImpl) GetLocalCertBundle ¶
func (c *ConnectorImpl) GetLocalCertBundle(dir string) (*types.CertBundle, error)
func (*ConnectorImpl) IsRunning ¶
func (c *ConnectorImpl) IsRunning() bool
IsRunning returns true when the Connector is running
func (*ConnectorImpl) ListServices ¶
func (c *ConnectorImpl) ListServices() ([]*shipyard.Service, error)
ListServices lists all active services
func (*ConnectorImpl) RemoveService ¶
func (c *ConnectorImpl) RemoveService(id string) error
RemoveService removes a previously exposed service
func (*ConnectorImpl) Start ¶
func (c *ConnectorImpl) Start(cb *types.CertBundle) error
Start the Connector, returns an error on failure
func (*ConnectorImpl) Stop ¶
func (c *ConnectorImpl) Stop() error
Stop the Connector, returns an error on failure
type ConnectorOptions ¶
type ConnectorOptions struct { LogDirectory string BinaryPath string GrpcBind string HTTPBind string APIBind string LogLevel string PidFile string }
func DefaultConnectorOptions ¶
func DefaultConnectorOptions() ConnectorOptions
Click to show internal directories.
Click to hide internal directories.