agentv1

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package agentv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	Health_name = map[int32]string{
		0: "HEALTH_UNSPECIFIED",
		1: "HEALTH_UP",
		2: "HEALTH_DOWN",
	}
	Health_value = map[string]int32{
		"HEALTH_UNSPECIFIED": 0,
		"HEALTH_UP":          1,
		"HEALTH_DOWN":        2,
	}
)

Enum value maps for Health.

View Source
var (
	State_name = map[int32]string{
		0: "STATE_UNSPECIFIED",
		1: "STATE_ACTIVE",
		2: "STATE_DROPPED",
	}
	State_value = map[string]int32{
		"STATE_UNSPECIFIED": 0,
		"STATE_ACTIVE":      1,
		"STATE_DROPPED":     2,
	}
)

Enum value maps for State.

View Source
var (
	ErrInvalidLength        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflow          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group")
)
View Source
var AgentService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "agent.v1.AgentService",
	HandlerType: (*AgentServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetTargets",
			Handler:    _AgentService_GetTargets_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "agent/v1/agent.proto",
}

AgentService_ServiceDesc is the grpc.ServiceDesc for AgentService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_agent_v1_agent_proto protoreflect.FileDescriptor

Functions

func RegisterAgentServiceHandler

func RegisterAgentServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterAgentServiceHandler registers the http handlers for service AgentService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterAgentServiceHandlerClient

func RegisterAgentServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AgentServiceClient) error

RegisterAgentServiceHandlerClient registers the http handlers for service AgentService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AgentServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AgentServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AgentServiceClient" to call the correct interceptors.

func RegisterAgentServiceHandlerFromEndpoint

func RegisterAgentServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterAgentServiceHandlerFromEndpoint is same as RegisterAgentServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterAgentServiceHandlerServer

func RegisterAgentServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AgentServiceServer) error

RegisterAgentServiceHandlerServer registers the http handlers for service AgentService to "mux". UnaryRPC :call AgentServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAgentServiceHandlerFromEndpoint instead.

func RegisterAgentServiceServer

func RegisterAgentServiceServer(s grpc.ServiceRegistrar, srv AgentServiceServer)

Types

type AgentServiceClient

type AgentServiceClient interface {
	// Retrieve information about targets.
	GetTargets(ctx context.Context, in *GetTargetsRequest, opts ...grpc.CallOption) (*GetTargetsResponse, error)
}

AgentServiceClient is the client API for AgentService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type AgentServiceServer

type AgentServiceServer interface {
	// Retrieve information about targets.
	GetTargets(context.Context, *GetTargetsRequest) (*GetTargetsResponse, error)
	// contains filtered or unexported methods
}

AgentServiceServer is the server API for AgentService service. All implementations must embed UnimplementedAgentServiceServer for forward compatibility

type GetTargetsRequest

type GetTargetsRequest struct {
	State State `protobuf:"varint,1,opt,name=state,proto3,enum=agent.v1.State" json:"state,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTargetsRequest) Descriptor deprecated

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

Deprecated: Use GetTargetsRequest.ProtoReflect.Descriptor instead.

func (*GetTargetsRequest) GetState

func (x *GetTargetsRequest) GetState() State

func (*GetTargetsRequest) MarshalToSizedBufferVT

func (m *GetTargetsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*GetTargetsRequest) MarshalToVT

func (m *GetTargetsRequest) MarshalToVT(dAtA []byte) (int, error)

func (*GetTargetsRequest) MarshalVT

func (m *GetTargetsRequest) MarshalVT() (dAtA []byte, err error)

func (*GetTargetsRequest) ProtoMessage

func (*GetTargetsRequest) ProtoMessage()

func (*GetTargetsRequest) ProtoReflect

func (x *GetTargetsRequest) ProtoReflect() protoreflect.Message

func (*GetTargetsRequest) Reset

func (x *GetTargetsRequest) Reset()

func (*GetTargetsRequest) SizeVT

func (m *GetTargetsRequest) SizeVT() (n int)

func (*GetTargetsRequest) String

func (x *GetTargetsRequest) String() string

func (*GetTargetsRequest) UnmarshalVT

func (m *GetTargetsRequest) UnmarshalVT(dAtA []byte) error

type GetTargetsResponse

type GetTargetsResponse struct {
	ActiveTargets  []*Target `protobuf:"bytes,1,rep,name=active_targets,json=activeTargets,proto3" json:"active_targets,omitempty"`
	DroppedTargets []*Target `protobuf:"bytes,2,rep,name=dropped_targets,json=droppedTargets,proto3" json:"dropped_targets,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTargetsResponse) Descriptor deprecated

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

Deprecated: Use GetTargetsResponse.ProtoReflect.Descriptor instead.

func (*GetTargetsResponse) GetActiveTargets

func (x *GetTargetsResponse) GetActiveTargets() []*Target

func (*GetTargetsResponse) GetDroppedTargets

func (x *GetTargetsResponse) GetDroppedTargets() []*Target

func (*GetTargetsResponse) MarshalToSizedBufferVT

func (m *GetTargetsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*GetTargetsResponse) MarshalToVT

func (m *GetTargetsResponse) MarshalToVT(dAtA []byte) (int, error)

func (*GetTargetsResponse) MarshalVT

func (m *GetTargetsResponse) MarshalVT() (dAtA []byte, err error)

func (*GetTargetsResponse) ProtoMessage

func (*GetTargetsResponse) ProtoMessage()

func (*GetTargetsResponse) ProtoReflect

func (x *GetTargetsResponse) ProtoReflect() protoreflect.Message

func (*GetTargetsResponse) Reset

func (x *GetTargetsResponse) Reset()

func (*GetTargetsResponse) SizeVT

func (m *GetTargetsResponse) SizeVT() (n int)

func (*GetTargetsResponse) String

func (x *GetTargetsResponse) String() string

func (*GetTargetsResponse) UnmarshalVT

func (m *GetTargetsResponse) UnmarshalVT(dAtA []byte) error

type Health

type Health int32
const (
	Health_HEALTH_UNSPECIFIED Health = 0
	Health_HEALTH_UP          Health = 1
	Health_HEALTH_DOWN        Health = 2
)

func (Health) Descriptor

func (Health) Descriptor() protoreflect.EnumDescriptor

func (Health) Enum

func (x Health) Enum() *Health

func (Health) EnumDescriptor deprecated

func (Health) EnumDescriptor() ([]byte, []int)

Deprecated: Use Health.Descriptor instead.

func (Health) Number

func (x Health) Number() protoreflect.EnumNumber

func (Health) String

func (x Health) String() string

func (Health) Type

func (Health) Type() protoreflect.EnumType

type State

type State int32
const (
	State_STATE_UNSPECIFIED State = 0
	State_STATE_ACTIVE      State = 1
	State_STATE_DROPPED     State = 2
)

func (State) Descriptor

func (State) Descriptor() protoreflect.EnumDescriptor

func (State) Enum

func (x State) Enum() *State

func (State) EnumDescriptor deprecated

func (State) EnumDescriptor() ([]byte, []int)

Deprecated: Use State.Descriptor instead.

func (State) Number

func (x State) Number() protoreflect.EnumNumber

func (State) String

func (x State) String() string

func (State) Type

func (State) Type() protoreflect.EnumType

type Target

type Target struct {

	// Contains labels before any processing.
	DiscoveredLabels map[string]string `` /* 197-byte string literal not displayed */
	// Labels as they are attached to ingested profiles.
	Labels map[string]string `` /* 153-byte string literal not displayed */
	// Name of the scrape pool used
	ScrapePool string `protobuf:"bytes,3,opt,name=scrape_pool,json=scrapePool,proto3" json:"scrape_pool,omitempty"`
	// URL that is used for retrieving the profile.
	ScrapeUrl string `protobuf:"bytes,4,opt,name=scrape_url,json=scrapeUrl,proto3" json:"scrape_url,omitempty"`
	// Contains the error if the last attempted scrape has failed.
	LastError string `protobuf:"bytes,5,opt,name=last_error,json=lastError,proto3" json:"last_error,omitempty"`
	// Timestamp of last scrape
	LastScrape *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=last_scrape,json=lastScrape,proto3" json:"last_scrape,omitempty"`
	// Duation of last scrape.
	LastScrapeDuration *durationpb.Duration `protobuf:"bytes,7,opt,name=last_scrape_duration,json=lastScrapeDuration,proto3" json:"last_scrape_duration,omitempty"`
	// Health of last scrape.
	Health Health `protobuf:"varint,8,opt,name=health,proto3,enum=agent.v1.Health" json:"health,omitempty"`
	// Timeout duration for the scrape request.
	ScrapeTimeout *durationpb.Duration `protobuf:"bytes,9,opt,name=scrape_timeout,json=scrapeTimeout,proto3" json:"scrape_timeout,omitempty"`
	// Interval how often profiles are scraped.
	ScrapeInterval *durationpb.Duration `protobuf:"bytes,10,opt,name=scrape_interval,json=scrapeInterval,proto3" json:"scrape_interval,omitempty"`
	// contains filtered or unexported fields
}

func (*Target) Descriptor deprecated

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

Deprecated: Use Target.ProtoReflect.Descriptor instead.

func (*Target) GetDiscoveredLabels

func (x *Target) GetDiscoveredLabels() map[string]string

func (*Target) GetHealth

func (x *Target) GetHealth() Health

func (*Target) GetLabels

func (x *Target) GetLabels() map[string]string

func (*Target) GetLastError

func (x *Target) GetLastError() string

func (*Target) GetLastScrape

func (x *Target) GetLastScrape() *timestamppb.Timestamp

func (*Target) GetLastScrapeDuration

func (x *Target) GetLastScrapeDuration() *durationpb.Duration

func (*Target) GetScrapeInterval

func (x *Target) GetScrapeInterval() *durationpb.Duration

func (*Target) GetScrapePool

func (x *Target) GetScrapePool() string

func (*Target) GetScrapeTimeout

func (x *Target) GetScrapeTimeout() *durationpb.Duration

func (*Target) GetScrapeUrl

func (x *Target) GetScrapeUrl() string

func (*Target) MarshalToSizedBufferVT

func (m *Target) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Target) MarshalToVT

func (m *Target) MarshalToVT(dAtA []byte) (int, error)

func (*Target) MarshalVT

func (m *Target) MarshalVT() (dAtA []byte, err error)

func (*Target) ProtoMessage

func (*Target) ProtoMessage()

func (*Target) ProtoReflect

func (x *Target) ProtoReflect() protoreflect.Message

func (*Target) Reset

func (x *Target) Reset()

func (*Target) SizeVT

func (m *Target) SizeVT() (n int)

func (*Target) String

func (x *Target) String() string

func (*Target) UnmarshalVT

func (m *Target) UnmarshalVT(dAtA []byte) error

type UnimplementedAgentServiceServer

type UnimplementedAgentServiceServer struct {
}

UnimplementedAgentServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedAgentServiceServer) GetTargets

type UnsafeAgentServiceServer

type UnsafeAgentServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeAgentServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AgentServiceServer will result in compilation errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL