-
Notifications
You must be signed in to change notification settings - Fork 142
/
interface.go
33 lines (24 loc) · 1.04 KB
/
interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package types
import (
"context"
"github.com/ansel1/merry"
protov3 "github.com/go-graphite/protocol/carbonapi_v3_pb"
)
type Request interface {
Marshal() ([]byte, merry.Error)
LogInfo() interface{}
}
type BackendServer interface {
Name() string
Backends() []string
MaxMetricsPerRequest() int
Fetch(ctx context.Context, request *protov3.MultiFetchRequest) (*protov3.MultiFetchResponse, *Stats, merry.Error)
Find(ctx context.Context, request *protov3.MultiGlobRequest) (*protov3.MultiGlobResponse, *Stats, merry.Error)
Info(ctx context.Context, request *protov3.MultiMetricsInfoRequest) (*protov3.ZipperInfoResponse, *Stats, merry.Error)
List(ctx context.Context) (*protov3.ListMetricsResponse, *Stats, merry.Error)
Stats(ctx context.Context) (*protov3.MetricDetailsResponse, *Stats, merry.Error)
ProbeTLDs(ctx context.Context) ([]string, merry.Error)
TagNames(ctx context.Context, query string, limit int64) ([]string, merry.Error)
TagValues(ctx context.Context, query string, limit int64) ([]string, merry.Error)
Children() []BackendServer
}