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 RegisterGrpcEntriesWithConfig(configFilePath string) map[string]rkentry.Entry
- func TransparentHandler(director Director) grpc.StreamHandler
- func WithHeaderPatterns(pattern ...*HeaderPattern) ruleOption
- func WithIpPatterns(pattern ...*IpPattern) ruleOption
- func WithPathPatterns(pattern ...*PathPattern) ruleOption
- type BootConfig
- 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) 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) Apis(w http.ResponseWriter, req *http.Request)
- 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) GwErrorMapping(w http.ResponseWriter, req *http.Request)
- func (entry *GrpcEntry) Interrupt(ctx context.Context)
- func (entry *GrpcEntry) IsCommonServiceEnabled() bool
- func (entry *GrpcEntry) IsPromEnabled() bool
- func (entry *GrpcEntry) IsProxyEnabled() bool
- func (entry *GrpcEntry) IsStaticFileHandlerEnabled() bool
- func (entry *GrpcEntry) IsSwEnabled() bool
- func (entry *GrpcEntry) IsTlsEnabled() bool
- func (entry *GrpcEntry) IsTvEnabled() bool
- func (entry *GrpcEntry) MarshalJSON() ([]byte, error)
- func (entry *GrpcEntry) Req(w http.ResponseWriter, req *http.Request)
- func (entry *GrpcEntry) String() string
- func (entry *GrpcEntry) TV(w http.ResponseWriter, req *http.Request)
- 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 WithEnableReflection(enabled bool) GrpcEntryOption
- func WithEventLoggerEntry(logger *rkentry.EventLoggerEntry) GrpcEntryOption
- func WithGrpcDialOptions(opts ...grpc.DialOption) GrpcEntryOption
- func WithGrpcRegF(f ...GrpcRegFunc) GrpcEntryOption
- func WithGwMappingFilePaths(paths ...string) GrpcEntryOption
- func WithGwMuxOptions(opts ...gwruntime.ServeMuxOption) GrpcEntryOption
- func WithGwRegF(f ...GwRegFunc) GrpcEntryOption
- func WithName(name string) 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 WithTvEntry(tv *rkentry.TvEntry) GrpcEntryOption
- func WithUnaryInterceptors(opts ...grpc.UnaryServerInterceptor) GrpcEntryOption
- func WithZapLoggerEntry(logger *rkentry.ZapLoggerEntry) 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 ( // GrpcEntryType default entry type GrpcEntryType = "gRPC" // GrpcEntryDescription default entry description GrpcEntryDescription = "Internal RK entry which helps to bootstrap with Grpc framework." )
const ( // ProxyEntryType default entry type ProxyEntryType = "ProxyEntry" // ProxyEntryNameDefault default entry name ProxyEntryNameDefault = "ProxyDefault" // ProxyEntryDescription default entry description ProxyEntryDescription = "Internal RK entry which implements proxy with Grpc framework." // HeaderBased header based proxy pattern HeaderBased = "headerBased" // PathBased grpc path(method) based proxy pattern PathBased = "pathBased" // IpBased remote IP based proxy pattern IpBased = "ipBased" )
Variables ¶
This section is empty.
Functions ¶
func Codec ¶ added in v1.2.10
Codec returns a proxying grpc.Codec with the default protobuf codec as parent.
See CodecWithParent.
func CodecWithFallback ¶ added in v1.2.10
CodecWithParent 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 ¶ added in v1.2.0
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 ¶ added in v1.2.0
IncomingHeaderMatcher Pass out all metadata in http header to grpc metadata.
func NewRkGwServerMuxOptions ¶ added in v1.2.11
func NewRkGwServerMuxOptions(mOptIn *protojson.MarshalOptions, uOptIn *protojson.UnmarshalOptions) []runtime.ServeMuxOption
NewRkGwServerMuxOptions creates new gw server mux options.
func NewRule ¶ added in v1.2.10
func NewRule(opts ...ruleOption) *rule
NewRule create a new proxy rules with options.
func OutgoingHeaderMatcher ¶ added in v1.1.2
OutgoingHeaderMatcher Pass out all metadata in grpc to http header.
func RegisterGrpcEntriesWithConfig ¶ added in v1.2.0
RegisterGrpcEntriesWithConfig 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 rkcommon.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 rkcommon.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 rkcommon.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 TransparentHandler ¶ added in v1.2.10
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 ¶ added in v1.2.10
func WithHeaderPatterns(pattern ...*HeaderPattern) ruleOption
WithHeaderPatterns provide header based patterns.
func WithIpPatterns ¶ added in v1.2.10
func WithIpPatterns(pattern ...*IpPattern) ruleOption
WithIpPatterns provide IP based patterns.
func WithPathPatterns ¶ added in v1.2.10
func WithPathPatterns(pattern ...*PathPattern) ruleOption
WithPathPatterns provide path based patterns.
Types ¶
type BootConfig ¶ added in v1.2.19
type BootConfig struct { Grpc []struct { Name string `yaml:"name" json:"name"` Description string `yaml:"description" json:"description"` Port uint64 `yaml:"port" json:"port"` Enabled bool `yaml:"enabled" json:"enabled"` EnableReflection bool `yaml:"enableReflection" json:"enableReflection"` NoRecvMsgSizeLimit bool `yaml:"noRecvMsgSizeLimit" json:"noRecvMsgSizeLimit"` CertEntry string `yaml:"certEntry" json:"certEntry"` CommonService rkentry.BootConfigCommonService `yaml:"commonService" json:"commonService"` Sw rkentry.BootConfigSw `yaml:"sw" json:"sw"` Tv rkentry.BootConfigTv `yaml:"tv" json:"tv"` Prom rkentry.BootConfigProm `yaml:"prom" json:"prom"` Static rkentry.BootConfigStaticHandler `yaml:"static" json:"static"` Proxy BootConfigProxy `yaml:"proxy" json:"proxy"` EnableRkGwOption bool `yaml:"enableRkGwOption" json:"enableRkGwOption"` GwOption *gwOption `yaml:"gwOption" json:"gwOption"` GwMappingFilePaths []string `yaml:"gwMappingFilePaths" json:"gwMappingFilePaths"` Interceptors struct { LoggingZap rkmidlog.BootConfig `yaml:"loggingZap" json:"loggingZap"` MetricsProm rkmidmetrics.BootConfig `yaml:"metricsProm" json:"metricsProm"` 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"` TracingTelemetry rkmidtrace.BootConfig `yaml:"tracingTelemetry" json:"tracingTelemetry"` } `yaml:"interceptors" json:"interceptors"` Logger struct { ZapLogger string `yaml:"zapLogger" json:"zapLogger"` EventLogger string `yaml:"eventLogger" json:"eventLogger"` } `yaml:"logger" json:"logger"` } `yaml:"grpc" json:"grpc"` }
BootConfig Boot config which is for grpc entry.
type BootConfigProxy ¶ added in v1.2.10
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 ¶ added in v1.2.0
type GrpcEntry struct { EntryName string `json:"entryName" yaml:"entryName"` EntryType string `json:"entryType" yaml:"entryType"` EntryDescription string `json:"-" yaml:"-"` ZapLoggerEntry *rkentry.ZapLoggerEntry `json:"-" yaml:"-"` EventLoggerEntry *rkentry.EventLoggerEntry `json:"-" yaml:"-"` Port uint64 `json:"port" yaml:"port"` 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:"enableReflection" yaml:"enableReflection"` // 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:"-"` GwMappingFilePaths []string `json:"gwMappingFilePaths" yaml:"gwMappingFilePaths"` GwDialOptions []grpc.DialOption `json:"-" yaml:"-"` GwHttpToGrpcMapping map[string]*gwRule `json:"gwMapping" yaml:"gwMapping"` // Utility related SwEntry *rkentry.SwEntry `json:"-" yaml:"-"` TvEntry *rkentry.TvEntry `json:"-" yaml:"-"` ProxyEntry *ProxyEntry `json:"-" yaml:"-"` PromEntry *rkentry.PromEntry `json:"-" yaml:"-"` StaticFileEntry *rkentry.StaticFileHandlerEntry `json:"-" yaml:"-"` CommonServiceEntry *rkentry.CommonServiceEntry `json:"-" yaml:"-"` CertEntry *rkentry.CertEntry `json:"-" yaml:"-"` // contains filtered or unexported fields }
GrpcEntry implements rkentry.Entry interface.
func GetGrpcEntry ¶ added in v1.2.0
GetGrpcEntry Get GrpcEntry from rkentry.GlobalAppCtx.
func RegisterGrpcEntry ¶ added in v1.2.0
func RegisterGrpcEntry(opts ...GrpcEntryOption) *GrpcEntry
RegisterGrpcEntry Register GrpcEntry with options.
func (*GrpcEntry) AddGwCorsOptions ¶ added in v1.2.12
func (entry *GrpcEntry) AddGwCorsOptions(opts ...rkmidcors.Option)
AddGwCorsOptions Enable CORS at gateway side with options.
func (*GrpcEntry) AddGwCsrfOptions ¶ added in v1.2.13
func (entry *GrpcEntry) AddGwCsrfOptions(opts ...rkmidcsrf.Option)
AddGwCsrfOptions Enable CORS at gateway side with options.
func (*GrpcEntry) AddGwDialOptions ¶ added in v1.2.3
func (entry *GrpcEntry) AddGwDialOptions(opts ...grpc.DialOption)
AddGwDialOptions Add grpc dial options called from grpc gateway
func (*GrpcEntry) AddGwSecureOptions ¶ added in v1.2.13
func (entry *GrpcEntry) AddGwSecureOptions(opts ...rkmidsec.Option)
AddGwSecureOptions Enable secure at gateway side with options.
func (*GrpcEntry) AddRegFuncGrpc ¶ added in v1.2.3
func (entry *GrpcEntry) AddRegFuncGrpc(f ...GrpcRegFunc)
AddRegFuncGrpc Add grpc registration func.
func (*GrpcEntry) AddRegFuncGw ¶ added in v1.2.3
AddRegFuncGw Add gateway registration func.
func (*GrpcEntry) AddServerOptions ¶ added in v1.2.0
func (entry *GrpcEntry) AddServerOptions(opts ...grpc.ServerOption)
AddServerOptions Add grpc server options.
func (*GrpcEntry) AddStreamInterceptors ¶ added in v1.2.0
func (entry *GrpcEntry) AddStreamInterceptors(inter ...grpc.StreamServerInterceptor)
AddStreamInterceptors Add stream interceptor.
func (*GrpcEntry) AddUnaryInterceptors ¶ added in v1.2.0
func (entry *GrpcEntry) AddUnaryInterceptors(inter ...grpc.UnaryServerInterceptor)
AddUnaryInterceptors Add unary interceptor.
func (*GrpcEntry) Apis ¶ added in v1.2.19
func (entry *GrpcEntry) Apis(w http.ResponseWriter, req *http.Request)
Apis Stub
func (*GrpcEntry) GetDescription ¶ added in v1.2.0
GetDescription Get description of entry.
func (*GrpcEntry) GwErrorMapping ¶ added in v1.2.19
func (entry *GrpcEntry) GwErrorMapping(w http.ResponseWriter, req *http.Request)
GwErrorMapping Get error mapping file contents.
func (*GrpcEntry) IsCommonServiceEnabled ¶ added in v1.2.0
IsCommonServiceEnabled Is common service enabled?
func (*GrpcEntry) IsPromEnabled ¶ added in v1.2.3
IsPromEnabled Is prometheus client enabled?
func (*GrpcEntry) IsProxyEnabled ¶ added in v1.2.10
IsProxyEnabled Is proxy enabled?
func (*GrpcEntry) IsStaticFileHandlerEnabled ¶ added in v1.2.13
IsStaticFileHandlerEnabled Is static file handler entry enabled?
func (*GrpcEntry) IsSwEnabled ¶ added in v1.2.3
IsSwEnabled Is swagger enabled?
func (*GrpcEntry) IsTlsEnabled ¶ added in v1.2.0
IsTlsEnabled Is TLS enabled?
func (*GrpcEntry) IsTvEnabled ¶ added in v1.2.3
IsTvEnabled Is tv enabled?
func (*GrpcEntry) MarshalJSON ¶ added in v1.2.0
MarshalJSON Marshal entry.
func (*GrpcEntry) Req ¶ added in v1.2.19
func (entry *GrpcEntry) Req(w http.ResponseWriter, req *http.Request)
Req Stub
func (*GrpcEntry) TV ¶ added in v1.2.19
func (entry *GrpcEntry) TV(w http.ResponseWriter, req *http.Request)
TV Http handler of /rk/v1/tv/*.
func (*GrpcEntry) UnmarshalJSON ¶ added in v1.2.0
UnmarshalJSON Not supported.
type GrpcEntryOption ¶ added in v1.2.0
type GrpcEntryOption func(*GrpcEntry)
GrpcEntryOption GrpcEntry option.
func WithCertEntry ¶ added in v1.2.19
func WithCertEntry(certEntry *rkentry.CertEntry) GrpcEntryOption
WithCertEntry Provide rkentry.CertEntry.
func WithCommonServiceEntry ¶ added in v1.2.19
func WithCommonServiceEntry(commonService *rkentry.CommonServiceEntry) GrpcEntryOption
WithCommonServiceEntry Provide CommonServiceEntry.
func WithDescription ¶ added in v1.2.19
func WithDescription(description string) GrpcEntryOption
WithDescription Provide description.
func WithEnableReflection ¶ added in v1.2.19
func WithEnableReflection(enabled bool) GrpcEntryOption
WithEnableReflection Provide EnableReflection.
func WithEventLoggerEntry ¶ added in v1.2.19
func WithEventLoggerEntry(logger *rkentry.EventLoggerEntry) GrpcEntryOption
WithEventLoggerEntry Provide rkentry.EventLoggerEntry
func WithGrpcDialOptions ¶ added in v1.2.19
func WithGrpcDialOptions(opts ...grpc.DialOption) GrpcEntryOption
WithGrpcDialOptions Provide grpc dial options.
func WithGrpcRegF ¶ added in v1.2.3
func WithGrpcRegF(f ...GrpcRegFunc) GrpcEntryOption
WithGrpcRegF Provide GrpcRegFunc.
func WithGwMappingFilePaths ¶ added in v1.2.19
func WithGwMappingFilePaths(paths ...string) GrpcEntryOption
WithGwMappingFilePaths Provide gateway mapping configuration file paths.
func WithGwMuxOptions ¶ added in v1.2.19
func WithGwMuxOptions(opts ...gwruntime.ServeMuxOption) GrpcEntryOption
WithGwMuxOptions Provide gateway server mux options.
func WithGwRegF ¶ added in v1.2.19
func WithGwRegF(f ...GwRegFunc) GrpcEntryOption
WithGwRegF Provide registration function.
func WithPromEntry ¶ added in v1.2.19
func WithPromEntry(prom *rkentry.PromEntry) GrpcEntryOption
WithPromEntry Provide PromEntry.
func WithProxyEntry ¶ added in v1.2.19
func WithProxyEntry(proxy *ProxyEntry) GrpcEntryOption
WithProxyEntry Provide ProxyEntry.
func WithServerOptions ¶
func WithServerOptions(opts ...grpc.ServerOption) GrpcEntryOption
WithServerOptions Provide grpc.ServerOption.
func WithStaticFileHandlerEntry ¶ added in v1.2.19
func WithStaticFileHandlerEntry(staticEntry *rkentry.StaticFileHandlerEntry) GrpcEntryOption
WithStaticFileHandlerEntry provide StaticFileHandlerEntry.
func WithStreamInterceptors ¶
func WithStreamInterceptors(opts ...grpc.StreamServerInterceptor) GrpcEntryOption
WithStreamInterceptors Provide grpc.StreamServerInterceptor.
func WithSwEntry ¶ added in v1.2.19
func WithSwEntry(sw *rkentry.SwEntry) GrpcEntryOption
WithSwEntry Provide SwEntry.
func WithTvEntry ¶ added in v1.2.19
func WithTvEntry(tv *rkentry.TvEntry) GrpcEntryOption
WithTvEntry Provide TvEntry.
func WithUnaryInterceptors ¶
func WithUnaryInterceptors(opts ...grpc.UnaryServerInterceptor) GrpcEntryOption
WithUnaryInterceptors Provide grpc.UnaryServerInterceptor.
func WithZapLoggerEntry ¶ added in v1.2.19
func WithZapLoggerEntry(logger *rkentry.ZapLoggerEntry) GrpcEntryOption
WithZapLoggerEntry Provide rkentry.ZapLoggerEntry
type GrpcRegFunc ¶ added in v1.2.0
GrpcRegFunc Grpc registration func.
type HeaderPattern ¶ added in v1.2.10
HeaderPattern defines proxy rules based on header.
Proxy will validate headers in metadata with provided rules.
type IpPattern ¶ added in v1.2.10
IpPattern defines proxy rules based on remote IPs.
Ip rule support CIDR.
type PathPattern ¶ added in v1.2.10
PathPattern defines proxy rules based on path.
The incoming path should match with rules. Path rule support regex.
type ProxyEntry ¶ added in v1.2.10
type ProxyEntry struct { EntryName string `json:"entryName" yaml:"entryName"` EntryType string `json:"entryType" yaml:"entryType"` EntryDescription string `json:"-" yaml:"-"` ZapLoggerEntry *rkentry.ZapLoggerEntry `json:"-" yaml:"-"` EventLoggerEntry *rkentry.EventLoggerEntry `json:"-" yaml:"-"` // contains filtered or unexported fields }
func NewProxyEntry ¶ added in v1.2.10
func NewProxyEntry(opts ...ProxyEntryOption) *ProxyEntry
NewProxyEntry Create a proxy entry with options
func (*ProxyEntry) Bootstrap ¶ added in v1.2.10
func (entry *ProxyEntry) Bootstrap(ctx context.Context)
Bootstrap Start prometheus client
func (*ProxyEntry) GetDescription ¶ added in v1.2.10
func (entry *ProxyEntry) GetDescription() string
GetDescription Get description of entry
func (*ProxyEntry) GetName ¶ added in v1.2.10
func (entry *ProxyEntry) GetName() string
GetName Return name of proxy entry
func (*ProxyEntry) GetType ¶ added in v1.2.10
func (entry *ProxyEntry) GetType() string
GetType Return type of prom entry
func (*ProxyEntry) Interrupt ¶ added in v1.2.10
func (entry *ProxyEntry) Interrupt(ctx context.Context)
Interrupt Shutdown prometheus client
func (*ProxyEntry) MarshalJSON ¶ added in v1.2.10
func (entry *ProxyEntry) MarshalJSON() ([]byte, error)
MarshalJSON Marshal entry
func (*ProxyEntry) String ¶ added in v1.2.10
func (entry *ProxyEntry) String() string
String Stringfy prom entry
func (*ProxyEntry) UnmarshalJSON ¶ added in v1.2.10
func (entry *ProxyEntry) UnmarshalJSON(b []byte) error
UnmarshalJSON Unmarshal entry
type ProxyEntryOption ¶ added in v1.2.10
type ProxyEntryOption func(*ProxyEntry)
ProxyEntryOption Proxy entry option used while initializing proxy entry via code
func WithEventLoggerEntryProxy ¶ added in v1.2.10
func WithEventLoggerEntryProxy(eventLoggerEntry *rkentry.EventLoggerEntry) ProxyEntryOption
WithEventLoggerEntryProxy rkentry.EventLoggerEntry of proxy entry
func WithNameProxy ¶ added in v1.2.10
func WithNameProxy(name string) ProxyEntryOption
WithNameProm Name of proxy entry
func WithRuleProxy ¶ added in v1.2.10
func WithRuleProxy(r *rule) ProxyEntryOption
WithRuleProxy Provide rule
func WithZapLoggerEntryProxy ¶ added in v1.2.10
func WithZapLoggerEntryProxy(zapLoggerEntry *rkentry.ZapLoggerEntry) ProxyEntryOption
WithZapLoggerEntryProxy rkentry.ZapLoggerEntry of proxy entry