Documentation ¶
Overview ¶
Package rkgrpc an implementation of rkentry.Entry which could be used start restful server with grpc framework
Experimental. This is used as grpc proxy server which forwarding grpc request to backend grpc server if not implemented. Currently, grpc-gateway and grpcurl is not supported. The grpc client called from code is supported.
Index ¶
- Constants
- func Codec() encoding.Codec
- func CodecWithFallback(fallback encoding.Codec) encoding.Codec
- func HttpErrorHandler(ctx context.Context, mux *runtime.ServeMux, marshaler runtime.Marshaler, ...)
- func IncomingHeaderMatcher(key string) (string, bool)
- func NewRkGwServerMuxOptions(mOptIn *protojson.MarshalOptions, uOptIn *protojson.UnmarshalOptions) []runtime.ServeMuxOption
- func NewRule(opts ...ruleOption) *rule
- func OutgoingHeaderMatcher(key string) (string, bool)
- func RegisterGrpcEntryYAML(raw []byte) map[string]rkentry.Entry
- func ToAllowOriginFunc(allowOrigins []string) grpcweb.Option
- func ToGrpcWebOptions(conf *BootConfigGrpcWeb) []grpcweb.Option
- func TransparentHandler(director Director) grpc.StreamHandler
- func WithHeaderPatterns(pattern ...*HeaderPattern) ruleOption
- func WithIpPatterns(pattern ...*IpPattern) ruleOption
- func WithPathPatterns(pattern ...*PathPattern) ruleOption
- type BootConfig
- type BootConfigGrpcWeb
- type BootConfigProxy
- type Director
- type GrpcEntry
- func (entry *GrpcEntry) AddGwCorsOptions(opts ...rkmidcors.Option)
- func (entry *GrpcEntry) AddGwCsrfOptions(opts ...rkmidcsrf.Option)
- func (entry *GrpcEntry) AddGwDialOptions(opts ...grpc.DialOption)
- func (entry *GrpcEntry) AddGwMuxOptions(opts ...gwruntime.ServeMuxOption)
- func (entry *GrpcEntry) AddGwSecureOptions(opts ...rkmidsec.Option)
- func (entry *GrpcEntry) AddRegFuncGrpc(f ...GrpcRegFunc)
- func (entry *GrpcEntry) AddRegFuncGw(f ...GwRegFunc)
- func (entry *GrpcEntry) AddServerOptions(opts ...grpc.ServerOption)
- func (entry *GrpcEntry) AddStreamInterceptors(inter ...grpc.StreamServerInterceptor)
- func (entry *GrpcEntry) AddUnaryInterceptors(inter ...grpc.UnaryServerInterceptor)
- func (entry *GrpcEntry) Bootstrap(ctx context.Context)
- func (entry *GrpcEntry) GetDescription() string
- func (entry *GrpcEntry) GetName() string
- func (entry *GrpcEntry) GetType() string
- func (entry *GrpcEntry) Interrupt(ctx context.Context)
- func (entry *GrpcEntry) IsCommonServiceEnabled() bool
- func (entry *GrpcEntry) IsDocsEnabled() bool
- func (entry *GrpcEntry) IsGrpcWebEnabled() bool
- func (entry *GrpcEntry) IsPProfEnabled() bool
- func (entry *GrpcEntry) IsPromEnabled() bool
- func (entry *GrpcEntry) IsProxyEnabled() bool
- func (entry *GrpcEntry) IsSWEnabled() bool
- func (entry *GrpcEntry) IsStaticFileHandlerEnabled() bool
- func (entry *GrpcEntry) IsTlsEnabled() bool
- func (entry *GrpcEntry) MarshalJSON() ([]byte, error)
- func (entry *GrpcEntry) String() string
- func (entry *GrpcEntry) UnmarshalJSON([]byte) error
- type GrpcEntryOption
- func WithCertEntry(certEntry *rkentry.CertEntry) GrpcEntryOption
- func WithCommonServiceEntry(commonService *rkentry.CommonServiceEntry) GrpcEntryOption
- func WithDescription(description string) GrpcEntryOption
- func WithDocsEntry(docs *rkentry.DocsEntry) GrpcEntryOption
- func WithEnableReflection(enabled bool) GrpcEntryOption
- func WithEventEntry(logger *rkentry.EventEntry) GrpcEntryOption
- func WithGrpcDialOptions(opts ...grpc.DialOption) GrpcEntryOption
- func WithGrpcRegF(f ...GrpcRegFunc) GrpcEntryOption
- func WithGrpcWebOptions(opts ...grpcweb.Option) GrpcEntryOption
- func WithGwMuxOptions(opts ...gwruntime.ServeMuxOption) GrpcEntryOption
- func WithGwPort(gwPort uint64) GrpcEntryOption
- func WithGwRegF(f ...GwRegFunc) GrpcEntryOption
- func WithLoggerEntry(logger *rkentry.LoggerEntry) GrpcEntryOption
- func WithName(name string) GrpcEntryOption
- func WithPProfEntry(p *rkentry.PProfEntry) GrpcEntryOption
- func WithPort(port uint64) GrpcEntryOption
- func WithPromEntry(prom *rkentry.PromEntry) GrpcEntryOption
- func WithProxyEntry(proxy *ProxyEntry) GrpcEntryOption
- func WithServerOptions(opts ...grpc.ServerOption) GrpcEntryOption
- func WithStaticFileHandlerEntry(staticEntry *rkentry.StaticFileHandlerEntry) GrpcEntryOption
- func WithStreamInterceptors(opts ...grpc.StreamServerInterceptor) GrpcEntryOption
- func WithSwEntry(sw *rkentry.SWEntry) GrpcEntryOption
- func WithUnaryInterceptors(opts ...grpc.UnaryServerInterceptor) GrpcEntryOption
- type GrpcRegFunc
- type GwRegFunc
- type HeaderPattern
- type IpPattern
- type PathPattern
- type ProxyEntry
- func (entry *ProxyEntry) Bootstrap(ctx context.Context)
- func (entry *ProxyEntry) GetDescription() string
- func (entry *ProxyEntry) GetName() string
- func (entry *ProxyEntry) GetType() string
- func (entry *ProxyEntry) Interrupt(ctx context.Context)
- func (entry *ProxyEntry) MarshalJSON() ([]byte, error)
- func (entry *ProxyEntry) String() string
- func (entry *ProxyEntry) UnmarshalJSON(b []byte) error
- type ProxyEntryOption
Constants ¶
const ( // ProxyEntryType default entry type ProxyEntryType = "ProxyEntry" // ProxyEntryNameDefault default entry name ProxyEntryNameDefault = "ProxyDefault" // HeaderBased header based proxy pattern HeaderBased = "headerBased" // PathBased grpc path(method) based proxy pattern PathBased = "pathBased" // IpBased remote IP based proxy pattern IpBased = "ipBased" )
const (
// GrpcEntryType default entry type
GrpcEntryType = "gRPCEntry"
)
Variables ¶
This section is empty.
Functions ¶
func Codec ¶
Codec returns a proxying grpc.Codec with the default protobuf codec as parent.
See CodecWithParent.
func CodecWithFallback ¶
CodecWithFallback returns a proxying grpc.Codec with a user provided codec as parent.
This codec is *crucial* to the functioning of the proxy. It allows the proxy server to be oblivious to the schema of the forwarded messages. It basically treats a gRPC message frame as raw bytes. However, if the server handler, or the client caller are not proxy-internal functions it will fall back to trying to decode the message using a fallback codec.
func HttpErrorHandler ¶
func HttpErrorHandler(ctx context.Context, mux *runtime.ServeMux, marshaler runtime.Marshaler, w http.ResponseWriter, r *http.Request, err error)
HttpErrorHandler Mainly copies from runtime.DefaultHTTPErrorHandler. We reformat error response with rkerror.ErrorResp.
func IncomingHeaderMatcher ¶
IncomingHeaderMatcher Pass out all metadata in http header to grpc metadata.
func NewRkGwServerMuxOptions ¶
func NewRkGwServerMuxOptions(mOptIn *protojson.MarshalOptions, uOptIn *protojson.UnmarshalOptions) []runtime.ServeMuxOption
NewRkGwServerMuxOptions creates new gw server mux options.
func NewRule ¶
func NewRule(opts ...ruleOption) *rule
NewRule create a new proxy rules with options.
func OutgoingHeaderMatcher ¶
OutgoingHeaderMatcher Pass out all metadata in grpc to http header.
func RegisterGrpcEntryYAML ¶
RegisterGrpcEntryYAML Register grpc entries with provided config file (Must YAML file).
Currently, support two ways to provide config file path. 1: With function parameters 2: With command line flag "--rkboot" described in rkentry.BootConfigPathFlagKey (Will override function parameter if exists) Command line flag has high priority which would override function parameter
Error handling: Process will shutdown if any errors occur with rkentry.ShutdownWithError function
Override elements in config file: We learned from HELM source code which would override elements in YAML file with "--set" flag followed with comma separated key/value pairs.
We are using "--rkset" described in rkentry.BootConfigOverrideKey in order to distinguish with user flags Example of common usage: ./binary_file --rkset "key1=val1,key2=val2" Example of nested map: ./binary_file --rkset "outer.inner.key=val" Example of slice: ./binary_file --rkset "outer[0].key=val"
func ToAllowOriginFunc ¶ added in v2.2.9
func ToGrpcWebOptions ¶ added in v2.2.9
func ToGrpcWebOptions(conf *BootConfigGrpcWeb) []grpcweb.Option
func TransparentHandler ¶
func TransparentHandler(director Director) grpc.StreamHandler
TransparentHandler returns a handler that attempts to proxy all requests that are not registered in the server. The indented use here is as a transparent proxy, where the server doesn't know about the services implemented by the backends. It should be used as a `grpc.UnknownServiceHandler`.
This can *only* be used if the `server` also uses grpcproxy.CodecForServer() ServerOption.
func WithHeaderPatterns ¶
func WithHeaderPatterns(pattern ...*HeaderPattern) ruleOption
WithHeaderPatterns provide header based patterns.
func WithIpPatterns ¶
func WithIpPatterns(pattern ...*IpPattern) ruleOption
WithIpPatterns provide IP based patterns.
func WithPathPatterns ¶
func WithPathPatterns(pattern ...*PathPattern) ruleOption
WithPathPatterns provide path based patterns.
Types ¶
type BootConfig ¶
type BootConfig struct { Grpc []struct { Name string `yaml:"name" json:"name"` Description string `yaml:"description" json:"description"` Port uint64 `yaml:"port" json:"port"` GwPort uint64 `yaml:"gwPort" json:"gwPort"` Enabled bool `yaml:"enabled" json:"enabled"` EnableReflection bool `yaml:"enableReflection" json:"enableReflection"` NoRecvMsgSizeLimit bool `yaml:"noRecvMsgSizeLimit" json:"noRecvMsgSizeLimit"` CommonService rkentry.BootCommonService `yaml:"commonService" json:"commonService"` SW rkentry.BootSW `yaml:"sw" json:"sw"` Docs rkentry.BootDocs `yaml:"docs" json:"docs"` Prom rkentry.BootProm `yaml:"prom" json:"prom"` Static rkentry.BootStaticFileHandler `yaml:"static" json:"static"` Proxy BootConfigProxy `yaml:"proxy" json:"proxy"` GrpcWeb BootConfigGrpcWeb `yaml:"grpcWeb" json:"grpcWeb"` CertEntry string `yaml:"certEntry" json:"certEntry"` LoggerEntry string `yaml:"loggerEntry" json:"loggerEntry"` EventEntry string `yaml:"eventEntry" json:"eventEntry"` PProf rkentry.BootPProf `yaml:"pprof" json:"pprof"` EnableRkGwOption bool `yaml:"enableRkGwOption" json:"enableRkGwOption"` GwOption *gwOption `yaml:"gwOption" json:"gwOption"` Middleware struct { Ignore []string `yaml:"ignore" json:"ignore"` ErrorModel string `yaml:"errorModel" json:"errorModel"` Logging rkmidlog.BootConfig `yaml:"logging" json:"logging"` Prom rkmidprom.BootConfig `yaml:"prom" json:"prom"` Auth rkmidauth.BootConfig `yaml:"auth" json:"auth"` Cors rkmidcors.BootConfig `yaml:"cors" json:"cors"` Secure rkmidsec.BootConfig `yaml:"secure" json:"secure"` Meta rkmidmeta.BootConfig `yaml:"meta" json:"meta"` Jwt rkmidjwt.BootConfig `yaml:"jwt" json:"jwt"` Csrf rkmidcsrf.BootConfig `yaml:"csrf" yaml:"csrf"` RateLimit rkmidlimit.BootConfig `yaml:"rateLimit" json:"rateLimit"` Timeout rkmidtimeout.BootConfig `yaml:"timeout" json:"timeout"` Trace rkmidtrace.BootConfig `yaml:"trace" json:"trace"` } `yaml:"middleware" json:"middleware"` } `yaml:"grpc" json:"grpc"` }
BootConfig Boot config which is for grpc entry.
type BootConfigGrpcWeb ¶ added in v2.2.9
type BootConfigGrpcWeb struct { Enabled bool `yaml:"enabled" json:"enabled"` Cors struct { AllowOrigins []string `yaml:"allowOrigins" json:"allowOrigins"` } `yaml:"cors" json:"cors"` Websocket struct { Enabled bool `yaml:"enabled" json:"enabled"` PingIntervalMs int64 `yaml:"pingIntervalMs" json:"pingIntervalMs"` MessageReadLimitBytes int64 `yaml:"messageReadLimitBytes" json:"messageReadLimitBytes"` CompressMode string `yaml:"compressMode" json:"compressMode"` } `yaml:"websocket" json:"websocket"` }
type BootConfigProxy ¶
type BootConfigProxy struct { Enabled bool `yaml:"enabled" json:"enabled"` Rules []struct { Type string `yaml:"type" json:"type"` HeaderPairs []string `yaml:"headerPairs" json:"headerPairs"` Dest []string `yaml:"dest" json:"dest"` Paths []string `yaml:"paths" json:"paths"` Ips []string `yaml:"ips" json:"ips"` } `yaml:"rules" json:"rules"` }
BootConfigProxy Boot config which is for proxy entry.
1: Enabled: Enable prom entry. 2: Rules: Provide rules for proxying.
type GrpcEntry ¶
type GrpcEntry struct { LoggerEntry *rkentry.LoggerEntry `json:"-" yaml:"-"` EventEntry *rkentry.EventEntry `json:"-" yaml:"-"` Port uint64 `json:"-" yaml:"-"` GwPort uint64 `json:"-" yaml:"-"` TlsConfig *tls.Config `json:"-" yaml:"-"` TlsConfigInsecure *tls.Config `json:"-" yaml:"-"` // GRPC related Server *grpc.Server `json:"-" yaml:"-"` ServerOpts []grpc.ServerOption `json:"-" yaml:"-"` UnaryInterceptors []grpc.UnaryServerInterceptor `json:"-" yaml:"-"` StreamInterceptors []grpc.StreamServerInterceptor `json:"-" yaml:"-"` GrpcRegF []GrpcRegFunc `json:"-" yaml:"-"` EnableReflection bool `json:"-" yaml:"-"` // grpcWeb related GrpcWebOptions []grpcweb.Option `json:"-" yaml:"-"` // Gateway related HttpMux *http.ServeMux `json:"-" yaml:"-"` HttpServer *http.Server `json:"-" yaml:"-"` GwMux *gwruntime.ServeMux `json:"-" yaml:"-"` GwMuxOptions []gwruntime.ServeMuxOption `json:"-" yaml:"-"` GwRegF []GwRegFunc `json:"-" yaml:"-"` GwDialOptions []grpc.DialOption `json:"-" yaml:"-"` // Utility related SWEntry *rkentry.SWEntry `json:"-" yaml:"-"` DocsEntry *rkentry.DocsEntry `json:"-" yaml:"-"` ProxyEntry *ProxyEntry `json:"-" yaml:"-"` PromEntry *rkentry.PromEntry `json:"-" yaml:"-"` StaticFileEntry *rkentry.StaticFileHandlerEntry `json:"-" yaml:"-"` CommonServiceEntry *rkentry.CommonServiceEntry `json:"-" yaml:"-"` PProfEntry *rkentry.PProfEntry `json:"-" yaml:"-"` CertEntry *rkentry.CertEntry `json:"-" yaml:"-"` // contains filtered or unexported fields }
GrpcEntry implements rkentry.Entry interface.
func GetGrpcEntry ¶
GetGrpcEntry Get GrpcEntry from rkentry.GlobalAppCtx.
func RegisterGrpcEntry ¶
func RegisterGrpcEntry(opts ...GrpcEntryOption) *GrpcEntry
RegisterGrpcEntry Register GrpcEntry with options.
func (*GrpcEntry) AddGwCorsOptions ¶
func (entry *GrpcEntry) AddGwCorsOptions(opts ...rkmidcors.Option)
AddGwCorsOptions Enable CORS at gateway side with options.
func (*GrpcEntry) AddGwCsrfOptions ¶
func (entry *GrpcEntry) AddGwCsrfOptions(opts ...rkmidcsrf.Option)
AddGwCsrfOptions Enable CORS at gateway side with options.
func (*GrpcEntry) AddGwDialOptions ¶
func (entry *GrpcEntry) AddGwDialOptions(opts ...grpc.DialOption)
AddGwDialOptions Add grpc dial options called from grpc gateway
func (*GrpcEntry) AddGwMuxOptions ¶ added in v2.1.4
func (entry *GrpcEntry) AddGwMuxOptions(opts ...gwruntime.ServeMuxOption)
AddGwMuxOptions Add mux options at gateway side.
func (*GrpcEntry) AddGwSecureOptions ¶
func (entry *GrpcEntry) AddGwSecureOptions(opts ...rkmidsec.Option)
AddGwSecureOptions Enable secure at gateway side with options.
func (*GrpcEntry) AddRegFuncGrpc ¶
func (entry *GrpcEntry) AddRegFuncGrpc(f ...GrpcRegFunc)
AddRegFuncGrpc Add grpc registration func.
func (*GrpcEntry) AddRegFuncGw ¶
AddRegFuncGw Add gateway registration func.
func (*GrpcEntry) AddServerOptions ¶
func (entry *GrpcEntry) AddServerOptions(opts ...grpc.ServerOption)
AddServerOptions Add grpc server options.
func (*GrpcEntry) AddStreamInterceptors ¶
func (entry *GrpcEntry) AddStreamInterceptors(inter ...grpc.StreamServerInterceptor)
AddStreamInterceptors Add stream interceptor.
func (*GrpcEntry) AddUnaryInterceptors ¶
func (entry *GrpcEntry) AddUnaryInterceptors(inter ...grpc.UnaryServerInterceptor)
AddUnaryInterceptors Add unary interceptor.
func (*GrpcEntry) GetDescription ¶
GetDescription Get description of entry.
func (*GrpcEntry) IsCommonServiceEnabled ¶
IsCommonServiceEnabled Is common service enabled?
func (*GrpcEntry) IsDocsEnabled ¶
IsDocsEnabled Is tv enabled?
func (*GrpcEntry) IsGrpcWebEnabled ¶ added in v2.2.9
IsGrpcWebEnabled Is grpc web enabled?
func (*GrpcEntry) IsPProfEnabled ¶ added in v2.1.0
IsPProfEnabled Is pprof enabled?
func (*GrpcEntry) IsPromEnabled ¶
IsPromEnabled Is prometheus client enabled?
func (*GrpcEntry) IsProxyEnabled ¶
IsProxyEnabled Is proxy enabled?
func (*GrpcEntry) IsSWEnabled ¶
IsSWEnabled Is swagger enabled?
func (*GrpcEntry) IsStaticFileHandlerEnabled ¶
IsStaticFileHandlerEnabled Is static file handler entry enabled?
func (*GrpcEntry) IsTlsEnabled ¶
IsTlsEnabled Is TLS enabled?
func (*GrpcEntry) MarshalJSON ¶
MarshalJSON Marshal entry.
func (*GrpcEntry) UnmarshalJSON ¶
UnmarshalJSON Not supported.
type GrpcEntryOption ¶
type GrpcEntryOption func(*GrpcEntry)
GrpcEntryOption GrpcEntry option.
func WithCertEntry ¶
func WithCertEntry(certEntry *rkentry.CertEntry) GrpcEntryOption
WithCertEntry Provide rkentry.CertEntry.
func WithCommonServiceEntry ¶
func WithCommonServiceEntry(commonService *rkentry.CommonServiceEntry) GrpcEntryOption
WithCommonServiceEntry Provide rkentry.CommonServiceEntry.
func WithDescription ¶
func WithDescription(description string) GrpcEntryOption
WithDescription Provide description.
func WithDocsEntry ¶
func WithDocsEntry(docs *rkentry.DocsEntry) GrpcEntryOption
WithDocsEntry Provide rkentry.DocsEntry.
func WithEnableReflection ¶
func WithEnableReflection(enabled bool) GrpcEntryOption
WithEnableReflection Provide EnableReflection.
func WithEventEntry ¶
func WithEventEntry(logger *rkentry.EventEntry) GrpcEntryOption
WithEventEntry Provide rkentry.EventEntry
func WithGrpcDialOptions ¶
func WithGrpcDialOptions(opts ...grpc.DialOption) GrpcEntryOption
WithGrpcDialOptions Provide grpc dial options.
func WithGrpcRegF ¶
func WithGrpcRegF(f ...GrpcRegFunc) GrpcEntryOption
WithGrpcRegF Provide GrpcRegFunc.
func WithGrpcWebOptions ¶ added in v2.2.9
func WithGrpcWebOptions(opts ...grpcweb.Option) GrpcEntryOption
WithGrpcWebOptions Provide grpcweb server options.
func WithGwMuxOptions ¶
func WithGwMuxOptions(opts ...gwruntime.ServeMuxOption) GrpcEntryOption
WithGwMuxOptions Provide gateway server mux options.
func WithGwPort ¶ added in v2.2.19
func WithGwPort(gwPort uint64) GrpcEntryOption
WithGwPort Provide gateway port, gateway will use same port if not provided
func WithGwRegF ¶
func WithGwRegF(f ...GwRegFunc) GrpcEntryOption
WithGwRegF Provide registration function.
func WithLoggerEntry ¶
func WithLoggerEntry(logger *rkentry.LoggerEntry) GrpcEntryOption
WithLoggerEntry Provide rkentry.LoggerEntry
func WithPProfEntry ¶ added in v2.1.0
func WithPProfEntry(p *rkentry.PProfEntry) GrpcEntryOption
WithPProfEntry Provide rkentry.PProfEntry.
func WithPort ¶
func WithPort(port uint64) GrpcEntryOption
WithPort Provide grpc port, gateway will use same port if not provided
func WithPromEntry ¶
func WithPromEntry(prom *rkentry.PromEntry) GrpcEntryOption
WithPromEntry Provide rkentry.PromEntry.
func WithProxyEntry ¶
func WithProxyEntry(proxy *ProxyEntry) GrpcEntryOption
WithProxyEntry Provide ProxyEntry.
func WithServerOptions ¶
func WithServerOptions(opts ...grpc.ServerOption) GrpcEntryOption
WithServerOptions Provide grpc.ServerOption.
func WithStaticFileHandlerEntry ¶
func WithStaticFileHandlerEntry(staticEntry *rkentry.StaticFileHandlerEntry) GrpcEntryOption
WithStaticFileHandlerEntry provide rkentry.StaticFileHandlerEntry.
func WithStreamInterceptors ¶
func WithStreamInterceptors(opts ...grpc.StreamServerInterceptor) GrpcEntryOption
WithStreamInterceptors Provide grpc.StreamServerInterceptor.
func WithSwEntry ¶
func WithSwEntry(sw *rkentry.SWEntry) GrpcEntryOption
WithSwEntry Provide rkentry.SWEntry.
func WithUnaryInterceptors ¶
func WithUnaryInterceptors(opts ...grpc.UnaryServerInterceptor) GrpcEntryOption
WithUnaryInterceptors Provide grpc.UnaryServerInterceptor.
type HeaderPattern ¶
HeaderPattern defines proxy rules based on header.
Proxy will validate headers in metadata with provided rules.
type PathPattern ¶
PathPattern defines proxy rules based on path.
The incoming path should match with rules. Path rule support regex.
type ProxyEntry ¶
type ProxyEntry struct { LoggerEntry *rkentry.LoggerEntry `json:"-" yaml:"-"` EventEntry *rkentry.EventEntry `json:"-" yaml:"-"` // contains filtered or unexported fields }
func NewProxyEntry ¶
func NewProxyEntry(opts ...ProxyEntryOption) *ProxyEntry
NewProxyEntry Create a proxy entry with options
func (*ProxyEntry) Bootstrap ¶
func (entry *ProxyEntry) Bootstrap(ctx context.Context)
Bootstrap Start prometheus client
func (*ProxyEntry) GetDescription ¶
func (entry *ProxyEntry) GetDescription() string
GetDescription Get description of entry
func (*ProxyEntry) GetName ¶
func (entry *ProxyEntry) GetName() string
GetName Return name of proxy entry
func (*ProxyEntry) GetType ¶
func (entry *ProxyEntry) GetType() string
GetType Return type of prom entry
func (*ProxyEntry) Interrupt ¶
func (entry *ProxyEntry) Interrupt(ctx context.Context)
Interrupt Shutdown prometheus client
func (*ProxyEntry) MarshalJSON ¶
func (entry *ProxyEntry) MarshalJSON() ([]byte, error)
MarshalJSON Marshal entry
func (*ProxyEntry) UnmarshalJSON ¶
func (entry *ProxyEntry) UnmarshalJSON(b []byte) error
UnmarshalJSON Unmarshal entry
type ProxyEntryOption ¶
type ProxyEntryOption func(*ProxyEntry)
ProxyEntryOption Proxy entry option used while initializing proxy entry via code
func WithEventEntryProxy ¶
func WithEventEntryProxy(eventEntry *rkentry.EventEntry) ProxyEntryOption
WithEventEntryProxy rkentry.EventEntry of proxy entry
func WithLoggerEntryProxy ¶
func WithLoggerEntryProxy(loggerEntry *rkentry.LoggerEntry) ProxyEntryOption
WithLoggerEntryProxy rkentry.LoggerEntry of proxy entry
func WithNameProxy ¶
func WithNameProxy(name string) ProxyEntryOption
WithNameProxy Name of proxy entry