Documentation ¶
Index ¶
- Constants
- func CACredentials(ctx context.Context) *ome.ProxyCredentials
- func CMD(use string, box *Box) *cobra.Command
- func Connect(ctx context.Context, ofType uint32, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func ConnectToSpecificService(ctx context.Context, serviceID string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func ConnectToSpecificServiceNode(ctx context.Context, serviceID, nodeName string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func ContextWithBox(ctx context.Context, b *Box) context.Context
- func Dial(ctx context.Context, st uint32) (*grpc.ClientConn, error)
- func GRPCCallOptionsFromContext(ctx context.Context, ot ...GRPCCallOption) ([]grpc.CallOption, error)
- func GetCACertificate(ctx context.Context) *x509.Certificate
- func GetCertificate(ctx context.Context) *x509.Certificate
- func GetClientTLSConfig(ctx context.Context) (*tls.Config, error)
- func GetDir(ctx context.Context) string
- func GetGatewayAddress(ctx context.Context, name string) string
- func GetID(ctx context.Context) string
- func GetName(ctx context.Context) string
- func GetPrivateKey(ctx context.Context) crypto.PrivateKey
- func GetRegistry(ctx context.Context) ome.Registry
- func GetSecret(ctx context.Context) string
- func JWT(verifier ome.TokenVerifier) *authorizationJWT
- func NewDialer(addr string, opts ...grpc.DialOption) *dialer
- func NewJwtVerifier(tlsConfig *tls.Config, registry ome.Registry, store JwtInfoStore) ome.TokenVerifier
- func NewSyncedStore(serverAddress string, tls *tls.Config, store JwtInfoStore) *synchronizedStore
- func Oauth2(verifier ome.TokenVerifier, codecs ...securecookie.Codec) *authorizationBearer
- func ProxyAuthenticationMiddleware(next http.Handler) http.Handler
- func SetCMDFlags(cmd *cobra.Command, box *Box, ignoreFlagName bool)
- type Box
- func (box *Box) AllServices() []*ome.ServiceInfo
- func (box *Box) Connect(ofType uint32, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func (box *Box) ConnectToSpecificService(serviceID string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func (box *Box) ConnectToSpecificServiceNode(serviceID, nodeName string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func (box *Box) DeleteNode(serviceType uint32, serviceID string, nodeID string) (*ome.ServiceInfo, bool)
- func (box *Box) GRPCConnectionDialer(serviceType uint32, opts ...grpc.DialOption) (Dialer, error)
- func (box *Box) SaveNode(serviceType uint32, serviceID string, node *ome.Node) *ome.ServiceInfo
- func (box *Box) SaveService(serviceType uint32, info *ome.ServiceInfo)
- func (box *Box) Service(serviceType uint32) *ome.ServiceInfo
- func (box *Box) ServiceAddress(name string) (string, error)
- func (box *Box) ServiceNode(serviceType uint32, name string) *ome.Node
- func (box *Box) SpecificServiceConnectionDialer(serviceID string, opts ...grpc.DialOption) (Dialer, error)
- func (box *Box) SpecificServiceNodeConnectionDialer(serviceID string, nodeName string, opts ...grpc.DialOption) (Dialer, error)
- func (box *Box) StartHTTPGateway(params *HTTPGatewayParams, nOpts ...NodeOption) error
- func (box *Box) StartHTTPServer(params *HTTPServerParams, nOpts ...NodeOption) error
- func (box *Box) StartNode(params *NodeParams, nOpts ...NodeOption) error
- func (box *Box) StartNodeGateway(params *NodeGatewayParams, nOpts ...NodeOption) error
- func (box *Box) StartPublicNodeGateway(params *PublicNodeGatewayParams, nOpts ...NodeOption) error
- func (box *Box) Stop()
- func (box *Box) StopNode(name string)
- func (box *Box) Update(opts ...Option)
- type Dialer
- func GRPCConnectionDialer(ctx context.Context, serviceType uint32, opts ...grpc.DialOption) (Dialer, error)
- func SpecificServiceConnectionDialer(ctx context.Context, serviceID string, opts ...grpc.DialOption) (Dialer, error)
- func SpecificServiceNodeConnectionDialer(ctx context.Context, serviceID string, nodeName string, ...) (Dialer, error)
- type GRPCCallOption
- type HTTPGatewayParams
- type HTTPServerParams
- type JwtInfoStore
- type MD
- type Mapper
- type MuxWrapper
- type NodeGatewayParams
- type NodeOption
- type NodeParams
- type Option
- func CAAddr(addr string) Option
- func CAApiKey(apiKey string) Option
- func CAApiSecret(apiSecret string) Option
- func CACert(cert *x509.Certificate) Option
- func CACertFile(filename string) Option
- func CAKey(key crypto.PrivateKey) Option
- func CAKeyFIle(filename string) Option
- func Cert(cert *x509.Certificate) Option
- func CertFile(filename string) Option
- func Dir(dirname string) Option
- func Domain(domain string, others ...string) Option
- func ExternalIp(ip string) Option
- func Ip(ip string) Option
- func Key(key crypto.PrivateKey) Option
- func KeyFIle(filename string) Option
- func Log(Filename string) Option
- func Name(name string) Option
- func RegAddr(addr string) Option
- func RegApiKey(apiKey string) Option
- func RegApiSecret(apiSecret string) Option
- func Registry(reg ome.Registry) Option
- type Options
- func (opts *Options) BindIP() string
- func (opts *Options) CACertificate() *x509.Certificate
- func (opts *Options) CertificateFilename() string
- func (opts *Options) ClientMutualTLS() (*tls.Config, error)
- func (opts *Options) ClientTLS() (*tls.Config, error)
- func (opts *Options) Dir() string
- func (opts *Options) Domain() string
- func (opts *Options) Domains() []string
- func (opts *Options) ExternalIP() string
- func (opts *Options) Host() string
- func (opts *Options) IP() string
- func (opts *Options) IpList() []string
- func (opts *Options) KeyFilename() string
- func (opts *Options) Name() string
- func (opts *Options) Registry() (ome.Registry, error)
- func (opts *Options) ServerTLS() (*tls.Config, error)
- func (opts *Options) ServiceCert() *x509.Certificate
- func (opts *Options) ServiceKey() crypto.PrivateKey
- func (opts *Options) StartRegistryServer(opt ...Option) (err error)
- func (opts *Options) StopRegistry() error
- type PublicNodeGatewayParams
- type WireEndpointFunc
Constants ¶
View Source
const ( CmdFlagIP = "ip" CmdFlagExternalIP = "eip" CmdFlagName = "name" CmdFlagServiceDomain = "dn" CmdFlagAdditionalDomains = "odn" CmdFlagCert = "cert" CmdFlagKey = "key" CmdFlagCAAddr = "ca-addr" CmdFlagCACert = "ca-cert" CmdFlagCAApiKey = "ca-api-key" CmdFlagCAApiSecret = "ca-api-secret" CmdFlagRegistry = "reg" )
Variables ¶
This section is empty.
Functions ¶
func CACredentials ¶
func Connect ¶
func Connect(ctx context.Context, ofType uint32, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func ConnectToSpecificService ¶
func ConnectToSpecificService(ctx context.Context, serviceID string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func ConnectToSpecificServiceNode ¶
func ConnectToSpecificServiceNode(ctx context.Context, serviceID, nodeName string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func GRPCCallOptionsFromContext ¶
func GRPCCallOptionsFromContext(ctx context.Context, ot ...GRPCCallOption) ([]grpc.CallOption, error)
func GetCACertificate ¶
func GetCACertificate(ctx context.Context) *x509.Certificate
func GetCertificate ¶
func GetCertificate(ctx context.Context) *x509.Certificate
func GetPrivateKey ¶
func GetPrivateKey(ctx context.Context) crypto.PrivateKey
func GetRegistry ¶
func NewDialer ¶
func NewDialer(addr string, opts ...grpc.DialOption) *dialer
func NewJwtVerifier ¶
func NewJwtVerifier(tlsConfig *tls.Config, registry ome.Registry, store JwtInfoStore) ome.TokenVerifier
func NewSyncedStore ¶
func NewSyncedStore(serverAddress string, tls *tls.Config, store JwtInfoStore) *synchronizedStore
func Oauth2 ¶
func Oauth2(verifier ome.TokenVerifier, codecs ...securecookie.Codec) *authorizationBearer
Types ¶
type Box ¶
type Box struct { *Options // contains filtered or unexported fields }
func BoxFromContext ¶
func (*Box) AllServices ¶
func (box *Box) AllServices() []*ome.ServiceInfo
func (*Box) Connect ¶
func (box *Box) Connect(ofType uint32, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func (*Box) ConnectToSpecificService ¶
func (box *Box) ConnectToSpecificService(serviceID string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func (*Box) ConnectToSpecificServiceNode ¶
func (box *Box) ConnectToSpecificServiceNode(serviceID, nodeName string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func (*Box) DeleteNode ¶
func (*Box) GRPCConnectionDialer ¶
func (*Box) SaveService ¶
func (*Box) ServiceNode ¶
func (*Box) SpecificServiceConnectionDialer ¶
func (*Box) SpecificServiceNodeConnectionDialer ¶
func (*Box) StartHTTPGateway ¶
func (box *Box) StartHTTPGateway(params *HTTPGatewayParams, nOpts ...NodeOption) error
func (*Box) StartHTTPServer ¶
func (box *Box) StartHTTPServer(params *HTTPServerParams, nOpts ...NodeOption) error
func (*Box) StartNode ¶
func (box *Box) StartNode(params *NodeParams, nOpts ...NodeOption) error
func (*Box) StartNodeGateway ¶
func (box *Box) StartNodeGateway(params *NodeGatewayParams, nOpts ...NodeOption) error
func (*Box) StartPublicNodeGateway ¶
func (box *Box) StartPublicNodeGateway(params *PublicNodeGatewayParams, nOpts ...NodeOption) error
type Dialer ¶
type Dialer interface {
Dial() (*grpc.ClientConn, error)
}
func GRPCConnectionDialer ¶
type GRPCCallOption ¶
type GRPCCallOption int
const ( CallOptToken GRPCCallOption = iota + 1 CallOptProxyCredentials )
type HTTPGatewayParams ¶
type HTTPServerParams ¶
type JwtInfoStore ¶
type JwtInfoStore interface { Save(serviceName string, info *ome.JwtInfo) error Get(jti string) (*ome.JwtInfo, error) Delete(jti string) error DeleteAllFromService(serviceName string) error Clear() error }
func NewMemInfoStore ¶
func NewMemInfoStore() JwtInfoStore
type NodeGatewayParams ¶
type NodeGatewayParams struct { ServiceName string TargetNodeName string NodeName string ServiceType uint32 ServiceID string Security ome.Security Binder WireEndpointFunc MuxWrapper MuxWrapper Meta MD }
type NodeOption ¶
type NodeOption func(options *nodeOptions)
func GlobalOptions ¶
func GlobalOptions(opts ...Option) NodeOption
func Register ¶
func Register(register bool) NodeOption
func WithInterceptor ¶
func WithInterceptor(interceptors ...ome.GrpcContextUpdater) NodeOption
func WithMeta ¶
func WithMeta(m MD) NodeOption
func WithPort ¶
func WithPort(port int) NodeOption
func WithTLS ¶
func WithTLS(t *tls.Config) NodeOption
type NodeParams ¶
type Option ¶
type Option func(*Options)
Option is an Options object handler function
func CAApiSecret ¶
func CACert ¶
func CACert(cert *x509.Certificate) Option
func CACertFile ¶
func CAKey ¶
func CAKey(key crypto.PrivateKey) Option
func Cert ¶
func Cert(cert *x509.Certificate) Option
func ExternalIp ¶
func Key ¶
func Key(key crypto.PrivateKey) Option
func RegApiSecret ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func (*Options) CACertificate ¶
func (opts *Options) CACertificate() *x509.Certificate
func (*Options) CertificateFilename ¶
func (*Options) ExternalIP ¶
func (*Options) KeyFilename ¶
func (*Options) ServiceCert ¶
func (opts *Options) ServiceCert() *x509.Certificate
func (*Options) ServiceKey ¶
func (opts *Options) ServiceKey() crypto.PrivateKey
func (*Options) StartRegistryServer ¶
func (*Options) StopRegistry ¶
type PublicNodeGatewayParams ¶
type PublicNodeGatewayParams struct { ServiceName string TargetNodeName string NodeName string ServiceType uint32 ServiceID string Email string Binder WireEndpointFunc MuxWrapper MuxWrapper Meta MD }
type WireEndpointFunc ¶
Click to show internal directories.
Click to hide internal directories.