Documentation
¶
Overview ¶
Copyright (c) 2021 rookie-ninja
Use of this source code is governed by an Apache-style license that can be found in the LICENSE file.
Copyright (c) 2021 rookie-ninja ¶
Use of this source code is governed by an Apache-style license that can be found in the LICENSE file.
Copyright (c) 2021 rookie-ninja ¶
Use of this source code is governed by an Apache-style license that can be found in the LICENSE file.
Copyright (c) 2021 rookie-ninja ¶
Use of this source code is governed by an Apache-style license that can be found in the LICENSE file.
Copyright (c) 2021 rookie-ninja ¶
Use of this source code is governed by an Apache-style license that can be found in the LICENSE file.
Copyright (c) 2021 rookie-ninja ¶
Use of this source code is governed by an Apache-style license that can be found in the LICENSE file.
Copyright (c) 2021 rookie-ninja ¶
Use of this source code is governed by an Apache-style license that can be found in the LICENSE file.
Index ¶
- Constants
- Variables
- func HttpErrorHandler(ctx context.Context, mux *runtime.ServeMux, marshaler runtime.Marshaler, ...)
- func IncomingHeaderMatcher(key string) (string, bool)
- func OutgoingHeaderMatcher(key string) (string, bool)
- func RegisterGrpcEntriesWithConfig(configFilePath string) map[string]rkentry.Entry
- type BootConfigCommonService
- type BootConfigGrpc
- type BootConfigGw
- type BootConfigProm
- type BootConfigSw
- type BootConfigTv
- type CommonServiceEntry
- func (entry *CommonServiceEntry) Apis(ctx context.Context, request *rk_grpc_common_v1.ApisRequest) (*structpb.Struct, error)
- func (entry *CommonServiceEntry) Bootstrap(ctx context.Context)
- func (entry *CommonServiceEntry) Certs(ctx context.Context, request *rk_grpc_common_v1.CertsRequest) (*structpb.Struct, error)
- func (entry *CommonServiceEntry) Configs(ctx context.Context, request *rk_grpc_common_v1.ConfigsRequest) (*structpb.Struct, error)
- func (entry *CommonServiceEntry) Deps(ctx context.Context, request *rk_grpc_common_v1.DepsRequest) (*structpb.Struct, error)
- func (entry *CommonServiceEntry) Entries(ctx context.Context, request *rk_grpc_common_v1.EntriesRequest) (*structpb.Struct, error)
- func (entry *CommonServiceEntry) Gc(ctx context.Context, request *rk_grpc_common_v1.GcRequest) (*structpb.Struct, error)
- func (entry *CommonServiceEntry) GetDescription() string
- func (entry *CommonServiceEntry) GetName() string
- func (entry *CommonServiceEntry) GetType() string
- func (entry *CommonServiceEntry) Git(ctx context.Context, request *rk_grpc_common_v1.GitRequest) (*structpb.Struct, error)
- func (entry *CommonServiceEntry) GwErrorMapping(ctx context.Context, request *rk_grpc_common_v1.GwErrorMappingRequest) (*structpb.Struct, error)
- func (entry *CommonServiceEntry) Healthy(ctx context.Context, request *rk_grpc_common_v1.HealthyRequest) (*structpb.Struct, error)
- func (entry *CommonServiceEntry) Info(ctx context.Context, request *rk_grpc_common_v1.InfoRequest) (*structpb.Struct, error)
- func (entry *CommonServiceEntry) Interrupt(ctx context.Context)
- func (entry *CommonServiceEntry) License(ctx context.Context, request *rk_grpc_common_v1.LicenseRequest) (*structpb.Struct, error)
- func (entry *CommonServiceEntry) Logs(ctx context.Context, request *rk_grpc_common_v1.LogsRequest) (*structpb.Struct, error)
- func (entry *CommonServiceEntry) MarshalJSON() ([]byte, error)
- func (entry *CommonServiceEntry) Readme(ctx context.Context, request *rk_grpc_common_v1.ReadmeRequest) (*structpb.Struct, error)
- func (entry *CommonServiceEntry) Req(ctx context.Context, request *rk_grpc_common_v1.ReqRequest) (*structpb.Struct, error)
- func (entry *CommonServiceEntry) String() string
- func (entry *CommonServiceEntry) Sys(ctx context.Context, request *rk_grpc_common_v1.SysRequest) (*structpb.Struct, error)
- func (entry *CommonServiceEntry) UnmarshalJSON([]byte) error
- type CommonServiceEntryOption
- type GrpcEntry
- func (entry *GrpcEntry) AddGrpcRegFuncs(funcs ...GrpcRegFunc)
- func (entry *GrpcEntry) AddGwRegFuncs(funcs ...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) IsGwEnabled() 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 WithCertEntryGrpc(certEntry *rkentry.CertEntry) GrpcEntryOption
- func WithCommonServiceEntryGrpc(commonService *CommonServiceEntry) GrpcEntryOption
- func WithDescriptionGrpc(description string) GrpcEntryOption
- func WithEnableReflectionGrpc(enabled bool) GrpcEntryOption
- func WithEventLoggerEntryGrpc(logger *rkentry.EventLoggerEntry) GrpcEntryOption
- func WithGrpcRegFuncsGrpc(funcs ...GrpcRegFunc) GrpcEntryOption
- func WithGwEntryGrpc(gw *GwEntry) GrpcEntryOption
- func WithNameGrpc(name string) GrpcEntryOption
- func WithPortGrpc(port uint64) GrpcEntryOption
- func WithServerOptionsGrpc(opts ...grpc.ServerOption) GrpcEntryOption
- func WithStreamInterceptorsGrpc(opts ...grpc.StreamServerInterceptor) GrpcEntryOption
- func WithUnaryInterceptorsGrpc(opts ...grpc.UnaryServerInterceptor) GrpcEntryOption
- func WithZapLoggerEntryGrpc(logger *rkentry.ZapLoggerEntry) GrpcEntryOption
- type GrpcRegFunc
- type GwEntry
- func (entry *GwEntry) Bootstrap(ctx context.Context)
- func (entry *GwEntry) GetDescription() string
- func (entry *GwEntry) GetName() string
- func (entry *GwEntry) GetType() string
- func (entry *GwEntry) Interrupt(ctx context.Context)
- func (entry *GwEntry) IsCommonServiceEnabled() bool
- func (entry *GwEntry) IsGrpcTlsEnabled() bool
- func (entry *GwEntry) IsPromEnabled() bool
- func (entry *GwEntry) IsServerTlsEnabled() bool
- func (entry *GwEntry) IsSwEnabled() bool
- func (entry *GwEntry) IsTvEnabled() bool
- func (entry *GwEntry) MarshalJSON() ([]byte, error)
- func (entry *GwEntry) String() string
- func (entry *GwEntry) UnmarshalJSON([]byte) error
- type GwOption
- func WithCertEntryGw(certEntry *rkentry.CertEntry) GwOption
- func WithCommonServiceEntryGw(commonService *CommonServiceEntry) GwOption
- func WithEventLoggerEntryGw(eventLoggerEntry *rkentry.EventLoggerEntry) GwOption
- func WithGrpcCertEntryGw(grpcCertEntry *rkentry.CertEntry) GwOption
- func WithGrpcDialOptionsGw(opts ...grpc.DialOption) GwOption
- func WithGrpcPortGw(port uint64) GwOption
- func WithGwMappingFilePathsGw(paths ...string) GwOption
- func WithHttpPortGw(port uint64) GwOption
- func WithNameGw(name string) GwOption
- func WithPromEntryGw(prom *PromEntry) GwOption
- func WithRegFuncsGw(funcs ...GwRegFunc) GwOption
- func WithServerMuxOptionsGw(opts ...runtime.ServeMuxOption) GwOption
- func WithSwEntryGw(sw *SwEntry) GwOption
- func WithTvEntryGw(tv *TvEntry) GwOption
- func WithZapLoggerEntryGw(zapLoggerEntry *rkentry.ZapLoggerEntry) GwOption
- type GwRegFunc
- type PromEntry
- func (entry *PromEntry) Bootstrap(ctx context.Context)
- func (entry *PromEntry) GetDescription() string
- func (entry *PromEntry) GetName() string
- func (entry *PromEntry) GetType() string
- func (entry *PromEntry) Interrupt(ctx context.Context)
- func (entry *PromEntry) MarshalJSON() ([]byte, error)
- func (entry *PromEntry) RegisterCollectors(collectors ...prometheus.Collector) error
- func (entry *PromEntry) String() string
- func (entry *PromEntry) UnmarshalJSON(b []byte) error
- type PromEntryOption
- func WithEventLoggerEntryProm(eventLoggerEntry *rkentry.EventLoggerEntry) PromEntryOption
- func WithNameProm(name string) PromEntryOption
- func WithPathProm(path string) PromEntryOption
- func WithPortProm(port uint64) PromEntryOption
- func WithPromRegistryProm(registry *prometheus.Registry) PromEntryOption
- func WithPusherProm(pusher *rkprom.PushGatewayPusher) PromEntryOption
- func WithZapLoggerEntryProm(zapLoggerEntry *rkentry.ZapLoggerEntry) PromEntryOption
- type SwEntry
- func (entry *SwEntry) AssetsFileHandler(w http.ResponseWriter, r *http.Request)
- func (entry *SwEntry) Bootstrap(ctx context.Context)
- func (entry *SwEntry) ConfigFileHandler(w http.ResponseWriter, r *http.Request)
- func (entry *SwEntry) GetDescription() string
- func (entry *SwEntry) GetName() string
- func (entry *SwEntry) GetType() string
- func (entry *SwEntry) Interrupt(ctx context.Context)
- func (entry *SwEntry) MarshalJSON() ([]byte, error)
- func (entry *SwEntry) String() string
- func (entry *SwEntry) UnmarshalJSON([]byte) error
- type SwOption
- func WithEnableCommonServiceSw(enabled bool) SwOption
- func WithEventLoggerEntrySw(eventLoggerEntry *rkentry.EventLoggerEntry) SwOption
- func WithHeadersSw(headers map[string]string) SwOption
- func WithJsonPathSw(path string) SwOption
- func WithNameSw(name string) SwOption
- func WithPathSw(path string) SwOption
- func WithPortSw(port uint64) SwOption
- func WithZapLoggerEntrySw(zapLoggerEntry *rkentry.ZapLoggerEntry) SwOption
- type TvEntry
- func (entry *TvEntry) AssetsFileHandler(w http.ResponseWriter, r *http.Request)
- func (entry *TvEntry) Bootstrap(ctx context.Context)
- func (entry *TvEntry) GetDescription() string
- func (entry *TvEntry) GetName() string
- func (entry *TvEntry) GetType() string
- func (entry *TvEntry) Interrupt(ctx context.Context)
- func (entry *TvEntry) MarshalJSON() ([]byte, error)
- func (entry *TvEntry) String() string
- func (entry *TvEntry) TV(w http.ResponseWriter, r *http.Request)
- func (entry *TvEntry) UnmarshalJSON([]byte) error
- type TvEntryOption
Constants ¶
const ( CommonServiceEntryType = "GrpcCommonServiceEntry" CommonServiceEntryNameDefault = "GrpcCommonServiceDefault" CommonServiceEntryDescription = "Internal RK entry which implements commonly used API with grpc framework." CommonServiceGwMappingFilePath = "api/v1/gw_mapping.yaml" )
const ( GrpcEntryType = "GrpcEntry" GrpcEntryDescription = "Internal RK entry which helps to bootstrap with Grpc framework." )
const ( GwEntryType = "GwEntry" GwEntryNameDefault = "GwDefault" GwEntryDescription = "Internal RK entry which implements grpc gateway on top of grpc framework." )
const ( PromEntryType = "GrpcPromEntry" PromEntryNameDefault = "GrpcPromDefault" PromEntryDescription = "Internal RK entry which implements prometheus client with Grpc framework." )
const ( SwEntryType = "GrpcSwEntry" SwEntryNameDefault = "GrpcSwDefault" SwEntryDescription = "Internal RK entry which implements swagger with Grpc framework." SwEntryCommonServiceJsonFileSuffix = "-rk-common.swagger.json" )
const ( TvEntryType = "GrpcTvEntry" TvEntryNameDefault = "GrpcTvDefault" TvEntryDescription = "Internal RK entry which implements tv web with grpc framework." )
Variables ¶
var ( RkGwServerMuxOptions = []runtime.ServeMuxOption{ runtime.WithErrorHandler(HttpErrorHandler), runtime.WithMarshalerOption(runtime.MIMEWildcard, &runtime.JSONPb{ MarshalOptions: protojson.MarshalOptions{ UseProtoNames: false, EmitUnpopulated: true, }, UnmarshalOptions: protojson.UnmarshalOptions{}, }), runtime.WithMetadata(func(c context.Context, req *http.Request) metadata.MD { scheme := "http" if req.TLS != nil { scheme = "https" } return metadata.Pairs( "x-forwarded-method", req.Method, "x-forwarded-path", req.URL.Path, "x-forwarded-scheme", scheme, "x-forwarded-user-agent", req.UserAgent(), "x-forwarded-remote-addr", req.RemoteAddr) }), runtime.WithOutgoingHeaderMatcher(OutgoingHeaderMatcher), runtime.WithIncomingHeaderMatcher(IncomingHeaderMatcher), } )
var (
Templates = map[string][]byte{}
)
Functions ¶
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)
Mainly copies from runtime.DefaultHTTPErrorHandler. We reformat error response with rkerror.ErrorResp.
func IncomingHeaderMatcher ¶ added in v1.2.0
Pass out all metadata in http header to grpc metadata.
func OutgoingHeaderMatcher ¶ added in v1.1.2
Pass out all metadata in grpc to http header.
func RegisterGrpcEntriesWithConfig ¶ added in v1.2.0
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"
Types ¶
type BootConfigCommonService ¶ added in v1.2.0
type BootConfigCommonService struct {
Enabled bool `yaml:"enabled"`
}
Bootstrap config of common service. 1: Enabled: Enable common service.
type BootConfigGrpc ¶ added in v1.2.0
type BootConfigGrpc struct { Grpc []struct { Name string `yaml:"name" json:"name"` Description string `yaml:"description" json:"description"` Port uint64 `yaml:"port" json:"port"` Reflection bool `yaml:"reflection" json:"reflection"` Cert struct { Ref string `yaml:"ref" json:"ref"` } `yaml:"cert" json:"cert"` GW BootConfigGw `yaml:"gw" json:"gw"` CommonService BootConfigCommonService `yaml:"commonService" json:"commonService"` Interceptors struct { LoggingZap struct { Enabled bool `yaml:"enabled" json:"enabled"` ZapLoggerEncoding string `yaml:"zapLoggerEncoding" json:"zapLoggerEncoding"` ZapLoggerOutputPaths []string `yaml:"zapLoggerOutputPaths" json:"zapLoggerOutputPaths"` EventLoggerEncoding string `yaml:"eventLoggerEncoding" json:"eventLoggerEncoding"` EventLoggerOutputPaths []string `yaml:"eventLoggerOutputPaths" json:"eventLoggerOutputPaths"` } `yaml:"loggingZap" json:"loggingZap"` MetricsProm struct { Enabled bool `yaml:"enabled" json:"enabled"` } `yaml:"metricsProm" json:"metricsProm"` Auth struct { Enabled bool `yaml:"enabled" json:"enabled"` IgnorePrefix []string `yaml:"ignorePrefix" json:"ignorePrefix"` Basic []string `yaml:"basic" json:"basic"` ApiKey []string `yaml:"apiKey" json:"apiKey"` } `yaml:"auth" json:"auth"` Meta struct { Enabled bool `yaml:"enabled" json:"enabled"` Prefix string `yaml:"prefix" json:"prefix"` } `yaml:"meta" json:"meta"` TracingTelemetry struct { Enabled bool `yaml:"enabled" json:"enabled"` Exporter struct { File struct { Enabled bool `yaml:"enabled" json:"enabled"` OutputPath string `yaml:"outputPath" json:"outputPath"` } `yaml:"file" json:"file"` Jaeger struct { Enabled bool `yaml:"enabled" json:"enabled"` CollectorEndpoint string `yaml:"collectorEndpoint" json:"collectorEndpoint"` CollectorUsername string `yaml:"collectorUsername" json:"collectorUsername"` CollectorPassword string `yaml:"collectorPassword" json:"collectorPassword"` } `yaml:"jaeger" json:"jaeger"` } `yaml:"exporter" json:"exporter"` } `tracingTelemetry` } `yaml:"interceptors" json:"interceptors"` Logger struct { ZapLogger struct { Ref string `yaml:"ref" json:"ref"` } `yaml:"zapLogger" json:"zapLogger"` EventLogger struct { Ref string `yaml:"ref" json:"ref"` } `yaml:"eventLogger" json:"eventLogger"` } `yaml:"logger" json:"logger"` } `yaml:"grpc" json:"grpc"` }
Boot config which is for grpc entry.
1: Grpc.Name: Name of entry, should be unique globally. 2: Grpc.Description: Description of entry. 3: Grpc.Port: Port of entry. 4: Grpc.Cert.Ref: Reference of rkentry.CertEntry. 5: Grpc.GW.Enabled: Enable grpc gateway. 6: Grpc.GW.Port: Grpc gateway port. 7: Grpc.GW.Cert.Ref: Reference of rkentry.CertEntry. 8: Grpc.GW.Logger.ZapLogger.Ref: Reference of rkentry.ZapLoggerEntry. 9: Grpc.GW.Logger.EventLogger.Ref: Reference of rkentry.EventLoggerEntry. 10: Grpc.GW.PathPrefix: Grpc gateway path prefix for all path. 11: Grpc.Gw.Tv.Enabled: Enable TvEntry. 12: Grpc.GW.Sw.Enabled: Enable SwEntry. 13: Grpc.GW.Sw.Path: Swagger UI path. 14: Grpc.GW.Sw.JsonPath: Swagger JSON config file path. 15: Grpc.GW.Sw.Headers: Http headers which would be forwarded to user. 16: Grpc.GW.Prom.Pusher.Enabled: Enable prometheus pushgateway pusher. 17: Grpc.GW.Prom.Pusher.IntervalMs: Interval in milliseconds while pushing metrics to remote pushGateway. 18: Grpc.GW.Prom.Pusher.JobName: Name of pushGateway pusher job. 19: Grpc.GW.Prom.Pusher.RemoteAddress: Remote address of pushGateway server. 20: Grpc.GW.Prom.Pusher.BasicAuth: Basic auth credential of pushGateway server. 21: Grpc.GW.Prom.Pusher.Cert.Ref: Reference of rkentry.CertEntry. 22: Grpc.GW.Prom.Cert.Ref: Reference of rkentry.CertEntry. 23: Grpc.CommonService.Enabled: Reference of CommonService. 24: Grpc.Interceptors.LoggingZap.Enabled: Enable zap logger interceptor. 25: Grpc.Interceptors.MetricsProm.Enabled: Enable prometheus metrics interceptor. 26: Grpc.Interceptors.Auth.Enabled: Enable basic auth interceptor. 27: Grpc.Interceptors.Auth.Basic: Basic auth credentials as scheme of <user:pass>. 28: Grpc.Interceptors.Auth.Bearer: Bearer auth tokens. 29: Grpc.Interceptors.Auth.API: API key. 30: Grpc.Logger.ZapLogger.Ref: Zap logger reference, see rkentry.ZapLoggerEntry for details. 31: Grpc.Logger.EventLogger.Ref: Event logger reference, see rkentry.EventLoggerEntry for details.
type BootConfigGw ¶ added in v1.2.0
type BootConfigGw struct { Enabled bool `yaml:"enabled" json:"enabled"` Port uint64 `yaml:"port" json:"port"` RkServerOption bool `yaml:"rkServerOption" json:"rkServerOption"` Cert struct { Ref string `yaml:"ref" json:"ref"` } `yaml:"cert" json:"cert"` GwMappingFilePaths []string `yaml:"gwMappingFilePaths" json:"gwMappingFilePaths"` TV BootConfigTv `yaml:"tv" json:"tv"` SW BootConfigSw `yaml:"sw" json:"sw"` Prom BootConfigProm `yaml:"prom" json:"prom"` }
Bootstrap config of tv. 1: Enabled: Enable gateway. 2: Port: Http port exposed. 3: Enable RK sytle server option? 4: Cert.Ref: Reference of rkentry.CertEntry. 5: Logger.ZapLogger.Ref: Reference of rkentry.ZapLoggerEntry. 6: Logger.EventLogger.Ref: Reference of rkentry.EventLoggerEntry. 7: GwMappingFilePaths: Array of file path of gateway file path file. 8: Tv: See BootConfigTv for details. 9: Sw: See BootConfigSw for details. 10: Prom: See BootConfigProm for details.
type BootConfigProm ¶ added in v1.2.0
type BootConfigProm struct { Enabled bool `yaml:"enabled" json:"enabled"` Path string `yaml:"path" json:"path"` Pusher struct { Enabled bool `yaml:"enabled" json:"enabled"` JobName string `yaml:"jobName" json:"jobName"` RemoteAddress string `yaml:"remoteAddress" json:"remoteAddress"` IntervalMs int64 `yaml:"IntervalMs" json:"IntervalMs"` BasicAuth string `yaml:"basicAuth" json:"basicAuth"` Cert struct { Ref string `yaml:"ref" json:"ref"` } `yaml:"cert" json:"cert"` } `yaml:"pusher" json:"pusher"` }
Boot config which is for prom entry.
1: Path: PromEntry path, /metrics is default value. 2: Enabled: Enable prom entry. 3: Pusher.Enabled: Enable pushgateway pusher. 4: Pusher.IntervalMs: Interval of pushing metrics to remote pushgateway in milliseconds. 5: Pusher.JobName: Job name would be attached as label while pushing to remote pushgateway. 6: Pusher.RemoteAddress: Pushgateway address, could be form of http://x.x.x.x or x.x.x.x 7: Pusher.BasicAuth: Basic auth used to interact with remote pushgateway. 8: Pusher.Cert.Ref: Reference of rkentry.CertEntry.
type BootConfigSw ¶ added in v1.2.0
type BootConfigSw struct { Enabled bool `yaml:"enabled" json:"enabled"` Path string `yaml:"path" json:"path"` JsonPath string `yaml:"jsonPath" json:"jsonPath"` Headers []string `yaml:"headers" json:"headers"` }
Bootstrap config of swagger. 1: Enabled: Enable swagger. 2: Path: Swagger path accessible from restful API. 3: JsonPath: The path of where swagger JSON file was located. 4: Headers: The headers that would added into each API response.
type BootConfigTv ¶ added in v1.2.0
type BootConfigTv struct {
Enabled bool `yaml:"enabled" json:"enabled"`
}
Bootstrap config of tv. 1: Enabled: Enable tv service.
type CommonServiceEntry ¶ added in v1.2.0
type CommonServiceEntry struct { EntryName string `json:"entryName" yaml:"entryName"` EntryType string `json:"entryType" yaml:"entryType"` EntryDescription string `json:"entryDescription" yaml:"entryDescription"` EventLoggerEntry *rkentry.EventLoggerEntry `json:"eventLoggerEntry" yaml:"eventLoggerEntry"` ZapLoggerEntry *rkentry.ZapLoggerEntry `json:"zapLoggerEntry" yaml:"zapLoggerEntry"` RegFuncGrpc GrpcRegFunc `json:"regFuncGrpc" yaml:"regFuncGrpc"` RegFuncGw GwRegFunc `json:"regFuncGw" yaml:"regFuncGw"` GwMappingFilePath string `json:"gwMappingFilePath" yaml:"gwMappingFilePath"` GwMapping map[string]string `json:"gwMapping" yaml:"gwMapping"` }
RK common service which contains commonly used APIs 1: Healthy GET Returns true if process is alive 2: Gc GET Trigger gc() 3: Info GET Returns entry basic information 4: Configs GET Returns viper configs in GlobalAppCtx 5: Apis GET Returns list of apis registered in gin router 6: Sys GET Returns CPU and Memory information 7: Req GET Returns request metrics 8: Certs GET Returns certificates 9: Entries GET Returns entries
func NewCommonServiceEntry ¶ added in v1.2.0
func NewCommonServiceEntry(opts ...CommonServiceEntryOption) *CommonServiceEntry
Create new common service entry with options.
func (*CommonServiceEntry) Apis ¶ added in v1.2.0
func (entry *CommonServiceEntry) Apis(ctx context.Context, request *rk_grpc_common_v1.ApisRequest) (*structpb.Struct, error)
Apis Stub
func (*CommonServiceEntry) Bootstrap ¶ added in v1.2.0
func (entry *CommonServiceEntry) Bootstrap(ctx context.Context)
Bootstrap common service entry
func (*CommonServiceEntry) Configs ¶ added in v1.2.0
func (entry *CommonServiceEntry) Configs(ctx context.Context, request *rk_grpc_common_v1.ConfigsRequest) (*structpb.Struct, error)
Configs Stub.
func (*CommonServiceEntry) Entries ¶ added in v1.2.0
func (entry *CommonServiceEntry) Entries(ctx context.Context, request *rk_grpc_common_v1.EntriesRequest) (*structpb.Struct, error)
Entries Stub
func (*CommonServiceEntry) Gc ¶ added in v1.2.0
func (entry *CommonServiceEntry) Gc(ctx context.Context, request *rk_grpc_common_v1.GcRequest) (*structpb.Struct, error)
Gc Stub.
func (*CommonServiceEntry) GetDescription ¶ added in v1.2.0
func (entry *CommonServiceEntry) GetDescription() string
Get description of entry.
func (*CommonServiceEntry) GetName ¶ added in v1.2.0
func (entry *CommonServiceEntry) GetName() string
Get name of entry.
func (*CommonServiceEntry) GetType ¶ added in v1.2.0
func (entry *CommonServiceEntry) GetType() string
Get entry type.
func (*CommonServiceEntry) GwErrorMapping ¶ added in v1.2.0
func (entry *CommonServiceEntry) GwErrorMapping(ctx context.Context, request *rk_grpc_common_v1.GwErrorMappingRequest) (*structpb.Struct, error)
Get error mapping file contents.
func (*CommonServiceEntry) Healthy ¶ added in v1.2.0
func (entry *CommonServiceEntry) Healthy(ctx context.Context, request *rk_grpc_common_v1.HealthyRequest) (*structpb.Struct, error)
Healthy Stub.
func (*CommonServiceEntry) Info ¶ added in v1.2.0
func (entry *CommonServiceEntry) Info(ctx context.Context, request *rk_grpc_common_v1.InfoRequest) (*structpb.Struct, error)
Info Stub.
func (*CommonServiceEntry) Interrupt ¶ added in v1.2.0
func (entry *CommonServiceEntry) Interrupt(ctx context.Context)
Interrupt common service entry
func (*CommonServiceEntry) MarshalJSON ¶ added in v1.2.0
func (entry *CommonServiceEntry) MarshalJSON() ([]byte, error)
Marshal entry.
func (*CommonServiceEntry) Readme ¶ added in v1.2.0
func (entry *CommonServiceEntry) Readme(ctx context.Context, request *rk_grpc_common_v1.ReadmeRequest) (*structpb.Struct, error)
Get README file contents.
func (*CommonServiceEntry) Req ¶ added in v1.2.0
func (entry *CommonServiceEntry) Req(ctx context.Context, request *rk_grpc_common_v1.ReqRequest) (*structpb.Struct, error)
Req Stub
func (*CommonServiceEntry) String ¶ added in v1.2.0
func (entry *CommonServiceEntry) String() string
Stringfy entry.
func (*CommonServiceEntry) Sys ¶ added in v1.2.0
func (entry *CommonServiceEntry) Sys(ctx context.Context, request *rk_grpc_common_v1.SysRequest) (*structpb.Struct, error)
Sys Stub
func (*CommonServiceEntry) UnmarshalJSON ¶ added in v1.2.0
func (entry *CommonServiceEntry) UnmarshalJSON([]byte) error
Not supported.
type CommonServiceEntryOption ¶ added in v1.2.0
type CommonServiceEntryOption func(*CommonServiceEntry)
Common service entry option function.
func WithEventLoggerEntryCommonService ¶ added in v1.2.0
func WithEventLoggerEntryCommonService(eventLoggerEntry *rkentry.EventLoggerEntry) CommonServiceEntryOption
Provide rkentry.EventLoggerEntry.
func WithNameCommonService ¶ added in v1.2.0
func WithNameCommonService(name string) CommonServiceEntryOption
Provide name.
func WithZapLoggerEntryCommonService ¶ added in v1.2.0
func WithZapLoggerEntryCommonService(zapLoggerEntry *rkentry.ZapLoggerEntry) CommonServiceEntryOption
Provide rkentry.ZapLoggerEntry.
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:"entryDescription" yaml:"entryDescription"` ZapLoggerEntry *rkentry.ZapLoggerEntry `json:"zapLoggerEntry" yaml:"zapLoggerEntry"` EventLoggerEntry *rkentry.EventLoggerEntry `json:"eventLoggerEntry" yaml:"eventLoggerEntry"` GwEntry *GwEntry `json:"gwEntry" yaml:"gwEntry"` CommonServiceEntry *CommonServiceEntry `json:"commonServiceEntry" yaml:"commonServiceEntry"` CertEntry *rkentry.CertEntry `json:"certEntry" yaml:"certEntry"` Server *grpc.Server `json:"-" yaml:"-"` Port uint64 `json:"port" yaml:"port"` ServerOpts []grpc.ServerOption `json:"-" yaml:"-"` UnaryInterceptors []grpc.UnaryServerInterceptor `json:"-" yaml:"-"` StreamInterceptors []grpc.StreamServerInterceptor `json:"-" yaml:"-"` RegFuncs []GrpcRegFunc `json:"-" yaml:"-"` Listener net.Listener `json:"-" yaml:"-"` EnableReflection bool `json:"enableReflection" yaml:"enableRefelction"` }
GrpcEntry implements rkentry.Entry interface.
1: ZapLoggerEntry: See rkentry.ZapLoggerEntry for details. 2: EventLoggerEntry: See rkentry.EventLoggerEntry for details. 3: GwEntry: See GwEntry for details. 4: CommonServiceEntry: See CommonServiceEntry for details. 5: CertEntry: See CertEntry for details. 6: Server: http.Server created while bootstrapping. 7: Port: http/https port server listen to. 8: ServerOpts: Server options for grpc. 9: UnaryInterceptors: Interceptors user enabled from YAML config. 10: StreamInterceptors: Interceptors user enabled from YAML config. 11: RegFuncs: Grpc registration functions. 12: Listener: Listener of grpc. 13: EnableReflection: Enable grpc serve reflection.
func GetGrpcEntry ¶ added in v1.2.0
Get GinEntry from rkentry.GlobalAppCtx.
func RegisterGrpcEntry ¶ added in v1.2.0
func RegisterGrpcEntry(opts ...GrpcEntryOption) *GrpcEntry
Register GrpcEntry with options.
func (*GrpcEntry) AddGrpcRegFuncs ¶ added in v1.2.0
func (entry *GrpcEntry) AddGrpcRegFuncs(funcs ...GrpcRegFunc)
Add grpc registration func.
func (*GrpcEntry) AddGwRegFuncs ¶ added in v1.2.0
Add gateway registration func.
func (*GrpcEntry) AddServerOptions ¶ added in v1.2.0
func (entry *GrpcEntry) AddServerOptions(opts ...grpc.ServerOption)
Add grpc server options.
func (*GrpcEntry) AddStreamInterceptors ¶ added in v1.2.0
func (entry *GrpcEntry) AddStreamInterceptors(inter ...grpc.StreamServerInterceptor)
Add stream interceptor.
func (*GrpcEntry) AddUnaryInterceptors ¶ added in v1.2.0
func (entry *GrpcEntry) AddUnaryInterceptors(inter ...grpc.UnaryServerInterceptor)
Add unary interceptor.
func (*GrpcEntry) GetDescription ¶ added in v1.2.0
Get description of entry.
func (*GrpcEntry) IsCommonServiceEnabled ¶ added in v1.2.0
Is common service enabled?
func (*GrpcEntry) IsGwEnabled ¶ added in v1.2.0
Is grpc gateway enabled?
func (*GrpcEntry) IsTlsEnabled ¶ added in v1.2.0
Is TLS enabled?
func (*GrpcEntry) MarshalJSON ¶ added in v1.2.0
Marshal entry.
func (*GrpcEntry) UnmarshalJSON ¶ added in v1.2.0
Not supported.
type GrpcEntryOption ¶ added in v1.2.0
type GrpcEntryOption func(*GrpcEntry)
GrpcEntry option.
func WithCertEntryGrpc ¶ added in v1.2.0
func WithCertEntryGrpc(certEntry *rkentry.CertEntry) GrpcEntryOption
Provide rkentry.CertEntry.
func WithCommonServiceEntryGrpc ¶ added in v1.2.0
func WithCommonServiceEntryGrpc(commonService *CommonServiceEntry) GrpcEntryOption
Provide CommonServiceEntry.
func WithDescriptionGrpc ¶ added in v1.2.0
func WithDescriptionGrpc(description string) GrpcEntryOption
Provide description.
func WithEnableReflectionGrpc ¶ added in v1.2.0
func WithEnableReflectionGrpc(enabled bool) GrpcEntryOption
Provice EnableReflection.
func WithEventLoggerEntryGrpc ¶ added in v1.2.0
func WithEventLoggerEntryGrpc(logger *rkentry.EventLoggerEntry) GrpcEntryOption
Provide rkentry.EventLoggerEntry
func WithGrpcRegFuncsGrpc ¶ added in v1.2.0
func WithGrpcRegFuncsGrpc(funcs ...GrpcRegFunc) GrpcEntryOption
Provide GrpcRegFunc.
func WithGwEntryGrpc ¶ added in v1.2.0
func WithGwEntryGrpc(gw *GwEntry) GrpcEntryOption
Provide GwEntry.
func WithServerOptionsGrpc ¶ added in v1.2.0
func WithServerOptionsGrpc(opts ...grpc.ServerOption) GrpcEntryOption
Provide grpc.ServerOption.
func WithStreamInterceptorsGrpc ¶ added in v1.2.0
func WithStreamInterceptorsGrpc(opts ...grpc.StreamServerInterceptor) GrpcEntryOption
Provide grpc.StreamServerInterceptor.
func WithUnaryInterceptorsGrpc ¶ added in v1.2.0
func WithUnaryInterceptorsGrpc(opts ...grpc.UnaryServerInterceptor) GrpcEntryOption
Provide grpc.UnaryServerInterceptor.
func WithZapLoggerEntryGrpc ¶ added in v1.2.0
func WithZapLoggerEntryGrpc(logger *rkentry.ZapLoggerEntry) GrpcEntryOption
Provide rkentry.ZapLoggerEntry
type GrpcRegFunc ¶ added in v1.2.0
Grpc registration func.
type GwEntry ¶ added in v1.2.0
type GwEntry struct { EntryName string `json:"entryName" yaml:"entryName"` EntryType string `json:"entryType" yaml:"entryType"` EntryDescription string `json:"entryDescription" yaml:"entryDescription"` GwMappingFilePaths []string `json:"gwMappingFilePaths" yaml:"gwMappingFilePaths"` GwMapping map[string]*gwRule `json:"gwMapping" yaml:"gwMapping"` HttpPort uint64 `json:"httpPort" yaml:"httpPort"` GrpcPort uint64 `json:"grpcPort" yaml:"grpcPort"` ZapLoggerEntry *rkentry.ZapLoggerEntry `json:"zapLoggerEntry" yaml:"zapLoggerEntry"` EventLoggerEntry *rkentry.EventLoggerEntry `json:"eventLoggerEntry" yaml:"eventLoggerEntry"` CertEntry *rkentry.CertEntry `json:"certEntry" yaml:"certEntry"` GrpcCertEntry *rkentry.CertEntry `json:"grpcCertEntry" yaml:"grpcCertEntry"` SwEntry *SwEntry `json:"swEntry" yaml:"swEntry"` TvEntry *TvEntry `json:"tvEntry" yaml:"tvEntry"` PromEntry *PromEntry `json:"promEntry" yaml:"promEntry"` CommonServiceEntry *CommonServiceEntry `json:"commonServiceEntry" yaml:"commonServiceEntry"` RegFuncsGw []GwRegFunc `json:"-" yaml:"-"` GrpcDialOptions []grpc.DialOption `json:"-" yaml:"-"` ServerMuxOptions []runtime.ServeMuxOption `json:"-" yaml:"-"` Server *http.Server `json:"-" yaml:"-"` GwMux *runtime.ServeMux `json:"-" yaml:"-"` Mux *http.ServeMux `json:"-" yaml:"-"` }
GwEntry implements rkentry.Entry interface.
1: GwMappingFilePaths: The paths of gateway mapping file, either relative or absolute path is acceptable. 2: HttpPort: Http port. 3: GrpcPort: Grpc port. 4: ZapLoggerEntry: See rkentry.ZapLoggerEntry for details. 5: EventLoggerEntry: See rkentry.EventLoggerEntry for details. 6: CertEntry: See rkentry.CertEntry for details. 7: SwEntry: See SwEntry for details. 8: TvEntry: See TvEntry for details. 9: PromEntry: See PromEntry for details. 10: CommonServiceEntry: See CommonServiceEntry for details. 11: Server: http.Server created while bootstrapping. 12: RegFuncsGw: Registration function for grpc gateway. 13: GrpcDialOptions: Grpc dial options. 14: ServerMuxOptions: Grpc gateway server options. 15: Server: http.Server for grpc gateway. 16: GwMux: runtime.ServeMux. 17: Mux: http.ServeMux.
func NewGwEntry ¶ added in v1.2.0
Create new gateway entry with options.
func (*GwEntry) GetDescription ¶ added in v1.2.0
Get description of entry.
func (*GwEntry) IsCommonServiceEnabled ¶ added in v1.2.0
Is common service enabled?
func (*GwEntry) IsGrpcTlsEnabled ¶ added in v1.2.0
Is client TLS enabled?
func (*GwEntry) IsPromEnabled ¶ added in v1.2.0
Is prometheus client enabled?
func (*GwEntry) IsServerTlsEnabled ¶ added in v1.2.0
Is server TLS enabled?
func (*GwEntry) IsSwEnabled ¶ added in v1.2.0
Is swagger enabled?
func (*GwEntry) IsTvEnabled ¶ added in v1.2.0
Is tv enabled?
func (*GwEntry) MarshalJSON ¶ added in v1.2.0
Marshal entry.
func (*GwEntry) UnmarshalJSON ¶ added in v1.2.0
Not supported.
type GwOption ¶ added in v1.2.0
type GwOption func(*GwEntry)
GwEntry option.
func WithCertEntryGw ¶ added in v1.2.0
func WithCertEntryGw(certEntry *rkentry.CertEntry) GwOption
Provide rkentry.CertEntry.
func WithCommonServiceEntryGw ¶ added in v1.2.0
func WithCommonServiceEntryGw(commonService *CommonServiceEntry) GwOption
Provide CommonServiceEntry.
func WithEventLoggerEntryGw ¶ added in v1.2.0
func WithEventLoggerEntryGw(eventLoggerEntry *rkentry.EventLoggerEntry) GwOption
Provide rkentry.EventLoggerEntry.
func WithGrpcCertEntryGw ¶ added in v1.2.0
func WithGrpcCertEntryGw(grpcCertEntry *rkentry.CertEntry) GwOption
Provide rkentry.CertEntry.
func WithGrpcDialOptionsGw ¶ added in v1.2.0
func WithGrpcDialOptionsGw(opts ...grpc.DialOption) GwOption
Provide grpc dial options.
func WithGwMappingFilePathsGw ¶ added in v1.2.0
Provide gateway mapping configuration file paths.
func WithPromEntryGw ¶ added in v1.2.0
Provide PromEntry.
func WithRegFuncsGw ¶ added in v1.2.0
Provide registration function.
func WithServerMuxOptionsGw ¶ added in v1.2.0
func WithServerMuxOptionsGw(opts ...runtime.ServeMuxOption) GwOption
Provide gateway server mux options.
func WithZapLoggerEntryGw ¶ added in v1.2.0
func WithZapLoggerEntryGw(zapLoggerEntry *rkentry.ZapLoggerEntry) GwOption
Provide rkentry.ZapLoggerEntry.
type PromEntry ¶ added in v1.2.0
type PromEntry struct { Pusher *rkprom.PushGatewayPusher `json:"pushGateWayPusher" yaml:"pushGateWayPusher"` EntryName string `json:"entryName" yaml:"entryName"` EntryType string `json:"entryType" yaml:"entryType"` EntryDescription string `json:"entryDescription" yaml:"entryDescription"` ZapLoggerEntry *rkentry.ZapLoggerEntry `json:"zapLoggerEntry" yaml:"zapLoggerEntry"` EventLoggerEntry *rkentry.EventLoggerEntry `json:"eventLoggerEntry" yaml:"eventLoggerEntry"` Port uint64 `json:"port" yaml:"port"` Path string `json:"path" yaml:"path"` Registry *prometheus.Registry `json:"-" yaml:"-"` Registerer prometheus.Registerer `json:"-" yaml:"-"` Gatherer prometheus.Gatherer `json:"-" yaml:"-"` }
Prometheus entry which implements rkentry.Entry.
1: Pusher Periodic pushGateway pusher 2: ZapLoggerEntry rkentry.ZapLoggerEntry 3: EventLoggerEntry rkentry.EventLoggerEntry 4: Port Exposed port by prom entry 5: Path Exposed path by prom entry 6: Registry Prometheus registry 7: Registerer Prometheus registerer 8: Gatherer Prometheus gatherer
func NewPromEntry ¶ added in v1.2.0
func NewPromEntry(opts ...PromEntryOption) *PromEntry
Create a prom entry with options and add prom entry to rk_ctx.GlobalAppCtx
func (*PromEntry) GetDescription ¶ added in v1.2.0
Get description of entry
func (*PromEntry) MarshalJSON ¶ added in v1.2.0
Marshal entry
func (*PromEntry) RegisterCollectors ¶ added in v1.2.0
func (entry *PromEntry) RegisterCollectors(collectors ...prometheus.Collector) error
Register collectors in default registry
func (*PromEntry) UnmarshalJSON ¶ added in v1.2.0
Unmarshal entry
type PromEntryOption ¶ added in v1.2.0
type PromEntryOption func(*PromEntry)
Prom entry option used while initializing prom entry via code
func WithEventLoggerEntryProm ¶ added in v1.2.0
func WithEventLoggerEntryProm(eventLoggerEntry *rkentry.EventLoggerEntry) PromEntryOption
rkentry.EventLoggerEntry of prom entry
func WithNameProm ¶ added in v1.2.0
func WithNameProm(name string) PromEntryOption
Name of prom entry
func WithPathProm ¶ added in v1.2.0
func WithPathProm(path string) PromEntryOption
Path of prom entry
func WithPortProm ¶ added in v1.2.0
func WithPortProm(port uint64) PromEntryOption
Port of prom entry
func WithPromRegistryProm ¶ added in v1.2.0
func WithPromRegistryProm(registry *prometheus.Registry) PromEntryOption
Provide a new prometheus registry
func WithPusherProm ¶ added in v1.2.0
func WithPusherProm(pusher *rkprom.PushGatewayPusher) PromEntryOption
PushGateway of prom entry
func WithZapLoggerEntryProm ¶ added in v1.2.0
func WithZapLoggerEntryProm(zapLoggerEntry *rkentry.ZapLoggerEntry) PromEntryOption
rkentry.ZapLoggerEntry of prom entry
type SwEntry ¶ added in v1.2.0
type SwEntry struct { EntryName string `json:"entryName" yaml:"entryName"` EntryType string `json:"entryType" yaml:"entryType"` EntryDescription string `json:"entryDescription" yaml:"entryDescription"` EventLoggerEntry *rkentry.EventLoggerEntry `json:"eventLoggerEntry" yaml:"eventLoggerEntry"` ZapLoggerEntry *rkentry.ZapLoggerEntry `json:"zapLoggerEntry" yaml:"zapLoggerEntry"` JsonPath string `json:"jsonPath" yaml:"jsonPath"` Path string `json:"path" yaml:"path"` Headers map[string]string `json:"headers" yaml:"headers"` Port uint64 `json:"port" yaml:"port"` EnableCommonService bool `json:"enableCommonService" yaml:"enableCommonService"` }
SWEntry implements rkentry.Entry interface. 1: Path: Swagger path accessible from restful API. 2: JsonPath: The path of where swagger JSON file was located. 3: Headers: The headers that would added into each API response. 4: Port: The port where swagger would listen to.
func NewSwEntry ¶ added in v1.2.0
Create new swagger entry with options.
func (*SwEntry) AssetsFileHandler ¶ added in v1.2.0
func (entry *SwEntry) AssetsFileHandler(w http.ResponseWriter, r *http.Request)
Http handler which handles assets files of swagger web UI with path prefix of /rk/v1/*
func (*SwEntry) ConfigFileHandler ¶ added in v1.2.0
func (entry *SwEntry) ConfigFileHandler(w http.ResponseWriter, r *http.Request)
Http handler which handles swagger.json files with prefix of SwEntry.Path/*
func (*SwEntry) GetDescription ¶ added in v1.2.0
Get description of entry.
func (*SwEntry) MarshalJSON ¶ added in v1.2.0
Marshal entry
func (*SwEntry) UnmarshalJSON ¶ added in v1.2.0
Unmarshal entry
type SwOption ¶ added in v1.2.0
type SwOption func(*SwEntry)
Swagger entry option.
func WithEnableCommonServiceSw ¶ added in v1.2.0
Provide rkentry.EventLoggerEntry.
func WithEventLoggerEntrySw ¶ added in v1.2.0
func WithEventLoggerEntrySw(eventLoggerEntry *rkentry.EventLoggerEntry) SwOption
Provide rkentry.EventLoggerEntry.
func WithHeadersSw ¶ added in v1.2.0
Provide headers.
func WithZapLoggerEntrySw ¶ added in v1.2.0
func WithZapLoggerEntrySw(zapLoggerEntry *rkentry.ZapLoggerEntry) SwOption
Provide rkentry.ZapLoggerEntry.
type TvEntry ¶ added in v1.2.0
type TvEntry struct { EntryName string `json:"entryName" yaml:"entryName"` EntryType string `json:"entryType" yaml:"entryType"` EntryDescription string `json:"entryDescription" yaml:"entryDescription"` ZapLoggerEntry *rkentry.ZapLoggerEntry `json:"zapLoggerEntry" yaml:"zapLoggerEntry"` EventLoggerEntry *rkentry.EventLoggerEntry `json:"eventLoggerEntry" yaml:"eventLoggerEntry"` Template *template.Template `json:"-" yaml:"-"` }
RK TV entry supports web UI for application & process information. 1: EntryName: Name of entry. 2: EntryType: Type of entry. 2: EntryDescription: Description of entry. 3: ZapLoggerEntry: ZapLoggerEntry used for logging. 4: EventLoggerEntry: EventLoggerEntry used for logging. 5: Template: GO template for rendering web UI.
func NewTvEntry ¶ added in v1.2.0
func NewTvEntry(opts ...TvEntryOption) *TvEntry
Create new TV entry with options.
func (*TvEntry) AssetsFileHandler ¶ added in v1.2.0
func (entry *TvEntry) AssetsFileHandler(w http.ResponseWriter, r *http.Request)
Handler which returns js, css, images and html files for TV web UI.
func (*TvEntry) Bootstrap ¶ added in v1.2.0
Bootstrap TV entry. Rendering bellow templates. 1: head.tmpl 2: header.tmpl 3: footer.tmpl 4: aside.tmpl 5: svg-sprite.tmpl 6: overview.tmpl 7: api.tmpl 8: entry.tmpl 9: config.tmpl 10: cert.tmpl 11: os.tmpl 12: env.tmpl 13: prometheus.tmpl 14: log.tmpl 15: dep.tmpl 16: license.tmpl 17: info.tmpl
func (*TvEntry) GetDescription ¶ added in v1.2.0
Get description of entry.
func (*TvEntry) MarshalJSON ¶ added in v1.2.0
Marshal entry
func (*TvEntry) TV ¶ added in v1.2.0
func (entry *TvEntry) TV(w http.ResponseWriter, r *http.Request)
Http handler of /rk/v1/tv/*.
func (*TvEntry) UnmarshalJSON ¶ added in v1.2.0
Not supported.
type TvEntryOption ¶ added in v1.2.0
type TvEntryOption func(entry *TvEntry)
TV entry option.
func WithEventLoggerEntryTv ¶ added in v1.2.0
func WithEventLoggerEntryTv(eventLoggerEntry *rkentry.EventLoggerEntry) TvEntryOption
Provide rkentry.EventLoggerEntry.
func WithZapLoggerEntryTv ¶ added in v1.2.0
func WithZapLoggerEntryTv(zapLoggerEntry *rkentry.ZapLoggerEntry) TvEntryOption
Provide rkentry.ZapLoggerEntry.