serverpb

package
v2.0.0-beta4+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2019 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package serverpb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterServerHandler

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

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

func RegisterServerHandlerClient

func RegisterServerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServerClient) error

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

func RegisterServerHandlerFromEndpoint

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

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

func RegisterServerServer

func RegisterServerServer(s *grpc.Server, srv ServerServer)

Types

type ChangeSettingsRequest

type ChangeSettingsRequest struct {
	MetricsResolutions   *MetricsResolutions `protobuf:"bytes,1,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"`
	EnableTelemetry      bool                `protobuf:"varint,2,opt,name=enable_telemetry,json=enableTelemetry,proto3" json:"enable_telemetry,omitempty"`
	DisableTelemetry     bool                `protobuf:"varint,3,opt,name=disable_telemetry,json=disableTelemetry,proto3" json:"disable_telemetry,omitempty"`
	XXX_NoUnkeyedLiteral struct{}            `json:"-"`
	XXX_unrecognized     []byte              `json:"-"`
	XXX_sizecache        int32               `json:"-"`
}

func (*ChangeSettingsRequest) Descriptor

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

func (*ChangeSettingsRequest) GetDisableTelemetry

func (m *ChangeSettingsRequest) GetDisableTelemetry() bool

func (*ChangeSettingsRequest) GetEnableTelemetry

func (m *ChangeSettingsRequest) GetEnableTelemetry() bool

func (*ChangeSettingsRequest) GetMetricsResolutions

func (m *ChangeSettingsRequest) GetMetricsResolutions() *MetricsResolutions

func (*ChangeSettingsRequest) ProtoMessage

func (*ChangeSettingsRequest) ProtoMessage()

func (*ChangeSettingsRequest) Reset

func (m *ChangeSettingsRequest) Reset()

func (*ChangeSettingsRequest) String

func (m *ChangeSettingsRequest) String() string

func (*ChangeSettingsRequest) Validate

func (this *ChangeSettingsRequest) Validate() error

func (*ChangeSettingsRequest) XXX_DiscardUnknown

func (m *ChangeSettingsRequest) XXX_DiscardUnknown()

func (*ChangeSettingsRequest) XXX_Marshal

func (m *ChangeSettingsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ChangeSettingsRequest) XXX_Merge

func (m *ChangeSettingsRequest) XXX_Merge(src proto.Message)

func (*ChangeSettingsRequest) XXX_Size

func (m *ChangeSettingsRequest) XXX_Size() int

func (*ChangeSettingsRequest) XXX_Unmarshal

func (m *ChangeSettingsRequest) XXX_Unmarshal(b []byte) error

type ChangeSettingsResponse

type ChangeSettingsResponse struct {
	Settings             *Settings `protobuf:"bytes,1,opt,name=settings,proto3" json:"settings,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*ChangeSettingsResponse) Descriptor

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

func (*ChangeSettingsResponse) GetSettings

func (m *ChangeSettingsResponse) GetSettings() *Settings

func (*ChangeSettingsResponse) ProtoMessage

func (*ChangeSettingsResponse) ProtoMessage()

func (*ChangeSettingsResponse) Reset

func (m *ChangeSettingsResponse) Reset()

func (*ChangeSettingsResponse) String

func (m *ChangeSettingsResponse) String() string

func (*ChangeSettingsResponse) Validate

func (this *ChangeSettingsResponse) Validate() error

func (*ChangeSettingsResponse) XXX_DiscardUnknown

func (m *ChangeSettingsResponse) XXX_DiscardUnknown()

func (*ChangeSettingsResponse) XXX_Marshal

func (m *ChangeSettingsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ChangeSettingsResponse) XXX_Merge

func (m *ChangeSettingsResponse) XXX_Merge(src proto.Message)

func (*ChangeSettingsResponse) XXX_Size

func (m *ChangeSettingsResponse) XXX_Size() int

func (*ChangeSettingsResponse) XXX_Unmarshal

func (m *ChangeSettingsResponse) XXX_Unmarshal(b []byte) error

type GetSettingsRequest

type GetSettingsRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetSettingsRequest) Descriptor

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

func (*GetSettingsRequest) ProtoMessage

func (*GetSettingsRequest) ProtoMessage()

func (*GetSettingsRequest) Reset

func (m *GetSettingsRequest) Reset()

func (*GetSettingsRequest) String

func (m *GetSettingsRequest) String() string

func (*GetSettingsRequest) Validate

func (this *GetSettingsRequest) Validate() error

func (*GetSettingsRequest) XXX_DiscardUnknown

func (m *GetSettingsRequest) XXX_DiscardUnknown()

func (*GetSettingsRequest) XXX_Marshal

func (m *GetSettingsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetSettingsRequest) XXX_Merge

func (m *GetSettingsRequest) XXX_Merge(src proto.Message)

func (*GetSettingsRequest) XXX_Size

func (m *GetSettingsRequest) XXX_Size() int

func (*GetSettingsRequest) XXX_Unmarshal

func (m *GetSettingsRequest) XXX_Unmarshal(b []byte) error

type GetSettingsResponse

type GetSettingsResponse struct {
	Settings             *Settings `protobuf:"bytes,1,opt,name=settings,proto3" json:"settings,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*GetSettingsResponse) Descriptor

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

func (*GetSettingsResponse) GetSettings

func (m *GetSettingsResponse) GetSettings() *Settings

func (*GetSettingsResponse) ProtoMessage

func (*GetSettingsResponse) ProtoMessage()

func (*GetSettingsResponse) Reset

func (m *GetSettingsResponse) Reset()

func (*GetSettingsResponse) String

func (m *GetSettingsResponse) String() string

func (*GetSettingsResponse) Validate

func (this *GetSettingsResponse) Validate() error

func (*GetSettingsResponse) XXX_DiscardUnknown

func (m *GetSettingsResponse) XXX_DiscardUnknown()

func (*GetSettingsResponse) XXX_Marshal

func (m *GetSettingsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetSettingsResponse) XXX_Merge

func (m *GetSettingsResponse) XXX_Merge(src proto.Message)

func (*GetSettingsResponse) XXX_Size

func (m *GetSettingsResponse) XXX_Size() int

func (*GetSettingsResponse) XXX_Unmarshal

func (m *GetSettingsResponse) XXX_Unmarshal(b []byte) error

type MetricsResolutions

type MetricsResolutions struct {
	// High resolution. Suffix 's' is required in JSON: 1s, 60s, 300s.
	Hr *duration.Duration `protobuf:"bytes,1,opt,name=hr,proto3" json:"hr,omitempty"`
	// Medium resolution. Suffix 's' is required in JSON: 1s, 60s, 300s.
	Mr *duration.Duration `protobuf:"bytes,2,opt,name=mr,proto3" json:"mr,omitempty"`
	// Low resolution. Suffix 's' is required in JSON: 1s, 60s, 300s.
	Lr                   *duration.Duration `protobuf:"bytes,3,opt,name=lr,proto3" json:"lr,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

MetricsResolutions represents Prometheus exporters metrics resolutions.

func (*MetricsResolutions) Descriptor

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

func (*MetricsResolutions) GetHr

func (m *MetricsResolutions) GetHr() *duration.Duration

func (*MetricsResolutions) GetLr

func (m *MetricsResolutions) GetLr() *duration.Duration

func (*MetricsResolutions) GetMr

func (m *MetricsResolutions) GetMr() *duration.Duration

func (*MetricsResolutions) ProtoMessage

func (*MetricsResolutions) ProtoMessage()

func (*MetricsResolutions) Reset

func (m *MetricsResolutions) Reset()

func (*MetricsResolutions) String

func (m *MetricsResolutions) String() string

func (*MetricsResolutions) Validate

func (this *MetricsResolutions) Validate() error

func (*MetricsResolutions) XXX_DiscardUnknown

func (m *MetricsResolutions) XXX_DiscardUnknown()

func (*MetricsResolutions) XXX_Marshal

func (m *MetricsResolutions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MetricsResolutions) XXX_Merge

func (m *MetricsResolutions) XXX_Merge(src proto.Message)

func (*MetricsResolutions) XXX_Size

func (m *MetricsResolutions) XXX_Size() int

func (*MetricsResolutions) XXX_Unmarshal

func (m *MetricsResolutions) XXX_Unmarshal(b []byte) error

type ServerClient

type ServerClient interface {
	// Version returns PMM Server version.
	Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error)
	// GetSettings returns current PMM Server settings.
	GetSettings(ctx context.Context, in *GetSettingsRequest, opts ...grpc.CallOption) (*GetSettingsResponse, error)
	// ChangeSettings changes PMM Server settings.
	ChangeSettings(ctx context.Context, in *ChangeSettingsRequest, opts ...grpc.CallOption) (*ChangeSettingsResponse, error)
}

ServerClient is the client API for Server service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewServerClient

func NewServerClient(cc *grpc.ClientConn) ServerClient

type ServerServer

type ServerServer interface {
	// Version returns PMM Server version.
	Version(context.Context, *VersionRequest) (*VersionResponse, error)
	// GetSettings returns current PMM Server settings.
	GetSettings(context.Context, *GetSettingsRequest) (*GetSettingsResponse, error)
	// ChangeSettings changes PMM Server settings.
	ChangeSettings(context.Context, *ChangeSettingsRequest) (*ChangeSettingsResponse, error)
}

ServerServer is the server API for Server service.

type Settings

type Settings struct {
	MetricsResolutions   *MetricsResolutions `protobuf:"bytes,1,opt,name=metrics_resolutions,json=metricsResolutions,proto3" json:"metrics_resolutions,omitempty"`
	Telemetry            bool                `protobuf:"varint,2,opt,name=telemetry,proto3" json:"telemetry,omitempty"`
	XXX_NoUnkeyedLiteral struct{}            `json:"-"`
	XXX_unrecognized     []byte              `json:"-"`
	XXX_sizecache        int32               `json:"-"`
}

Settings represents PMM Server settings.

func (*Settings) Descriptor

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

func (*Settings) GetMetricsResolutions

func (m *Settings) GetMetricsResolutions() *MetricsResolutions

func (*Settings) GetTelemetry

func (m *Settings) GetTelemetry() bool

func (*Settings) ProtoMessage

func (*Settings) ProtoMessage()

func (*Settings) Reset

func (m *Settings) Reset()

func (*Settings) String

func (m *Settings) String() string

func (*Settings) Validate

func (this *Settings) Validate() error

func (*Settings) XXX_DiscardUnknown

func (m *Settings) XXX_DiscardUnknown()

func (*Settings) XXX_Marshal

func (m *Settings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Settings) XXX_Merge

func (m *Settings) XXX_Merge(src proto.Message)

func (*Settings) XXX_Size

func (m *Settings) XXX_Size() int

func (*Settings) XXX_Unmarshal

func (m *Settings) XXX_Unmarshal(b []byte) error

type UnimplementedServerServer

type UnimplementedServerServer struct {
}

UnimplementedServerServer can be embedded to have forward compatible implementations.

func (*UnimplementedServerServer) ChangeSettings

func (*UnimplementedServerServer) GetSettings

func (*UnimplementedServerServer) Version

type VersionRequest

type VersionRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*VersionRequest) Descriptor

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

func (*VersionRequest) ProtoMessage

func (*VersionRequest) ProtoMessage()

func (*VersionRequest) Reset

func (m *VersionRequest) Reset()

func (*VersionRequest) String

func (m *VersionRequest) String() string

func (*VersionRequest) Validate

func (this *VersionRequest) Validate() error

func (*VersionRequest) XXX_DiscardUnknown

func (m *VersionRequest) XXX_DiscardUnknown()

func (*VersionRequest) XXX_Marshal

func (m *VersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*VersionRequest) XXX_Merge

func (m *VersionRequest) XXX_Merge(src proto.Message)

func (*VersionRequest) XXX_Size

func (m *VersionRequest) XXX_Size() int

func (*VersionRequest) XXX_Unmarshal

func (m *VersionRequest) XXX_Unmarshal(b []byte) error

type VersionResponse

type VersionResponse struct {
	// Full PMM version.
	Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	// Build timestamp.
	Timestamp *timestamp.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// pmm-managed commit.
	PmmManagedCommit     string   `protobuf:"bytes,3,opt,name=pmm_managed_commit,json=pmmManagedCommit,proto3" json:"pmm_managed_commit,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*VersionResponse) Descriptor

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

func (*VersionResponse) GetPmmManagedCommit

func (m *VersionResponse) GetPmmManagedCommit() string

func (*VersionResponse) GetTimestamp

func (m *VersionResponse) GetTimestamp() *timestamp.Timestamp

func (*VersionResponse) GetVersion

func (m *VersionResponse) GetVersion() string

func (*VersionResponse) ProtoMessage

func (*VersionResponse) ProtoMessage()

func (*VersionResponse) Reset

func (m *VersionResponse) Reset()

func (*VersionResponse) String

func (m *VersionResponse) String() string

func (*VersionResponse) Validate

func (this *VersionResponse) Validate() error

func (*VersionResponse) XXX_DiscardUnknown

func (m *VersionResponse) XXX_DiscardUnknown()

func (*VersionResponse) XXX_Marshal

func (m *VersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*VersionResponse) XXX_Merge

func (m *VersionResponse) XXX_Merge(src proto.Message)

func (*VersionResponse) XXX_Size

func (m *VersionResponse) XXX_Size() int

func (*VersionResponse) XXX_Unmarshal

func (m *VersionResponse) XXX_Unmarshal(b []byte) error

Directories

Path Synopsis
json

Jump to

Keyboard shortcuts

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