Documentation
¶
Index ¶
- Constants
- func BlockHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func CmdlineHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func DeleteContext(ctx *Context) error
- func Execute() error
- func GoroutineHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func HealthCheckHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func HeapHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func IndexHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func LoggerMiddleware(next httprouter.Handle) httprouter.Handle
- func MutexHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func NewAppRouter(ctx *Context) http.Handler
- func ProfileHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func SymbolHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func ThreadCreateHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func TraceHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- type Config
- type Context
- type CoreStores
- type Route
- type Store
Constants ¶
const APIVERSION string = "/v1"
APIVERSION current supported version
Variables ¶
This section is empty.
Functions ¶
func BlockHandler ¶
func BlockHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
BlockHandler will pass the call from /debug/pprof/block to pprof
func CmdlineHandler ¶
func CmdlineHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
CmdlineHandler will pass the call from /debug/pprof/cmdline to pprof
func DeleteContext ¶
DeleteContext app context and HTTP Server
func GoroutineHandler ¶
func GoroutineHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
GoroutineHandler will pass the call from /debug/pprof/goroutine to pprof
func HealthCheckHandler ¶
func HealthCheckHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
HealthCheckHandler provides health check for external monitoring applications
func HeapHandler ¶
func HeapHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
HeapHandler will pass the call from /debug/pprof/heap to pprof
func IndexHandler ¶
func IndexHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
IndexHandler will pass the call from /debug/pprof to pprof
func LoggerMiddleware ¶
func LoggerMiddleware(next httprouter.Handle) httprouter.Handle
LoggerMiddleware Handler
func MutexHandler ¶
func MutexHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
MutexHandler will pass the call from /debug/pprof/mutex to pprof
func NewAppRouter ¶
NewAppRouter registers multiple logged routes
func ProfileHandler ¶
func ProfileHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
ProfileHandler will pass the call from /debug/pprof/profile to pprof
func SymbolHandler ¶
func SymbolHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
SymbolHandler will pass the call from /debug/pprof/symbol to pprof
func ThreadCreateHandler ¶
func ThreadCreateHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
ThreadCreateHandler will pass the call from /debug/pprof/threadcreate to pprof
func TraceHandler ¶
func TraceHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
TraceHandler will pass the call from /debug/pprof/trace to pprof
Types ¶
type Config ¶
Config context for this application
func (*Config) Initialize ¶
Initialize AppConfig with sample yaml file provided above
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context stores local and aggregate stores
func CreateContext ¶
CreateContext creates and sets up context, stores and starts HTTP Server
func CreateDefaultContext ¶
CreateDefaultContext creates and sets up default context, stores and starts HTTP Server
func (*Context) InitializeStores ¶
InitializeStores initializes all the predefined store in configuration
func (*Context) ShutdownStores ¶
ShutdownStores shutsdown all the predefined store in configuration
func (*Context) SyncAggregateURLs ¶
func (ctx *Context) SyncAggregateURLs(store *CoreStores, aggregateURLs []string, syncIntervalsecs time.Duration)
SyncAggregateURLs performs sync of key values from remote stores Requires Extensive error checking, metrics, alerting
type CoreStores ¶
type CoreStores struct {
// contains filtered or unexported fields
}
CoreStores contains primary and optional backup store
type Route ¶
type Route struct {
Method string
RouteURI string
Handler httprouter.Handle
}
Route defines registration of different routes supported by app
type Store ¶
type Store struct {
Name string
Backup string
Backupdir string
AggregateURLs []string
SyncIntervalSec int
}
Store details for this application primary store is always inmemory with optional backup store along with backup directory also aggregte urls for aggregating multiple stores into the primary