Documentation ¶
Index ¶
- Constants
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetFS() *assetfs.AssetFS
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func DiagGetPProf(w http.ResponseWriter, profile string, debug int)
- func DocIDFromBody(req *http.Request) string
- func DocIDLookup(req *http.Request) string
- func ExtractSourceTypeName(req *http.Request, indexDef *cbgt.IndexDef, indexName string) (string, string)
- func IndexNameLookup(req *http.Request) string
- func InitRESTRouter(r *mux.Router, versionMain string, mgr *cbgt.Manager, ...) (*mux.Router, map[string]RESTMeta, error)
- func InitRESTRouterEx(r *mux.Router, versionMain string, mgr *cbgt.Manager, ...) (*mux.Router, map[string]RESTMeta, error)
- func InitStaticRouter(r *mux.Router, staticDir, staticETag string, pages []string, ...) *mux.Router
- func InitStaticRouterEx(r *mux.Router, staticDir, staticETag string, pages []string, ...) *mux.Router
- func MustAsset(name string) []byte
- func MustEncode(w io.Writer, i interface{})
- func MuxVariableLookup(req *http.Request, name string) string
- func NewRESTRouter(versionMain string, mgr *cbgt.Manager, staticDir, staticETag string, ...) (*mux.Router, map[string]RESTMeta, error)
- func PIndexNameLookup(req *http.Request) string
- func PIndexTypesInitRouter(r *mux.Router, phase string, mgr *cbgt.Manager)
- func PathFocusName(path string) string
- func PropagateError(w http.ResponseWriter, requestBody []byte, msg string, code int)
- func RESTGetRuntimeArgs(w http.ResponseWriter, r *http.Request)
- func RESTGetRuntimeStats(w http.ResponseWriter, r *http.Request)
- func RESTGetRuntimeStatsMem(w http.ResponseWriter, r *http.Request)
- func RESTPostRuntimeGC(w http.ResponseWriter, r *http.Request)
- func RESTProfileCPU(w http.ResponseWriter, r *http.Request)
- func RESTProfileMemory(w http.ResponseWriter, r *http.Request)
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func RewriteURL(to string, h http.Handler) http.Handler
- func RuntimeTrace(w http.ResponseWriter, r *http.Request)
- func ShowError(w http.ResponseWriter, req *http.Request, msg string, code int)
- func ShowErrorBody(w http.ResponseWriter, requestBody []byte, msg string, code int)
- func WriteManagerStatsJSON(mgr *cbgt.Manager, w io.Writer, indexName string) error
- type CfgGetHandler
- type CfgNodeDefsHandler
- type CfgPlanPIndexesHandler
- type CfgRefreshHandler
- type CountHandler
- type CountPIndexHandler
- type CountResponseWriter
- type CreateIndexHandler
- type DeleteIndexHandler
- type DiagGetHandler
- type ETagFileHandler
- type GetIndexHandler
- type GetPIndexHandler
- type HandlerWithRESTMeta
- type IndexControlHandler
- type ListIndexHandler
- type ListPIndexHandler
- type LogGetHandler
- type ManagerHandler
- type ManagerKickHandler
- type ManagerMetaHandler
- type ManagerOptions
- type MetaDesc
- type MetaDescIndex
- type MetaDescSource
- type NoopHandler
- type PIndexLookUpHandler
- type QueryHandler
- type QueryPIndexHandler
- type RESTCfg
- type RESTFocusStats
- type RESTMeta
- type RESTOpts
- type RESTPathStats
- type RuntimeGetHandler
- type SourcePartitionSeqsHandler
- type SourceStatsHandler
- type StatsHandler
Constants ¶
const CLUSTER_ACTION = "Internal-Cluster-Action"
Variables ¶
var ErrorAlreadyPropagated = errors.New("response already propagated")
var ErrorQueryReqRejected = errors.New("query request rejected")
var RESTMethodOrds = map[string]string{
"GET": "0",
"POST": "1",
"PUT": "2",
"DELETE": "3",
}
var RequestVariableLookup func(req *http.Request, name string) string = MuxVariableLookup
RequestVariableLookup function is used to lookup a named request parameter or variable from an http.Request. It defaults to MuxVariableLookup, but can be overridden for cases like unit testing, etc.
var RetryAfter = "30"
Time in seconds after a client can retry a request that received an error response.
var StartTime = time.Now()
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetFS ¶
func AssetFS() *assetfs.AssetFS
AssetFS returns the assetfs.AssetFS "filesystem" that holds static HTTP resources (css/html/js/images, etc) for the web UI.
Users might introduce their own static HTTP resources and override resources from AssetFS() with their own resource lookup chaining.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func DiagGetPProf ¶
func DiagGetPProf(w http.ResponseWriter, profile string, debug int)
func DocIDFromBody ¶
func DocIDLookup ¶
DocIDLookup returns the docID param from an http.Request.
func ExtractSourceTypeName ¶
func IndexNameLookup ¶
IndexNameLookup returns the indexName param from an http.Request.
func InitRESTRouter ¶
func InitRESTRouter(r *mux.Router, versionMain string, mgr *cbgt.Manager, staticDir, staticETag string, mr *cbgt.MsgRing, assetDir func(name string) ([]string, error), asset func(name string) ([]byte, error)) ( *mux.Router, map[string]RESTMeta, error)
InitRESTRouter initializes a mux.Router with REST API routes.
func InitRESTRouterEx ¶
func InitRESTRouterEx(r *mux.Router, versionMain string, mgr *cbgt.Manager, staticDir, staticETag string, mr *cbgt.MsgRing, assetDir func(name string) ([]string, error), asset func(name string) ([]byte, error), options map[string]interface{}) ( *mux.Router, map[string]RESTMeta, error)
InitRESTRouter initializes a mux.Router with REST API routes with extra option.
func InitStaticRouter ¶
func InitStaticRouter(r *mux.Router, staticDir, staticETag string, pages []string, pagesHandler http.Handler) *mux.Router
InitStaticRouter adds static HTTP resource routes to a router.
func InitStaticRouterEx ¶
func InitStaticRouterEx(r *mux.Router, staticDir, staticETag string, pages []string, pagesHandler http.Handler, mgr *cbgt.Manager) *mux.Router
InitStaticRouterEx is like InitStaticRouter, but with optional manager parameter for more options.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func MustEncode ¶
func MuxVariableLookup ¶
MuxVariableLookup() uses gorilla.mux.Vars() to lookup a named request parameter from an http.Request.
func NewRESTRouter ¶
func NewRESTRouter(versionMain string, mgr *cbgt.Manager, staticDir, staticETag string, mr *cbgt.MsgRing, assetDir func(name string) ([]string, error), asset func(name string) ([]byte, error)) ( *mux.Router, map[string]RESTMeta, error)
NewRESTRouter creates a mux.Router initialized with the REST API and web UI routes. See also InitStaticRouter and InitRESTRouter if you need finer control of the router initialization.
func PIndexNameLookup ¶
PIndexNameLookup returns the pindexName param from an http.Request.
func PIndexTypesInitRouter ¶
PIndexTypesInitRouter initializes a mux.Router with the REST API routes provided by registered pindex types.
func PathFocusName ¶
PathFocusName return the focus name of path spec. For example, given a path spec of "/api/index/{indexName}", the focus name result is "indexName". A focus name of "" is valid.
func PropagateError ¶
func PropagateError(w http.ResponseWriter, requestBody []byte, msg string, code int)
func RESTGetRuntimeArgs ¶
func RESTGetRuntimeArgs(w http.ResponseWriter, r *http.Request)
func RESTGetRuntimeStats ¶
func RESTGetRuntimeStats(w http.ResponseWriter, r *http.Request)
func RESTGetRuntimeStatsMem ¶
func RESTGetRuntimeStatsMem(w http.ResponseWriter, r *http.Request)
func RESTPostRuntimeGC ¶
func RESTPostRuntimeGC(w http.ResponseWriter, r *http.Request)
func RESTProfileCPU ¶
func RESTProfileCPU(w http.ResponseWriter, r *http.Request)
To start a cpu profiling...
curl -X POST http://127.0.0.1:9090/api/runtime/profile/cpu -d secs=5
To analyze a profiling...
go tool pprof [program-binary] run-cpu.pprof
func RESTProfileMemory ¶
func RESTProfileMemory(w http.ResponseWriter, r *http.Request)
To grab a memory profiling...
curl -X POST http://127.0.0.1:9090/api/runtime/profile/memory
To analyze a profiling...
go tool pprof [program-binary] run-memory.pprof
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
func RewriteURL ¶
RewriteURL is a helper function that returns a URL path rewriter HandlerFunc, rewriting the URL path to a provided "to" string.
func RuntimeTrace ¶
func RuntimeTrace(w http.ResponseWriter, r *http.Request)
RuntimeTrace starts a program trace
curl -X POST http://127.0.0.1:9200/api/runtime/trace -d secs=5
To analyze a profiling...
go tool trace run-program.trace
func ShowErrorBody ¶
func ShowErrorBody(w http.ResponseWriter, requestBody []byte, msg string, code int)
Types ¶
type CfgGetHandler ¶
type CfgGetHandler struct {
// contains filtered or unexported fields
}
CfgGetHandler is a REST handler that retrieves the contents of the Cfg system.
func NewCfgGetHandler ¶
func NewCfgGetHandler(mgr *cbgt.Manager) *CfgGetHandler
func (*CfgGetHandler) ServeHTTP ¶
func (h *CfgGetHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type CfgNodeDefsHandler ¶
type CfgNodeDefsHandler struct {
// contains filtered or unexported fields
}
CfgNodeDefsHandler is a REST handler that processes a request for the manager/node to set the given NodeDefs contents to the Cfg.
func NewCfgNodeDefsHandler ¶
func NewCfgNodeDefsHandler(mgr *cbgt.Manager) *CfgNodeDefsHandler
func (*CfgNodeDefsHandler) ServeHTTP ¶
func (h *CfgNodeDefsHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type CfgPlanPIndexesHandler ¶
type CfgPlanPIndexesHandler struct {
// contains filtered or unexported fields
}
CfgPlanPIndexesHandler is a REST handler that processes a request for the manager/node to set the given planPIndexes contents to the Cfg.
func NewCfgPlanPIndexesHandler ¶
func NewCfgPlanPIndexesHandler(mgr *cbgt.Manager) *CfgPlanPIndexesHandler
func (*CfgPlanPIndexesHandler) ServeHTTP ¶
func (h *CfgPlanPIndexesHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type CfgRefreshHandler ¶
type CfgRefreshHandler struct {
// contains filtered or unexported fields
}
CfgRefreshHandler is a REST handler that processes a request for the manager/node to refresh its cached snapshot of the Cfg system contents.
func NewCfgRefreshHandler ¶
func NewCfgRefreshHandler(mgr *cbgt.Manager) *CfgRefreshHandler
func (*CfgRefreshHandler) ServeHTTP ¶
func (h *CfgRefreshHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type CountHandler ¶
type CountHandler struct {
// contains filtered or unexported fields
}
CountHandler is a REST handler for counting documents/entries in an index.
func NewCountHandler ¶
func NewCountHandler(mgr *cbgt.Manager) *CountHandler
func (*CountHandler) RESTOpts ¶
func (h *CountHandler) RESTOpts(opts map[string]string)
func (*CountHandler) ServeHTTP ¶
func (h *CountHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type CountPIndexHandler ¶
type CountPIndexHandler struct {
// contains filtered or unexported fields
}
CountPIndexHandler is a REST handler for counting the documents/entries in a pindex.
func NewCountPIndexHandler ¶
func NewCountPIndexHandler(mgr *cbgt.Manager) *CountPIndexHandler
func (*CountPIndexHandler) ServeHTTP ¶
func (h *CountPIndexHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type CountResponseWriter ¶
type CountResponseWriter struct { ResponseWriter http.ResponseWriter TotBytesWritten uint64 Wrote bool }
A CountResponseWriter is a wrapper of an http.ResponseWriter that counts the bytes written.
func (*CountResponseWriter) CloseNotify ¶
func (cw *CountResponseWriter) CloseNotify() <-chan bool
func (*CountResponseWriter) Header ¶
func (cw *CountResponseWriter) Header() http.Header
func (*CountResponseWriter) Write ¶
func (cw *CountResponseWriter) Write(p []byte) (n int, err error)
func (*CountResponseWriter) WriteHeader ¶
func (cw *CountResponseWriter) WriteHeader(n int)
type CreateIndexHandler ¶
type CreateIndexHandler struct {
// contains filtered or unexported fields
}
CreateIndexHandler is a REST handler that processes an index creation request.
func NewCreateIndexHandler ¶
func NewCreateIndexHandler(mgr *cbgt.Manager) *CreateIndexHandler
func (*CreateIndexHandler) RESTOpts ¶
func (h *CreateIndexHandler) RESTOpts(opts map[string]string)
func (*CreateIndexHandler) ServeHTTP ¶
func (h *CreateIndexHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type DeleteIndexHandler ¶
type DeleteIndexHandler struct {
// contains filtered or unexported fields
}
DeleteIndexHandler is a REST handler that processes an index deletion request.
func NewDeleteIndexHandler ¶
func NewDeleteIndexHandler(mgr *cbgt.Manager) *DeleteIndexHandler
func (*DeleteIndexHandler) RESTOpts ¶
func (h *DeleteIndexHandler) RESTOpts(opts map[string]string)
func (*DeleteIndexHandler) ServeHTTP ¶
func (h *DeleteIndexHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type DiagGetHandler ¶
type DiagGetHandler struct {
// contains filtered or unexported fields
}
DiagGetHandler is a REST handler that retrieves diagnostic information for a node.
func NewDiagGetHandler ¶
func (*DiagGetHandler) ServeHTTP ¶
func (h *DiagGetHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type ETagFileHandler ¶
type ETagFileHandler struct {
// contains filtered or unexported fields
}
func (ETagFileHandler) ServeHTTP ¶
func (mfh ETagFileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GetIndexHandler ¶
type GetIndexHandler struct {
// contains filtered or unexported fields
}
GetIndexHandler is a REST handler for retrieving an index definition.
func NewGetIndexHandler ¶
func NewGetIndexHandler(mgr *cbgt.Manager) *GetIndexHandler
func (*GetIndexHandler) RESTOpts ¶
func (h *GetIndexHandler) RESTOpts(opts map[string]string)
func (*GetIndexHandler) ServeHTTP ¶
func (h *GetIndexHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type GetPIndexHandler ¶
type GetPIndexHandler struct {
// contains filtered or unexported fields
}
GetPIndexHandler is a REST handler for retrieving information on a pindex.
func NewGetPIndexHandler ¶
func NewGetPIndexHandler(mgr *cbgt.Manager) *GetPIndexHandler
func (*GetPIndexHandler) ServeHTTP ¶
func (h *GetPIndexHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type HandlerWithRESTMeta ¶
type HandlerWithRESTMeta struct { RESTMeta *RESTMeta // contains filtered or unexported fields }
HandlerWithRESTMeta wrapper associates a http.Handler with RESTMeta information.
func (*HandlerWithRESTMeta) ServeHTTP ¶
func (h *HandlerWithRESTMeta) ServeHTTP( w http.ResponseWriter, req *http.Request)
type IndexControlHandler ¶
type IndexControlHandler struct {
// contains filtered or unexported fields
}
IndexControlHandler is a REST handler for processing admin control requests on an index.
func NewIndexControlHandler ¶
func (*IndexControlHandler) RESTOpts ¶
func (h *IndexControlHandler) RESTOpts(opts map[string]string)
func (*IndexControlHandler) ServeHTTP ¶
func (h *IndexControlHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type ListIndexHandler ¶
type ListIndexHandler struct {
// contains filtered or unexported fields
}
ListIndexHandler is a REST handler for list indexes.
func NewListIndexHandler ¶
func NewListIndexHandler(mgr *cbgt.Manager) *ListIndexHandler
func (*ListIndexHandler) ServeHTTP ¶
func (h *ListIndexHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type ListPIndexHandler ¶
type ListPIndexHandler struct {
// contains filtered or unexported fields
}
ListPIndexHandler is a REST handler for listing pindexes.
func NewListPIndexHandler ¶
func NewListPIndexHandler(mgr *cbgt.Manager) *ListPIndexHandler
func (*ListPIndexHandler) ServeHTTP ¶
func (h *ListPIndexHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type LogGetHandler ¶
type LogGetHandler struct {
// contains filtered or unexported fields
}
LogGetHandler is a REST handler that retrieves recent log messages.
func NewLogGetHandler ¶
func NewLogGetHandler( mgr *cbgt.Manager, mr *cbgt.MsgRing) *LogGetHandler
func (*LogGetHandler) ServeHTTP ¶
func (h *LogGetHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type ManagerHandler ¶
type ManagerHandler struct {
// contains filtered or unexported fields
}
ManagerHandler is a REST handler that returns runtime config information about a manager/node.
func NewManagerHandler ¶
func NewManagerHandler(mgr *cbgt.Manager) *ManagerHandler
func (*ManagerHandler) ServeHTTP ¶
func (h *ManagerHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type ManagerKickHandler ¶
type ManagerKickHandler struct {
// contains filtered or unexported fields
}
ManagerKickHandler is a REST handler that processes a request to kick a manager.
func NewManagerKickHandler ¶
func NewManagerKickHandler(mgr *cbgt.Manager) *ManagerKickHandler
func (*ManagerKickHandler) ServeHTTP ¶
func (h *ManagerKickHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type ManagerMetaHandler ¶
type ManagerMetaHandler struct {
// contains filtered or unexported fields
}
ManagerMetaHandler is a REST handler that returns metadata about a manager/node.
func NewManagerMetaHandler ¶
func NewManagerMetaHandler(mgr *cbgt.Manager, meta map[string]RESTMeta) *ManagerMetaHandler
func (*ManagerMetaHandler) ServeHTTP ¶
func (h *ManagerMetaHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type ManagerOptions ¶
type ManagerOptions struct { Validate func(opt map[string]string) (map[string]string, error) // contains filtered or unexported fields }
ManagerOptions is a REST handler that sets the managerOptions
func NewManagerOptions ¶
func NewManagerOptions(mgr *cbgt.Manager) *ManagerOptions
func (*ManagerOptions) ServeHTTP ¶
func (h *ManagerOptions) ServeHTTP( w http.ResponseWriter, req *http.Request)
type MetaDesc ¶
type MetaDesc struct { Description string `json:"description"` StartSample interface{} `json:"startSample"` StartSampleDocs map[string]string `json:"startSampleDocs"` }
MetaDesc represents a part of the JSON of a ManagerMetaHandler REST response.
type MetaDescIndex ¶
type MetaDescIndex struct { MetaDesc CanCount bool `json:"canCount"` CanQuery bool `json:"canQuery"` QuerySamples interface{} `json:"querySamples"` QueryHelp string `json:"queryHelp"` UI map[string]string `json:"ui"` }
MetaDescSource represents the index-type parts of the JSON of a ManagerMetaHandler REST response.
type MetaDescSource ¶
type MetaDescSource MetaDesc
MetaDescSource represents the source-type/feed-type parts of the JSON of a ManagerMetaHandler REST response.
type NoopHandler ¶
type NoopHandler struct{}
NoopHandler is a REST handler that returns nothing.
func (*NoopHandler) ServeHTTP ¶
func (h *NoopHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
type PIndexLookUpHandler ¶
type PIndexLookUpHandler struct {
// contains filtered or unexported fields
}
PIndexLookUpHandler is a REST handler for looking up the PIndex for the given index name and document ID.
func NewPIndexLookUpHandler ¶
func NewPIndexLookUpHandler(mgr *cbgt.Manager) *PIndexLookUpHandler
func (*PIndexLookUpHandler) ServeHTTP ¶
func (h *PIndexLookUpHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type QueryHandler ¶
type QueryHandler struct {
// contains filtered or unexported fields
}
QueryHandler is a REST handler for querying an index.
func NewQueryHandler ¶
func NewQueryHandler(mgr *cbgt.Manager, pathStats *RESTPathStats) *QueryHandler
func (*QueryHandler) RESTOpts ¶
func (h *QueryHandler) RESTOpts(opts map[string]string)
func (*QueryHandler) ServeHTTP ¶
func (h *QueryHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type QueryPIndexHandler ¶
type QueryPIndexHandler struct {
// contains filtered or unexported fields
}
QueryPIndexHandler is a REST handler for querying a pindex.
func NewQueryPIndexHandler ¶
func NewQueryPIndexHandler(mgr *cbgt.Manager) *QueryPIndexHandler
func (*QueryPIndexHandler) ServeHTTP ¶
func (h *QueryPIndexHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type RESTCfg ¶
type RESTCfg struct { Status string `json:"status"` IndexDefs *cbgt.IndexDefs `json:"indexDefs"` IndexDefsCAS uint64 `json:"indexDefsCAS"` IndexDefsErr error `json:"indexDefsErr"` NodeDefsWanted *cbgt.NodeDefs `json:"nodeDefsWanted"` NodeDefsWantedCAS uint64 `json:"nodeDefsWantedCAS"` NodeDefsWantedErr error `json:"nodeDefsWantedErr"` NodeDefsKnown *cbgt.NodeDefs `json:"nodeDefsKnown"` NodeDefsKnownCAS uint64 `json:"nodeDefsKnownCAS"` NodeDefsKnownErr error `json:"nodeDefsKnownErr"` PlanPIndexes *cbgt.PlanPIndexes `json:"planPIndexes"` PlanPIndexesCAS uint64 `json:"planPIndexesCAS"` PlanPIndexesErr error `json:"planPIndexesErr"` }
type RESTFocusStats ¶
type RESTFocusStats struct { TotRequest uint64 TotRequestTimeNS uint64 TotRequestErr uint64 `json:"TotRequestErr,omitempty"` TotRequestSlow uint64 `json:"TotRequestSlow,omitempty"` TotRequestTimeout uint64 `json:"TotRequestTimeout,omitempty"` TotResponseBytes uint64 `json:"TotResponseBytes,omitempty"` TotClientRequest uint64 TotClientRequestTimeNS uint64 }
RESTFocusStats represents stats for a targeted or "focused" REST endpoint, like "/api/index/beer-sample/query".
func (*RESTFocusStats) AtomicCopyTo ¶
func (s *RESTFocusStats) AtomicCopyTo(r *RESTFocusStats)
AtomicCopyTo copies stats from s to r (from source to result).
type RESTMeta ¶
type RESTMeta struct { Path string // The path spec, including any optional prefix. Method string Opts map[string]string }
RESTMeta represents the metadata of a REST API endpoint and is used for auto-generated REST API documentation.
type RESTOpts ¶
RESTOpts interface may be optionally implemented by REST API handlers to provide even more information for auto-generated REST API documentation.
type RESTPathStats ¶
type RESTPathStats struct {
// contains filtered or unexported fields
}
RESTPathStats represents the stats for a REST path spec. A REST path spec, like "/api/index" or "/api/index/{indexName}/query", can have an optional focusName (i.e., "indexName"), which can in turn have multiple runtime focus values, like "beer-sample", "indexForCRM", "".
func (*RESTPathStats) FocusStats ¶
func (s *RESTPathStats) FocusStats(focusVal string) *RESTFocusStats
FocusStats returns the RESTFocusStats for a given focus value (like "beer-sample"), and is a concurrent safe method. The returned RESTFocusStats should only be accessed via sync/atomic functions.
func (*RESTPathStats) FocusValues ¶
func (s *RESTPathStats) FocusValues() (rv []string)
FocusValues returns the focus value strings, like ["beer-sample", "indexForCRM", "wikiIndexTitles"].
type RuntimeGetHandler ¶
type RuntimeGetHandler struct {
// contains filtered or unexported fields
}
RuntimeGetHandler is a REST handler for runtime GET endpoint.
func NewRuntimeGetHandler ¶
func NewRuntimeGetHandler( versionMain string, mgr *cbgt.Manager) *RuntimeGetHandler
func (*RuntimeGetHandler) ServeHTTP ¶
func (h *RuntimeGetHandler) ServeHTTP( w http.ResponseWriter, r *http.Request)
type SourcePartitionSeqsHandler ¶
type SourcePartitionSeqsHandler struct {
// contains filtered or unexported fields
}
SourcePartitionSeqsHandler is a REST handler for retrieving the partition seqs from the data source for an index.
func NewSourcePartitionSeqsHandler ¶
func NewSourcePartitionSeqsHandler(mgr *cbgt.Manager) *SourcePartitionSeqsHandler
func (*SourcePartitionSeqsHandler) RESTOpts ¶
func (h *SourcePartitionSeqsHandler) RESTOpts(opts map[string]string)
func (*SourcePartitionSeqsHandler) ServeHTTP ¶
func (h *SourcePartitionSeqsHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type SourceStatsHandler ¶
type SourceStatsHandler struct {
// contains filtered or unexported fields
}
SourceStatsHandler is a REST handler for retrieving the partition seqs from the data source for an index.
func NewSourceStatsHandler ¶
func NewSourceStatsHandler(mgr *cbgt.Manager) *SourceStatsHandler
func (*SourceStatsHandler) RESTOpts ¶
func (h *SourceStatsHandler) RESTOpts(opts map[string]string)
func (*SourceStatsHandler) ServeHTTP ¶
func (h *SourceStatsHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type StatsHandler ¶
type StatsHandler struct {
// contains filtered or unexported fields
}
StatsHandler is a REST handler that provides stats/metrics for a node.
func NewStatsHandler ¶
func NewStatsHandler(mgr *cbgt.Manager) *StatsHandler
func (*StatsHandler) ServeHTTP ¶
func (h *StatsHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)