github.com/go-graphite/carbonapi@v0.17.0/zipper/types/interface.go (about)

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