Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

grpc_lb_v1

v1.4.2
github.com/bww/grpc-go/grpclb/grpc_lb_v1

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

79 matches

Top ↑

Package grpc_lb_v1 is a generated protocol buffer package.

It is generated from these files:

grpclb.proto

It has these top-level messages:

Duration
Timestamp
LoadBalanceRequest
InitialLoadBalanceRequest
ClientStats
LoadBalanceResponse
InitialLoadBalanceResponse
ServerList
Server

Types

ClientStats

type ClientStats struct {
	// The timestamp of generating the report.
	Timestamp *Timestamp `protobuf:"bytes,1,opt,name=timestamp" json:"timestamp,omitempty"`
	// The total number of RPCs that started.
	NumCallsStarted int64 `protobuf:"varint,2,opt,name=num_calls_started,json=numCallsStarted" json:"num_calls_started,omitempty"`
	// The total number of RPCs that finished.
	NumCallsFinished int64 `protobuf:"varint,3,opt,name=num_calls_finished,json=numCallsFinished" json:"num_calls_finished,omitempty"`
	// The total number of RPCs that were dropped by the client because of rate
	// limiting.
	NumCallsFinishedWithDropForRateLimiting int64 `protobuf:"varint,4,opt,name=num_calls_finished_with_drop_for_rate_limiting,json=numCallsFinishedWithDropForRateLimiting" json:"num_calls_finished_with_drop_for_rate_limiting,omitempty"`
	// The total number of RPCs that were dropped by the client because of load
	// balancing.
	NumCallsFinishedWithDropForLoadBalancing int64 `protobuf:"varint,5,opt,name=num_calls_finished_with_drop_for_load_balancing,json=numCallsFinishedWithDropForLoadBalancing" json:"num_calls_finished_with_drop_for_load_balancing,omitempty"`
	// The total number of RPCs that failed to reach a server except dropped RPCs.
	NumCallsFinishedWithClientFailedToSend int64 `protobuf:"varint,6,opt,name=num_calls_finished_with_client_failed_to_send,json=numCallsFinishedWithClientFailedToSend" json:"num_calls_finished_with_client_failed_to_send,omitempty"`
	// The total number of RPCs that finished and are known to have been received
	// by a server.
	NumCallsFinishedKnownReceived int64 `protobuf:"varint,7,opt,name=num_calls_finished_known_received,json=numCallsFinishedKnownReceived" json:"num_calls_finished_known_received,omitempty"`
}

Contains client level statistics that are useful to load balancing. Each count except the timestamp should be reset to zero after reporting the stats.

ClientStats.Descriptor

func (*ClientStats) Descriptor() ([]byte, []int)

ClientStats.GetNumCallsFinished

func (m *ClientStats) GetNumCallsFinished() int64

ClientStats.GetNumCallsFinishedKnownReceived

func (m *ClientStats) GetNumCallsFinishedKnownReceived() int64

ClientStats.GetNumCallsFinishedWithClientFailedToSend

func (m *ClientStats) GetNumCallsFinishedWithClientFailedToSend() int64

ClientStats.GetNumCallsFinishedWithDropForLoadBalancing

func (m *ClientStats) GetNumCallsFinishedWithDropForLoadBalancing() int64

ClientStats.GetNumCallsFinishedWithDropForRateLimiting

func (m *ClientStats) GetNumCallsFinishedWithDropForRateLimiting() int64

ClientStats.GetNumCallsStarted

func (m *ClientStats) GetNumCallsStarted() int64

ClientStats.GetTimestamp

func (m *ClientStats) GetTimestamp() *Timestamp

ClientStats.ProtoMessage

func (*ClientStats) ProtoMessage()

ClientStats.Reset

func (m *ClientStats) Reset()

ClientStats.String

func (m *ClientStats) String() string

Duration

type Duration struct {
	// Signed seconds of the span of time. Must be from -315,576,000,000
	// to +315,576,000,000 inclusive.
	Seconds int64 `protobuf:"varint,1,opt,name=seconds" json:"seconds,omitempty"`
	// Signed fractions of a second at nanosecond resolution of the span
	// of time. Durations less than one second are represented with a 0
	// `seconds` field and a positive or negative `nanos` field. For durations
	// of one second or more, a non-zero value for the `nanos` field must be
	// of the same sign as the `seconds` field. Must be from -999,999,999
	// to +999,999,999 inclusive.
	Nanos int32 `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"`
}

Duration.Descriptor

func (*Duration) Descriptor() ([]byte, []int)

Duration.GetNanos

func (m *Duration) GetNanos() int32

Duration.GetSeconds

func (m *Duration) GetSeconds() int64

Duration.ProtoMessage

func (*Duration) ProtoMessage()

Duration.Reset

func (m *Duration) Reset()

Duration.String

func (m *Duration) String() string

InitialLoadBalanceRequest

type InitialLoadBalanceRequest struct {
	// Name of load balanced service (IE, balancer.service.com)
	// length should be less than 256 bytes.
	Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
}

InitialLoadBalanceRequest.Descriptor

func (*InitialLoadBalanceRequest) Descriptor() ([]byte, []int)

InitialLoadBalanceRequest.GetName

func (m *InitialLoadBalanceRequest) GetName() string

InitialLoadBalanceRequest.ProtoMessage

func (*InitialLoadBalanceRequest) ProtoMessage()

InitialLoadBalanceRequest.Reset

func (m *InitialLoadBalanceRequest) Reset()

InitialLoadBalanceRequest.String

func (m *InitialLoadBalanceRequest) String() string

InitialLoadBalanceResponse

type InitialLoadBalanceResponse struct {
	// This is an application layer redirect that indicates the client should use
	// the specified server for load balancing. When this field is non-empty in
	// the response, the client should open a separate connection to the
	// load_balancer_delegate and call the BalanceLoad method. Its length should
	// be less than 64 bytes.
	LoadBalancerDelegate string `protobuf:"bytes,1,opt,name=load_balancer_delegate,json=loadBalancerDelegate" json:"load_balancer_delegate,omitempty"`
	// This interval defines how often the client should send the client stats
	// to the load balancer. Stats should only be reported when the duration is
	// positive.
	ClientStatsReportInterval *Duration `protobuf:"bytes,2,opt,name=client_stats_report_interval,json=clientStatsReportInterval" json:"client_stats_report_interval,omitempty"`
}

InitialLoadBalanceResponse.Descriptor

func (*InitialLoadBalanceResponse) Descriptor() ([]byte, []int)

InitialLoadBalanceResponse.GetClientStatsReportInterval

func (m *InitialLoadBalanceResponse) GetClientStatsReportInterval() *Duration

InitialLoadBalanceResponse.GetLoadBalancerDelegate

func (m *InitialLoadBalanceResponse) GetLoadBalancerDelegate() string

InitialLoadBalanceResponse.ProtoMessage

func (*InitialLoadBalanceResponse) ProtoMessage()

InitialLoadBalanceResponse.Reset

func (m *InitialLoadBalanceResponse) Reset()

InitialLoadBalanceResponse.String

func (m *InitialLoadBalanceResponse) String() string

LoadBalanceRequest

type LoadBalanceRequest struct {
	// Types that are valid to be assigned to LoadBalanceRequestType:
	//	*LoadBalanceRequest_InitialRequest
	//	*LoadBalanceRequest_ClientStats
	LoadBalanceRequestType isLoadBalanceRequest_LoadBalanceRequestType `protobuf_oneof:"load_balance_request_type"`
}

LoadBalanceRequest.Descriptor

func (*LoadBalanceRequest) Descriptor() ([]byte, []int)

LoadBalanceRequest.GetClientStats

func (m *LoadBalanceRequest) GetClientStats() *ClientStats

LoadBalanceRequest.GetInitialRequest

func (m *LoadBalanceRequest) GetInitialRequest() *InitialLoadBalanceRequest

LoadBalanceRequest.GetLoadBalanceRequestType

func (m *LoadBalanceRequest) GetLoadBalanceRequestType() isLoadBalanceRequest_LoadBalanceRequestType

LoadBalanceRequest.ProtoMessage

func (*LoadBalanceRequest) ProtoMessage()

LoadBalanceRequest.Reset

func (m *LoadBalanceRequest) Reset()

LoadBalanceRequest.String

func (m *LoadBalanceRequest) String() string

LoadBalanceRequest.XXX_OneofFuncs

func (*LoadBalanceRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

LoadBalanceRequest_ClientStats

type LoadBalanceRequest_ClientStats struct {
	ClientStats *ClientStats `protobuf:"bytes,2,opt,name=client_stats,json=clientStats,oneof"`
}

LoadBalanceRequest_InitialRequest

type LoadBalanceRequest_InitialRequest struct {
	InitialRequest *InitialLoadBalanceRequest `protobuf:"bytes,1,opt,name=initial_request,json=initialRequest,oneof"`
}

LoadBalanceResponse

type LoadBalanceResponse struct {
	// Types that are valid to be assigned to LoadBalanceResponseType:
	//	*LoadBalanceResponse_InitialResponse
	//	*LoadBalanceResponse_ServerList
	LoadBalanceResponseType isLoadBalanceResponse_LoadBalanceResponseType `protobuf_oneof:"load_balance_response_type"`
}

LoadBalanceResponse.Descriptor

func (*LoadBalanceResponse) Descriptor() ([]byte, []int)

LoadBalanceResponse.GetInitialResponse

func (m *LoadBalanceResponse) GetInitialResponse() *InitialLoadBalanceResponse

LoadBalanceResponse.GetLoadBalanceResponseType

func (m *LoadBalanceResponse) GetLoadBalanceResponseType() isLoadBalanceResponse_LoadBalanceResponseType

LoadBalanceResponse.GetServerList

func (m *LoadBalanceResponse) GetServerList() *ServerList

LoadBalanceResponse.ProtoMessage

func (*LoadBalanceResponse) ProtoMessage()

LoadBalanceResponse.Reset

func (m *LoadBalanceResponse) Reset()

LoadBalanceResponse.String

func (m *LoadBalanceResponse) String() string

LoadBalanceResponse.XXX_OneofFuncs

func (*LoadBalanceResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

LoadBalanceResponse_InitialResponse

type LoadBalanceResponse_InitialResponse struct {
	InitialResponse *InitialLoadBalanceResponse `protobuf:"bytes,1,opt,name=initial_response,json=initialResponse,oneof"`
}

LoadBalanceResponse_ServerList

type LoadBalanceResponse_ServerList struct {
	ServerList *ServerList `protobuf:"bytes,2,opt,name=server_list,json=serverList,oneof"`
}

Server

type Server struct {
	// A resolved address for the server, serialized in network-byte-order. It may
	// either be an IPv4 or IPv6 address.
	IpAddress []byte `protobuf:"bytes,1,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"`
	// A resolved port number for the server.
	Port int32 `protobuf:"varint,2,opt,name=port" json:"port,omitempty"`
	// An opaque but printable token given to the frontend for each pick. All
	// frontend requests for that pick must include the token in its initial
	// metadata. The token is used by the backend to verify the request and to
	// allow the backend to report load to the gRPC LB system.
	//
	// Its length is variable but less than 50 bytes.
	LoadBalanceToken string `protobuf:"bytes,3,opt,name=load_balance_token,json=loadBalanceToken" json:"load_balance_token,omitempty"`
	// Indicates whether this particular request should be dropped by the client
	// for rate limiting.
	DropForRateLimiting bool `protobuf:"varint,4,opt,name=drop_for_rate_limiting,json=dropForRateLimiting" json:"drop_for_rate_limiting,omitempty"`
	// Indicates whether this particular request should be dropped by the client
	// for load balancing.
	DropForLoadBalancing bool `protobuf:"varint,5,opt,name=drop_for_load_balancing,json=dropForLoadBalancing" json:"drop_for_load_balancing,omitempty"`
}

Contains server information. When none of the [drop_for_*] fields are true, use the other fields. When drop_for_rate_limiting is true, ignore all other fields. Use drop_for_load_balancing only when it is true and drop_for_rate_limiting is false.

Server.Descriptor

func (*Server) Descriptor() ([]byte, []int)

Server.GetDropForLoadBalancing

func (m *Server) GetDropForLoadBalancing() bool

Server.GetDropForRateLimiting

func (m *Server) GetDropForRateLimiting() bool

Server.GetIpAddress

func (m *Server) GetIpAddress() []byte

Server.GetLoadBalanceToken

func (m *Server) GetLoadBalanceToken() string

Server.GetPort

func (m *Server) GetPort() int32

Server.ProtoMessage

func (*Server) ProtoMessage()

Server.Reset

func (m *Server) Reset()

Server.String

func (m *Server) String() string

ServerList

type ServerList struct {
	// Contains a list of servers selected by the load balancer. The list will
	// be updated when server resolutions change or as needed to balance load
	// across more servers. The client should consume the server list in order
	// unless instructed otherwise via the client_config.
	Servers []*Server `protobuf:"bytes,1,rep,name=servers" json:"servers,omitempty"`
	// Indicates the amount of time that the client should consider this server
	// list as valid. It may be considered stale after waiting this interval of
	// time after receiving the list. If the interval is not positive, the
	// client can assume the list is valid until the next list is received.
	ExpirationInterval *Duration `protobuf:"bytes,3,opt,name=expiration_interval,json=expirationInterval" json:"expiration_interval,omitempty"`
}

ServerList.Descriptor

func (*ServerList) Descriptor() ([]byte, []int)

ServerList.GetExpirationInterval

func (m *ServerList) GetExpirationInterval() *Duration

ServerList.GetServers

func (m *ServerList) GetServers() []*Server

ServerList.ProtoMessage

func (*ServerList) ProtoMessage()

ServerList.Reset

func (m *ServerList) Reset()

ServerList.String

func (m *ServerList) String() string

Timestamp

type Timestamp struct {
	// Represents seconds of UTC time since Unix epoch
	// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
	// 9999-12-31T23:59:59Z inclusive.
	Seconds int64 `protobuf:"varint,1,opt,name=seconds" json:"seconds,omitempty"`
	// Non-negative fractions of a second at nanosecond resolution. Negative
	// second values with fractions must still have non-negative nanos values
	// that count forward in time. Must be from 0 to 999,999,999
	// inclusive.
	Nanos int32 `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"`
}

Timestamp.Descriptor

func (*Timestamp) Descriptor() ([]byte, []int)

Timestamp.GetNanos

func (m *Timestamp) GetNanos() int32

Timestamp.GetSeconds

func (m *Timestamp) GetSeconds() int64

Timestamp.ProtoMessage

func (*Timestamp) ProtoMessage()

Timestamp.Reset

func (m *Timestamp) Reset()

Timestamp.String

func (m *Timestamp) String() string

Dependency graph