Documentation ¶
Overview ¶
Package rkgin an implementation of rkentry.Entry which could be used start restful server with gin framework
Index ¶
- Constants
- Variables
- func RegisterGinEntriesWithConfig(configFilePath string) map[string]rkentry.Entry
- type BootConfigCommonService
- type BootConfigGin
- type BootConfigProm
- type BootConfigStaticHandler
- type BootConfigSw
- type BootConfigTv
- type CommonServiceEntry
- func (entry *CommonServiceEntry) Apis(ctx *gin.Context)
- func (entry *CommonServiceEntry) Bootstrap(context.Context)
- func (entry *CommonServiceEntry) Certs(ctx *gin.Context)
- func (entry *CommonServiceEntry) Configs(ctx *gin.Context)
- func (entry *CommonServiceEntry) Deps(ctx *gin.Context)
- func (entry *CommonServiceEntry) Entries(ctx *gin.Context)
- func (entry *CommonServiceEntry) Gc(ctx *gin.Context)
- func (entry *CommonServiceEntry) GetDescription() string
- func (entry *CommonServiceEntry) GetName() string
- func (entry *CommonServiceEntry) GetType() string
- func (entry *CommonServiceEntry) Git(ctx *gin.Context)
- func (entry *CommonServiceEntry) Healthy(ctx *gin.Context)
- func (entry *CommonServiceEntry) Info(ctx *gin.Context)
- func (entry *CommonServiceEntry) Interrupt(context.Context)
- func (entry *CommonServiceEntry) License(ctx *gin.Context)
- func (entry *CommonServiceEntry) Logs(ctx *gin.Context)
- func (entry *CommonServiceEntry) MarshalJSON() ([]byte, error)
- func (entry *CommonServiceEntry) Readme(ctx *gin.Context)
- func (entry *CommonServiceEntry) Req(ctx *gin.Context)
- func (entry *CommonServiceEntry) String() string
- func (entry *CommonServiceEntry) Sys(ctx *gin.Context)
- func (entry *CommonServiceEntry) UnmarshalJSON([]byte) error
- type CommonServiceEntryOption
- type GinEntry
- func (entry *GinEntry) AddInterceptor(inters ...gin.HandlerFunc)
- func (entry *GinEntry) Bootstrap(ctx context.Context)
- func (entry *GinEntry) GetDescription() string
- func (entry *GinEntry) GetName() string
- func (entry *GinEntry) GetType() string
- func (entry *GinEntry) Interrupt(ctx context.Context)
- func (entry *GinEntry) IsCommonServiceEnabled() bool
- func (entry *GinEntry) IsPromEnabled() bool
- func (entry *GinEntry) IsStaticFileHandlerEnabled() bool
- func (entry *GinEntry) IsSwEnabled() bool
- func (entry *GinEntry) IsTlsEnabled() bool
- func (entry *GinEntry) IsTvEnabled() bool
- func (entry *GinEntry) MarshalJSON() ([]byte, error)
- func (entry *GinEntry) String() string
- func (entry *GinEntry) UnmarshalJSON([]byte) error
- type GinEntryOption
- func WithCertEntryGin(certEntry *rkentry.CertEntry) GinEntryOption
- func WithCommonServiceEntryGin(commonServiceEntry *CommonServiceEntry) GinEntryOption
- func WithDescriptionGin(description string) GinEntryOption
- func WithEventLoggerEntryGin(eventLogger *rkentry.EventLoggerEntry) GinEntryOption
- func WithInterceptorsGin(inters ...gin.HandlerFunc) GinEntryOption
- func WithNameGin(name string) GinEntryOption
- func WithPortGin(port uint64) GinEntryOption
- func WithPromEntryGin(prom *PromEntry) GinEntryOption
- func WithStaticFileHandlerEntryGin(staticEntry *StaticFileHandlerEntry) GinEntryOption
- func WithSwEntryGin(sw *SwEntry) GinEntryOption
- func WithTVEntryGin(tvEntry *TvEntry) GinEntryOption
- func WithZapLoggerEntryGin(zapLogger *rkentry.ZapLoggerEntry) GinEntryOption
- 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 StaticFileHandlerEntry
- func (entry *StaticFileHandlerEntry) Bootstrap(context.Context)
- func (entry *StaticFileHandlerEntry) GetDescription() string
- func (entry *StaticFileHandlerEntry) GetFileHandler() gin.HandlerFunc
- func (entry *StaticFileHandlerEntry) GetName() string
- func (entry *StaticFileHandlerEntry) GetType() string
- func (entry *StaticFileHandlerEntry) Interrupt(context.Context)
- func (entry *StaticFileHandlerEntry) MarshalJSON() ([]byte, error)
- func (entry *StaticFileHandlerEntry) String() string
- func (entry *StaticFileHandlerEntry) UnmarshalJSON([]byte) error
- type StaticFileHandlerEntryOption
- func WithEventLoggerEntryStatic(eventLoggerEntry *rkentry.EventLoggerEntry) StaticFileHandlerEntryOption
- func WithFileSystemStatic(fs http.FileSystem) StaticFileHandlerEntryOption
- func WithNameStatic(name string) StaticFileHandlerEntryOption
- func WithPathStatic(path string) StaticFileHandlerEntryOption
- func WithZapLoggerEntryStatic(zapLoggerEntry *rkentry.ZapLoggerEntry) StaticFileHandlerEntryOption
- type SwEntry
- func (entry *SwEntry) AssetsFileHandler() gin.HandlerFunc
- func (entry *SwEntry) Bootstrap(ctx context.Context)
- func (entry *SwEntry) ConfigFileHandler() gin.HandlerFunc
- 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(enable 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() gin.HandlerFunc
- func (entry *TvEntry) Bootstrap(context.Context)
- func (entry *TvEntry) GetDescription() string
- func (entry *TvEntry) GetName() string
- func (entry *TvEntry) GetType() string
- func (entry *TvEntry) Interrupt(context.Context)
- func (entry *TvEntry) MarshalJSON() ([]byte, error)
- func (entry *TvEntry) String() string
- func (entry *TvEntry) TV(ctx *gin.Context)
- func (entry *TvEntry) UnmarshalJSON([]byte) error
- type TvEntryOption
Constants ¶
const ( // CommonServiceEntryType type of entry CommonServiceEntryType = "GinCommonServiceEntry" // CommonServiceEntryNameDefault name of entry CommonServiceEntryNameDefault = "GinCommonServiceDefault" // CommonServiceEntryDescription description of entry CommonServiceEntryDescription = "Internal RK entry which implements commonly used API with Gin framework." )
const ( // GinEntryType type of entry GinEntryType = "GinEntry" // GinEntryDescription description of entry GinEntryDescription = "Internal RK entry which helps to bootstrap with Gin framework." )
const ( // PromEntryType default entry type PromEntryType = "GinPromEntry" // PromEntryNameDefault default entry name PromEntryNameDefault = "GinPromDefault" // PromEntryDescription default entry description PromEntryDescription = "Internal RK entry which implements prometheus client with Gin framework." )
const ( // StaticFileHandlerEntryType type of entry StaticFileHandlerEntryType = "GinStaticFileHandlerEntry" // StaticFileHandlerEntryNameDefault name of entry StaticFileHandlerEntryNameDefault = "GinStaticFileHandlerDefault" // StaticFileHandlerEntryDescription description of entry StaticFileHandlerEntryDescription = "Internal RK entry which implements static file handler Gin framework." )
const ( // SwEntryType default entry type SwEntryType = "GinSwEntry" // SwEntryNameDefault default entry name SwEntryNameDefault = "GinSwDefault" // SwEntryDescription default entry description SwEntryDescription = "Internal RK entry which implements swagger with Gin framework." )
const ( // TvEntryType default entry type TvEntryType = "GinTvEntry" // TvEntryNameDefault default entry name TvEntryNameDefault = "GinTvDefault" // TvEntryDescription default entry description TvEntryDescription = "Internal RK entry which implements tv web with Gin framework." )
Variables ¶
var ( // Templates is a map to store go template Templates = map[string][]byte{} )
Functions ¶
func RegisterGinEntriesWithConfig ¶ added in v1.2.0
RegisterGinEntriesWithConfig register gin 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" json:"enabled"`
}
BootConfigCommonService Bootstrap config of common service. 1: Enabled: Enable common service.
type BootConfigGin ¶ added in v1.2.0
type BootConfigGin struct { Gin []struct { Enabled bool `yaml:"enabled" json:"enabled"` Name string `yaml:"name" json:"name"` Port uint64 `yaml:"port" json:"port"` Description string `yaml:"description" json:"description"` Cert struct { Ref string `yaml:"ref" json:"ref"` } `yaml:"cert" json:"cert"` SW BootConfigSw `yaml:"sw" json:"sw"` CommonService BootConfigCommonService `yaml:"commonService" json:"commonService"` TV BootConfigTv `yaml:"tv" json:"tv"` Prom BootConfigProm `yaml:"prom" json:"prom"` Static BootConfigStaticHandler `yaml:"static" json:"static"` 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"` Cors struct { Enabled bool `yaml:"enabled" json:"enabled"` AllowOrigins []string `yaml:"allowOrigins" json:"allowOrigins"` AllowCredentials bool `yaml:"allowCredentials" json:"allowCredentials"` AllowHeaders []string `yaml:"allowHeaders" json:"allowHeaders"` AllowMethods []string `yaml:"allowMethods" json:"allowMethods"` ExposeHeaders []string `yaml:"exposeHeaders" json:"exposeHeaders"` MaxAge int `yaml:"maxAge" json:"maxAge"` } `yaml:"cors" json:"cors"` Meta struct { Enabled bool `yaml:"enabled" json:"enabled"` Prefix string `yaml:"prefix" json:"prefix"` } `yaml:"meta" json:"meta"` Jwt struct { Enabled bool `yaml:"enabled" json:"enabled"` IgnorePrefix []string `yaml:"ignorePrefix" json:"ignorePrefix"` SigningKey string `yaml:"signingKey" json:"signingKey"` SigningKeys []string `yaml:"signingKeys" json:"signingKeys"` SigningAlgo string `yaml:"signingAlgo" json:"signingAlgo"` TokenLookup string `yaml:"tokenLookup" json:"tokenLookup"` AuthScheme string `yaml:"authScheme" json:"authScheme"` } `yaml:"jwt" json:"jwt"` Secure struct { Enabled bool `yaml:"enabled" json:"enabled"` IgnorePrefix []string `yaml:"ignorePrefix" json:"ignorePrefix"` XssProtection string `yaml:"xssProtection" json:"xssProtection"` ContentTypeNosniff string `yaml:"contentTypeNosniff" json:"contentTypeNosniff"` XFrameOptions string `yaml:"xFrameOptions" json:"xFrameOptions"` HstsMaxAge int `yaml:"hstsMaxAge" json:"hstsMaxAge"` HstsExcludeSubdomains bool `yaml:"hstsExcludeSubdomains" json:"hstsExcludeSubdomains"` HstsPreloadEnabled bool `yaml:"hstsPreloadEnabled" json:"hstsPreloadEnabled"` ContentSecurityPolicy string `yaml:"contentSecurityPolicy" json:"contentSecurityPolicy"` CspReportOnly bool `yaml:"cspReportOnly" json:"cspReportOnly"` ReferrerPolicy string `yaml:"referrerPolicy" json:"referrerPolicy"` } `yaml:"secure" json:"secure"` RateLimit struct { Enabled bool `yaml:"enabled" json:"enabled"` Algorithm string `yaml:"algorithm" json:"algorithm"` ReqPerSec int `yaml:"reqPerSec" json:"reqPerSec"` Paths []struct { Path string `yaml:"path" json:"path"` ReqPerSec int `yaml:"reqPerSec" json:"reqPerSec"` } `yaml:"paths" json:"paths"` } `yaml:"rateLimit" json:"rateLimit"` Csrf struct { Enabled bool `yaml:"enabled" json:"enabled"` IgnorePrefix []string `yaml:"ignorePrefix" json:"ignorePrefix"` TokenLength int `yaml:"tokenLength" json:"tokenLength"` TokenLookup string `yaml:"tokenLookup" json:"tokenLookup"` CookieName string `yaml:"cookieName" json:"cookieName"` CookieDomain string `yaml:"cookieDomain" json:"cookieDomain"` CookiePath string `yaml:"cookiePath" json:"cookiePath"` CookieMaxAge int `yaml:"cookieMaxAge" json:"cookieMaxAge"` CookieHttpOnly bool `yaml:"cookieHttpOnly" json:"cookieHttpOnly"` CookieSameSite string `yaml:"cookieSameSite" json:"cookieSameSite"` } `yaml:"csrf" yaml:"csrf"` Gzip struct { Enabled bool `yaml:"enabled" json:"enabled"` Level string `yaml:"level" json:"level"` } `yaml:"gzip" json:"gzip"` Timeout struct { Enabled bool `yaml:"enabled" json:"enabled"` TimeoutMs int `yaml:"timeoutMs" json:"timeoutMs"` Paths []struct { Path string `yaml:"path" json:"path"` TimeoutMs int `yaml:"timeoutMs" json:"timeoutMs"` } `yaml:"paths" json:"paths"` } `yaml:"timeout" json:"timeout"` 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 { Agent struct { Enabled bool `yaml:"enabled" json:"enabled"` Host string `yaml:"host" json:"host"` Port int `yaml:"port" json:"port"` } `yaml:"agent" json:"agent"` Collector struct { Enabled bool `yaml:"enabled" json:"enabled"` Endpoint string `yaml:"endpoint" json:"endpoint"` Username string `yaml:"username" json:"username"` Password string `yaml:"password" json:"password"` } `yaml:"collector" json:"collector"` } `yaml:"jaeger" json:"jaeger"` } `yaml:"exporter" json:"exporter"` } `yaml:"tracingTelemetry" json:"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:"gin" json:"gin"` }
BootConfigGin boot config which is for gin entry.
1: Gin.Enabled: Enable gin entry, default is true. 2: Gin.Name: Name of gin entry, should be unique globally. 3: Gin.Port: Port of gin entry. 4: Gin.Cert.Ref: Reference of rkentry.CertEntry. 5: Gin.SW: See BootConfigSW for details. 6: Gin.CommonService: See BootConfigCommonService for details. 7: Gin.TV: See BootConfigTv for details. 8: Gin.Prom: See BootConfigProm for details. 9: Gin.Interceptors.LoggingZap.Enabled: Enable zap logging interceptor. 10: Gin.Interceptors.MetricsProm.Enable: Enable prometheus interceptor. 11: Gin.Interceptors.auth.Enabled: Enable basic auth. 12: Gin.Interceptors.auth.Basic: Credential for basic auth, scheme: <user:pass> 13: Gin.Interceptors.auth.ApiKey: Credential for X-API-Key. 14: Gin.Interceptors.auth.igorePrefix: List of paths that will be ignored. 15: Gin.Interceptors.Extension.Enabled: Enable extension interceptor. 16: Gin.Interceptors.Extension.Prefix: Prefix of extension header key. 17: Gin.Interceptors.TracingTelemetry.Enabled: Enable tracing interceptor with opentelemetry. 18: Gin.Interceptors.TracingTelemetry.Exporter.File.Enabled: Enable file exporter which support type of stdout and local file. 19: Gin.Interceptors.TracingTelemetry.Exporter.File.OutputPath: Output path of file exporter, stdout and file path is supported. 20: Gin.Interceptors.TracingTelemetry.Exporter.Jaeger.Enabled: Enable jaeger exporter. 21: Gin.Interceptors.TracingTelemetry.Exporter.Jaeger.AgentEndpoint: Specify jeager agent endpoint, localhost:6832 would be used by default. 22: Gin.Interceptors.RateLimit.Enabled: Enable rate limit interceptor. 23: Gin.Interceptors.RateLimit.Algorithm: Algorithm of rate limiter. 24: Gin.Interceptors.RateLimit.ReqPerSec: Request per second. 25: Gin.Interceptors.RateLimit.Paths.path: Name of full path. 26: Gin.Interceptors.RateLimit.Paths.ReqPerSec: Request per second by path. 27: Gin.Interceptors.Timeout.Enabled: Enable timeout interceptor. 28: Gin.Interceptors.Timeout.TimeoutMs: Timeout in milliseconds. 29: Gin.Interceptors.Timeout.Paths.path: Name of full path. 30: Gin.Interceptors.Timeout.Paths.TimeoutMs: Timeout in milliseconds by path. 31: Gin.Logger.ZapLogger.Ref: Zap logger reference, see rkentry.ZapLoggerEntry for details. 32: Gin.Logger.EventLogger.Ref: Event logger reference, see rkentry.EventLoggerEntry for details.
type BootConfigProm ¶ added in v1.2.0
type BootConfigProm struct { Path string `yaml:"path" json:"path"` Enabled bool `yaml:"enabled" json:"enabled"` Pusher struct { Enabled bool `yaml:"enabled" json:"enabled"` IntervalMs int64 `yaml:"IntervalMs" json:"IntervalMs"` JobName string `yaml:"jobName" json:"jobName"` RemoteAddress string `yaml:"remoteAddress" json:"remoteAddress"` BasicAuth string `yaml:"basicAuth" json:"basicAuth"` Cert struct { Ref string `yaml:"ref" json:"ref"` } `yaml:"cert" json:"cert"` } `yaml:"pusher" json:"pusher"` }
BootConfigProm 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. 9: Cert.Ref: Reference of rkentry.CertEntry.
type BootConfigStaticHandler ¶ added in v1.2.11
type BootConfigStaticHandler struct { Enabled bool `yaml:"enabled" json:"enabled"` Path string `yaml:"path" json:"path"` SourceType string `yaml:"sourceType" json:"sourceType"` SourcePath string `yaml:"sourcePath" json:"sourcePath"` }
BootConfigStaticHandler bootstrap config of StaticHandler.
type BootConfigSw ¶ added in v1.2.0
type BootConfigSw struct { Enabled bool `yaml:"enabled" yaml:"enabled"` Path string `yaml:"path" yaml:"path"` JsonPath string `yaml:"jsonPath" yaml:"jsonPath"` Headers []string `yaml:"headers" yaml:"headers"` }
BootConfigSw 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"`
}
BootConfigTv 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:"-" yaml:"-"` EventLoggerEntry *rkentry.EventLoggerEntry `json:"-" yaml:"-"` ZapLoggerEntry *rkentry.ZapLoggerEntry `json:"-" yaml:"-"` }
CommonServiceEntry RK common service which contains commonly used APIs 1: Healthy Returns true if process is alive 2: Gc Trigger gc() 3: Info Returns entry basic information 4: Configs Returns viper configs in GlobalAppCtx 5: Apis Returns list of apis registered in gin router 6: Sys Returns CPU and Memory information 7: Req Returns request metrics 8: Certs Returns certificates 9: Entries Returns entries 10: Logs Returns log entries 12: Deps Returns dependency which is full go.mod file content 13: License Returns license file content 14: Readme Returns README file content
func NewCommonServiceEntry ¶ added in v1.2.0
func NewCommonServiceEntry(opts ...CommonServiceEntryOption) *CommonServiceEntry
NewCommonServiceEntry Create new common service entry with options.
func (*CommonServiceEntry) Apis ¶ added in v1.2.0
func (entry *CommonServiceEntry) Apis(ctx *gin.Context)
Apis handler @Summary List API @Id 5 @version 1.0 @Security ApiKeyAuth @Security BasicAuth @Security JWT @produce application/json @Success 200 {object} rkentry.ApisResponse @Router /rk/v1/apis [get]
func (*CommonServiceEntry) Bootstrap ¶ added in v1.2.0
func (entry *CommonServiceEntry) Bootstrap(context.Context)
Bootstrap common service entry.
func (*CommonServiceEntry) Certs ¶ added in v1.2.0
func (entry *CommonServiceEntry) Certs(ctx *gin.Context)
Certs handler @Summary List CertEntry @Id 9 @version 1.0 @Security ApiKeyAuth @Security BasicAuth @Security JWT @produce application/json @Success 200 {object} rkentry.CertsResponse @Router /rk/v1/certs [get]
func (*CommonServiceEntry) Configs ¶ added in v1.2.0
func (entry *CommonServiceEntry) Configs(ctx *gin.Context)
Configs handler @Summary List ConfigEntry @Id 4 @version 1.0 @Security ApiKeyAuth @Security BasicAuth @Security JWT @produce application/json @Success 200 {object} rkentry.ConfigsResponse @Router /rk/v1/configs [get]
func (*CommonServiceEntry) Deps ¶ added in v1.2.0
func (entry *CommonServiceEntry) Deps(ctx *gin.Context)
Deps handler @Summary List dependencies related application @Id 11 @version 1.0 @Security ApiKeyAuth @Security BasicAuth @Security JWT @produce application/json @Success 200 {object} rkentry.DepResponse @Router /rk/v1/deps [get]
func (*CommonServiceEntry) Entries ¶ added in v1.2.0
func (entry *CommonServiceEntry) Entries(ctx *gin.Context)
Entries handler @Summary List all Entry @Id 8 @version 1.0 @Security ApiKeyAuth @Security BasicAuth @Security JWT @produce application/json @Success 200 {object} rkentry.EntriesResponse @Router /rk/v1/entries [get]
func (*CommonServiceEntry) Gc ¶ added in v1.2.0
func (entry *CommonServiceEntry) Gc(ctx *gin.Context)
Gc handler @Summary Trigger Gc @Id 2 @version 1.0 @Security ApiKeyAuth @Security BasicAuth @Security JWT @produce application/json @Success 200 {object} rkentry.GcResponse @Router /rk/v1/gc [get]
func (*CommonServiceEntry) GetDescription ¶ added in v1.2.0
func (entry *CommonServiceEntry) GetDescription() string
GetDescription Get description of entry.
func (*CommonServiceEntry) GetName ¶ added in v1.2.0
func (entry *CommonServiceEntry) GetName() string
GetName Get name of entry.
func (*CommonServiceEntry) GetType ¶ added in v1.2.0
func (entry *CommonServiceEntry) GetType() string
GetType Get entry type.
func (*CommonServiceEntry) Git ¶ added in v1.2.0
func (entry *CommonServiceEntry) Git(ctx *gin.Context)
Git handler @Summary Get Git information. @Id 14 @version 1.0 @Security ApiKeyAuth @Security BasicAuth @Security JWT @produce application/json @Success 200 {object} rkentry.GitResponse @Router /rk/v1/git [get]
func (*CommonServiceEntry) Healthy ¶ added in v1.2.0
func (entry *CommonServiceEntry) Healthy(ctx *gin.Context)
Healthy handler @Summary Get application healthy status @Id 1 @version 1.0 @Security ApiKeyAuth @Security BasicAuth @Security JWT @produce application/json @Success 200 {object} rkentry.HealthyResponse @Router /rk/v1/healthy [get]
func (*CommonServiceEntry) Info ¶ added in v1.2.0
func (entry *CommonServiceEntry) Info(ctx *gin.Context)
Info handler @Summary Get application and process info @Id 3 @version 1.0 @Security ApiKeyAuth @Security BasicAuth @Security JWT @produce application/json @Success 200 {object} rkentry.ProcessInfo @Router /rk/v1/info [get]
func (*CommonServiceEntry) Interrupt ¶ added in v1.2.0
func (entry *CommonServiceEntry) Interrupt(context.Context)
Interrupt common service entry.
func (*CommonServiceEntry) License ¶ added in v1.2.0
func (entry *CommonServiceEntry) License(ctx *gin.Context)
License handler @Summary Get license related application @Id 12 @version 1.0 @Security ApiKeyAuth @Security BasicAuth @Security JWT @produce application/json @Success 200 {object} rkentry.LicenseResponse @Router /rk/v1/license [get]
func (*CommonServiceEntry) Logs ¶ added in v1.2.0
func (entry *CommonServiceEntry) Logs(ctx *gin.Context)
Logs handler @Summary List logger related entries @Id 10 @version 1.0 @Security ApiKeyAuth @Security BasicAuth @Security JWT @produce application/json @Success 200 {object} rkentry.LogsResponse @Router /rk/v1/logs [get]
func (*CommonServiceEntry) MarshalJSON ¶ added in v1.2.0
func (entry *CommonServiceEntry) MarshalJSON() ([]byte, error)
MarshalJSON Marshal entry.
func (*CommonServiceEntry) Readme ¶ added in v1.2.0
func (entry *CommonServiceEntry) Readme(ctx *gin.Context)
Readme handler @Summary Get README file. @Id 13 @version 1.0 @Security ApiKeyAuth @Security BasicAuth @Security JWT @produce application/json @Success 200 {object} rkentry.ReadmeResponse @Router /rk/v1/readme [get]
func (*CommonServiceEntry) Req ¶ added in v1.2.0
func (entry *CommonServiceEntry) Req(ctx *gin.Context)
Req handler @Summary List prometheus metrics of requests @Id 7 @version 1.0 @Security ApiKeyAuth @Security BasicAuth @Security JWT @produce application/json @success 200 {object} rkentry.ReqResponse @Router /rk/v1/req [get]
func (*CommonServiceEntry) String ¶ added in v1.2.0
func (entry *CommonServiceEntry) String() string
String Stringfy entry.
func (*CommonServiceEntry) Sys ¶ added in v1.2.0
func (entry *CommonServiceEntry) Sys(ctx *gin.Context)
Sys handler @Summary Get OS Stat @Id 6 @version 1.0 @Security ApiKeyAuth @Security BasicAuth @Security JWT @produce application/json @Success 200 {object} rkentry.SysResponse @Router /rk/v1/sys [get]
func (*CommonServiceEntry) UnmarshalJSON ¶ added in v1.2.0
func (entry *CommonServiceEntry) UnmarshalJSON([]byte) error
UnmarshalJSON Not supported.
type CommonServiceEntryOption ¶ added in v1.2.0
type CommonServiceEntryOption func(*CommonServiceEntry)
CommonServiceEntryOption Common service entry option.
func WithEventLoggerEntryCommonService ¶ added in v1.2.0
func WithEventLoggerEntryCommonService(eventLoggerEntry *rkentry.EventLoggerEntry) CommonServiceEntryOption
WithEventLoggerEntryCommonService Provide rkentry.EventLoggerEntry.
func WithNameCommonService ¶ added in v1.2.0
func WithNameCommonService(name string) CommonServiceEntryOption
WithNameCommonService Provide name.
func WithZapLoggerEntryCommonService ¶ added in v1.2.0
func WithZapLoggerEntryCommonService(zapLoggerEntry *rkentry.ZapLoggerEntry) CommonServiceEntryOption
WithZapLoggerEntryCommonService Provide rkentry.ZapLoggerEntry.
type GinEntry ¶
type GinEntry 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:"-"` Router *gin.Engine `json:"-" yaml:"-"` Server *http.Server `json:"-" yaml:"-"` Port uint64 `json:"port" yaml:"port"` Interceptors []gin.HandlerFunc `json:"-" yaml:"-"` SwEntry *SwEntry `json:"-" yaml:"-"` CertEntry *rkentry.CertEntry `json:"-" yaml:"-"` CommonServiceEntry *CommonServiceEntry `json:"-" yaml:"-"` PromEntry *PromEntry `json:"-" yaml:"-"` StaticFileEntry *StaticFileHandlerEntry `json:"-" yaml:"-"` TvEntry *TvEntry `json:"-" yaml:"-"` }
GinEntry implements rkentry.Entry interface.
1: ZapLoggerEntry: See rkentry.ZapLoggerEntry for details. 2: EventLoggerEntry: See rkentry.EventLoggerEntry for details. 3: Router: gin.Engine created while bootstrapping. 4: Server: http.Server created while bootstrapping. 5: Port: http/https port server listen to. 6: Interceptors: Interceptors user enabled from YAML config, by default, rkginpanic.PanicInterceptor would be injected. 7: SwEntry: See SWEntry for details. 8: CertEntry: See CertEntry for details.. 9: CommonServiceEntry: See CommonServiceEntry for details. 10: PromEntry: See PromEntry for details. 11: TvEntry: See TvEntry for details.
func GetGinEntry ¶ added in v1.2.0
GetGinEntry Get GinEntry from rkentry.GlobalAppCtx.
func RegisterGinEntry ¶ added in v1.2.0
func RegisterGinEntry(opts ...GinEntryOption) *GinEntry
RegisterGinEntry register GinEntry with options.
func (*GinEntry) AddInterceptor ¶ added in v1.2.0
func (entry *GinEntry) AddInterceptor(inters ...gin.HandlerFunc)
AddInterceptor Add interceptors. This function should be called before Bootstrap() called.
func (*GinEntry) GetDescription ¶ added in v1.2.0
GetDescription Get description of entry.
func (*GinEntry) IsCommonServiceEnabled ¶ added in v1.2.0
IsCommonServiceEnabled Is common service entry enabled?
func (*GinEntry) IsPromEnabled ¶ added in v1.2.0
IsPromEnabled Is prometheus entry enabled?
func (*GinEntry) IsStaticFileHandlerEnabled ¶ added in v1.2.11
IsStaticFileHandlerEnabled Is static file handler entry enabled?
func (*GinEntry) IsSwEnabled ¶ added in v1.2.0
IsSwEnabled Is swagger entry enabled?
func (*GinEntry) IsTlsEnabled ¶ added in v1.1.3
IsTlsEnabled Is TLS enabled?
func (*GinEntry) IsTvEnabled ¶ added in v1.2.0
IsTvEnabled Is TV entry enabled?
func (*GinEntry) MarshalJSON ¶ added in v1.2.0
MarshalJSON Marshal entry.
func (*GinEntry) UnmarshalJSON ¶ added in v1.2.0
UnmarshalJSON Not supported.
type GinEntryOption ¶
type GinEntryOption func(*GinEntry)
GinEntryOption Gin entry option.
func WithCertEntryGin ¶ added in v1.2.0
func WithCertEntryGin(certEntry *rkentry.CertEntry) GinEntryOption
WithCertEntryGin provide rkentry.CertEntry.
func WithCommonServiceEntryGin ¶ added in v1.2.0
func WithCommonServiceEntryGin(commonServiceEntry *CommonServiceEntry) GinEntryOption
WithCommonServiceEntryGin provide CommonServiceEntry.
func WithDescriptionGin ¶ added in v1.2.0
func WithDescriptionGin(description string) GinEntryOption
WithDescriptionGin provide name.
func WithEventLoggerEntryGin ¶ added in v1.2.0
func WithEventLoggerEntryGin(eventLogger *rkentry.EventLoggerEntry) GinEntryOption
WithEventLoggerEntryGin provide rkentry.EventLoggerEntry.
func WithInterceptorsGin ¶ added in v1.2.0
func WithInterceptorsGin(inters ...gin.HandlerFunc) GinEntryOption
WithInterceptorsGin provide user interceptors.
func WithNameGin ¶ added in v1.2.0
func WithNameGin(name string) GinEntryOption
WithNameGin provide name.
func WithPortGin ¶ added in v1.2.0
func WithPortGin(port uint64) GinEntryOption
WithPortGin provide port.
func WithPromEntryGin ¶ added in v1.2.0
func WithPromEntryGin(prom *PromEntry) GinEntryOption
WithPromEntryGin provide PromEntry.
func WithStaticFileHandlerEntryGin ¶ added in v1.2.11
func WithStaticFileHandlerEntryGin(staticEntry *StaticFileHandlerEntry) GinEntryOption
WithStaticFileHandlerEntryGin provide StaticFileHandlerEntry.
func WithSwEntryGin ¶ added in v1.2.0
func WithSwEntryGin(sw *SwEntry) GinEntryOption
WithSwEntryGin provide SwEntry.
func WithTVEntryGin ¶ added in v1.2.0
func WithTVEntryGin(tvEntry *TvEntry) GinEntryOption
WithTVEntryGin provide TvEntry.
func WithZapLoggerEntryGin ¶ added in v1.2.0
func WithZapLoggerEntryGin(zapLogger *rkentry.ZapLoggerEntry) GinEntryOption
WithZapLoggerEntryGin provide rkentry.ZapLoggerEntry.
type PromEntry ¶ added in v1.2.0
type PromEntry struct { Pusher *rkprom.PushGatewayPusher `json:"-" yaml:"-"` 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"` Path string `json:"path" yaml:"path"` Registry *prometheus.Registry `json:"-" yaml:"-"` Registerer prometheus.Registerer `json:"-" yaml:"-"` Gatherer prometheus.Gatherer `json:"-" yaml:"-"` }
PromEntry 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
NewPromEntry Create a prom entry with options and add prom entry to rk_ctx.GlobalAppCtx
func (*PromEntry) GetDescription ¶ added in v1.2.0
GetDescription Get description of entry
func (*PromEntry) MarshalJSON ¶ added in v1.2.0
MarshalJSON Marshal entry
func (*PromEntry) RegisterCollectors ¶ added in v1.2.0
func (entry *PromEntry) RegisterCollectors(collectors ...prometheus.Collector) error
RegisterCollectors Register collectors in default registry
func (*PromEntry) UnmarshalJSON ¶ added in v1.2.0
UnmarshalJSON Unmarshal entry
type PromEntryOption ¶ added in v1.2.0
type PromEntryOption func(*PromEntry)
PromEntryOption Prom entry option used while initializing prom entry via code
func WithEventLoggerEntryProm ¶ added in v1.2.0
func WithEventLoggerEntryProm(eventLoggerEntry *rkentry.EventLoggerEntry) PromEntryOption
WithEventLoggerEntryProm rkentry.EventLoggerEntry of prom entry
func WithNameProm ¶ added in v1.2.0
func WithNameProm(name string) PromEntryOption
WithNameProm Name of prom entry
func WithPathProm ¶ added in v1.2.0
func WithPathProm(path string) PromEntryOption
WithPathProm Path of prom entry
func WithPortProm ¶ added in v1.2.0
func WithPortProm(port uint64) PromEntryOption
WithPortProm Port of prom entry
func WithPromRegistryProm ¶ added in v1.2.0
func WithPromRegistryProm(registry *prometheus.Registry) PromEntryOption
WithPromRegistryProm Provide a new prometheus registry
func WithPusherProm ¶ added in v1.2.0
func WithPusherProm(pusher *rkprom.PushGatewayPusher) PromEntryOption
WithPusherProm PushGateway of prom entry
func WithZapLoggerEntryProm ¶ added in v1.2.0
func WithZapLoggerEntryProm(zapLoggerEntry *rkentry.ZapLoggerEntry) PromEntryOption
WithZapLoggerEntryProm rkentry.ZapLoggerEntry of prom entry
type StaticFileHandlerEntry ¶ added in v1.2.11
type StaticFileHandlerEntry struct { EntryName string `yaml:"entryName" json:"entryName"` EntryType string `yaml:"entryType" json:"entryType"` EntryDescription string `yaml:"-" json:"-"` Path string `yaml:"path" json:"path"` EventLoggerEntry *rkentry.EventLoggerEntry `json:"-" yaml:"-"` ZapLoggerEntry *rkentry.ZapLoggerEntry `json:"-" yaml:"-"` Fs http.FileSystem `yaml:"-" json:"-"` Template *template.Template `json:"-" yaml:"-"` }
StaticFileHandlerEntry Static file handler entry supports web UI for downloading static files.
func NewStaticFileHandlerEntry ¶ added in v1.2.11
func NewStaticFileHandlerEntry(opts ...StaticFileHandlerEntryOption) *StaticFileHandlerEntry
NewStaticFileHandlerEntry Create new static file handler entry with options.
func (*StaticFileHandlerEntry) Bootstrap ¶ added in v1.2.11
func (entry *StaticFileHandlerEntry) Bootstrap(context.Context)
Bootstrap entry.
func (*StaticFileHandlerEntry) GetDescription ¶ added in v1.2.11
func (entry *StaticFileHandlerEntry) GetDescription() string
GetDescription Get description of entry.
func (*StaticFileHandlerEntry) GetFileHandler ¶ added in v1.2.11
func (entry *StaticFileHandlerEntry) GetFileHandler() gin.HandlerFunc
GetFileHandler handles requests sent from user.
func (*StaticFileHandlerEntry) GetName ¶ added in v1.2.11
func (entry *StaticFileHandlerEntry) GetName() string
GetName Get name of entry.
func (*StaticFileHandlerEntry) GetType ¶ added in v1.2.11
func (entry *StaticFileHandlerEntry) GetType() string
GetType Get entry type.
func (*StaticFileHandlerEntry) Interrupt ¶ added in v1.2.11
func (entry *StaticFileHandlerEntry) Interrupt(context.Context)
Interrupt entry.
func (*StaticFileHandlerEntry) MarshalJSON ¶ added in v1.2.11
func (entry *StaticFileHandlerEntry) MarshalJSON() ([]byte, error)
MarshalJSON Marshal entry.
func (*StaticFileHandlerEntry) String ¶ added in v1.2.11
func (entry *StaticFileHandlerEntry) String() string
String Stringfy entry.
func (*StaticFileHandlerEntry) UnmarshalJSON ¶ added in v1.2.11
func (entry *StaticFileHandlerEntry) UnmarshalJSON([]byte) error
UnmarshalJSON Not supported.
type StaticFileHandlerEntryOption ¶ added in v1.2.11
type StaticFileHandlerEntryOption func(*StaticFileHandlerEntry)
StaticFileHandlerEntryOption StaticFileHandlerEntry option.
func WithEventLoggerEntryStatic ¶ added in v1.2.11
func WithEventLoggerEntryStatic(eventLoggerEntry *rkentry.EventLoggerEntry) StaticFileHandlerEntryOption
WithEventLoggerEntryCommonService Provide rkentry.EventLoggerEntry.
func WithFileSystemStatic ¶ added in v1.2.11
func WithFileSystemStatic(fs http.FileSystem) StaticFileHandlerEntryOption
WithFileSystemStatic Provide file system implementation.
func WithNameStatic ¶ added in v1.2.11
func WithNameStatic(name string) StaticFileHandlerEntryOption
WithNameStatic Provide name.
func WithPathStatic ¶ added in v1.2.11
func WithPathStatic(path string) StaticFileHandlerEntryOption
WithEventLoggerEntryCommonService Provide path.
func WithZapLoggerEntryStatic ¶ added in v1.2.11
func WithZapLoggerEntryStatic(zapLoggerEntry *rkentry.ZapLoggerEntry) StaticFileHandlerEntryOption
WithZapLoggerEntryCommonService Provide rkentry.ZapLoggerEntry.
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:"-" yaml:"-"` EventLoggerEntry *rkentry.EventLoggerEntry `json:"-" yaml:"-"` ZapLoggerEntry *rkentry.ZapLoggerEntry `json:"-" yaml:"-"` JsonPath string `json:"jsonPath" yaml:"jsonPath"` Path string `json:"path" yaml:"path"` Headers map[string]string `json:"-" yaml:"-"` Port uint64 `json:"port" yaml:"port"` EnableCommonService bool `json:"-" yaml:"-"` }
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. 5: EnableCommonService: Enable common service in swagger.
func NewSwEntry ¶ added in v1.2.0
NewSwEntry Create new swagger entry with options.
func (*SwEntry) AssetsFileHandler ¶ added in v1.2.0
func (entry *SwEntry) AssetsFileHandler() gin.HandlerFunc
AssetsFileHandler Handler for swagger assets files.
func (*SwEntry) ConfigFileHandler ¶ added in v1.2.0
func (entry *SwEntry) ConfigFileHandler() gin.HandlerFunc
ConfigFileHandler handler for swagger config files.
func (*SwEntry) GetDescription ¶ added in v1.2.0
GetDescription Get description of entry
func (*SwEntry) MarshalJSON ¶ added in v1.2.0
MarshalJSON Marshal entry
func (*SwEntry) UnmarshalJSON ¶ added in v1.2.0
UnmarshalJSON Unmarshal entry
type SwOption ¶ added in v1.2.0
type SwOption func(*SwEntry)
SwOption Swagger entry option.
func WithEnableCommonServiceSw ¶ added in v1.2.0
WithEnableCommonServiceSw Provide enable common service option.
func WithEventLoggerEntrySw ¶ added in v1.2.0
func WithEventLoggerEntrySw(eventLoggerEntry *rkentry.EventLoggerEntry) SwOption
WithEventLoggerEntrySw Provide rkentry.EventLoggerEntry.
func WithHeadersSw ¶ added in v1.2.0
WithHeadersSw Provide headers.
func WithJsonPathSw ¶ added in v1.2.0
WithJsonPathSw Provide JsonPath.
func WithZapLoggerEntrySw ¶ added in v1.2.0
func WithZapLoggerEntrySw(zapLoggerEntry *rkentry.ZapLoggerEntry) SwOption
WithZapLoggerEntrySw 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:"-" yaml:"-"` ZapLoggerEntry *rkentry.ZapLoggerEntry `json:"-" yaml:"-"` EventLoggerEntry *rkentry.EventLoggerEntry `json:"-" yaml:"-"` Template *template.Template `json:"-" yaml:"-"` }
TvEntry 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
NewTvEntry Create new TV entry with options.
func (*TvEntry) AssetsFileHandler ¶ added in v1.2.0
func (entry *TvEntry) AssetsFileHandler() gin.HandlerFunc
AssetsFileHandler 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: apis.tmpl 8: entries.tmpl 9: configs.tmpl 10: certs.tmpl 11: os.tmpl 12: env.tmpl 13: prometheus.tmpl 14: logs.tmpl 15: deps.tmpl 16: license.tmpl 17: info.tmpl
func (*TvEntry) GetDescription ¶ added in v1.2.0
GetDescription Get description of entry.
func (*TvEntry) MarshalJSON ¶ added in v1.2.0
MarshalJSON Marshal entry
func (*TvEntry) TV ¶ added in v1.2.0
TV handler @Summary Get HTML page of /tv @Id 15 @version 1.0 @Security ApiKeyAuth @Security BasicAuth @produce text/html @Success 200 string HTML @Router /rk/v1/tv [get]
func (*TvEntry) UnmarshalJSON ¶ added in v1.2.0
UnmarshalJSON Not supported.
type TvEntryOption ¶ added in v1.2.0
type TvEntryOption func(entry *TvEntry)
TvEntryOption TV entry option.
func WithEventLoggerEntryTv ¶ added in v1.2.0
func WithEventLoggerEntryTv(eventLoggerEntry *rkentry.EventLoggerEntry) TvEntryOption
WithEventLoggerEntryTv Provide rkentry.EventLoggerEntry.
func WithNameTv ¶ added in v1.2.0
func WithNameTv(name string) TvEntryOption
WithNameTv Provide name.
func WithZapLoggerEntryTv ¶ added in v1.2.0
func WithZapLoggerEntryTv(zapLoggerEntry *rkentry.ZapLoggerEntry) TvEntryOption
WithZapLoggerEntryTv Provide rkentry.ZapLoggerEntry.