Documentation
¶
Index ¶
- func New(c Config, opts ...Option) (*gNMIServer, error)
- func WithCapabilitiesHandler(h CapabilitiesHandler) func(*gNMIServer)
- func WithGetHandler(h GetHandler) func(*gNMIServer)
- func WithLogger(l *log.Logger) func(*gNMIServer)
- func WithRegistry(reg *prometheus.Registry) func(*gNMIServer)
- func WithSetHandler(h SetHandler) func(*gNMIServer)
- func WithSubscribeHandler(h SubscribeHandler) func(*gNMIServer)
- type CapabilitiesHandler
- type Config
- type GetHandler
- type Option
- type SetHandler
- type SubscribeHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCapabilitiesHandler ¶
func WithCapabilitiesHandler(h CapabilitiesHandler) func(*gNMIServer)
func WithGetHandler ¶
func WithGetHandler(h GetHandler) func(*gNMIServer)
func WithRegistry ¶
func WithRegistry(reg *prometheus.Registry) func(*gNMIServer)
func WithSetHandler ¶
func WithSetHandler(h SetHandler) func(*gNMIServer)
func WithSubscribeHandler ¶
func WithSubscribeHandler(h SubscribeHandler) func(*gNMIServer)
Types ¶
type CapabilitiesHandler ¶
type CapabilitiesHandler func(ctx context.Context, req *gnmi.CapabilityRequest) (*gnmi.CapabilityResponse, error)
gNMI Handlers
type Config ¶
type Config struct {
// gRPC server address
Address string
// MaxUnaryRPC defines the max number of inflight
// Unary RPCs (Cap, Get, Set,...).
// if negative or unset, there is not limit.
MaxUnaryRPC int64
// MaxStreamingRPC defines the max number of inflight
// streaming RPCs (Subscribe,...).
// if negative or unset, there is not limit.
MaxStreamingRPC int64
// MaxRecvMsgSize defines the max message
// size in bytes the server can receive.
// If this is not set, it defaults to 4MB.
MaxRecvMsgSize int
// MaxSendMsgSize defines the the max message
// size in bytes the server can send.
// If this is not set, the default is `math.MaxInt32`.
MaxSendMsgSize int
// MaxConcurrentStreams defines the max number of
// concurrent streams to each ServerTransport.
MaxConcurrentStreams uint32
// TCPKeepalive set the TCP keepalive time and
// interval, if unset it is enabled based on
// the protocol used and the OS.
// If negative it is disabled.
TCPKeepalive time.Duration
// Keepalive params
Keepalive *keepalive.ServerParameters
// enable gRPC Health RPCs
HealthEnabled bool
// unary RPC request timeout
Timeout time.Duration
// RPCs rate limit
RateLimit int64
// TLS config
TLS *types.TLSConfig
}
type GetHandler ¶
type GetHandler func(ctx context.Context, req *gnmi.GetRequest) (*gnmi.GetResponse, error)
type SetHandler ¶
type SetHandler func(ctx context.Context, req *gnmi.SetRequest) (*gnmi.SetResponse, error)
type SubscribeHandler ¶
type SubscribeHandler func(req *gnmi.SubscribeRequest, stream gnmi.GNMI_SubscribeServer) error
Click to show internal directories.
Click to hide internal directories.