common

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_provider_plugin_common_plugin_proto protoreflect.FileDescriptor
View Source
var Handshake = plugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   "HERD",
	MagicCookieValue: "plugin",
}

Functions

func NewLogrusLogger

func NewLogrusLogger(l *logrus.Logger, name string) *logrusLogger

func RegisterLoggerServer

func RegisterLoggerServer(s grpc.ServiceRegistrar, srv LoggerServer)

func RegisterProviderServer

func RegisterProviderServer(s grpc.ServiceRegistrar, srv ProviderServer)

Types

type ConfigureRequest

type ConfigureRequest struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*ConfigureRequest) Descriptor deprecated

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

Deprecated: Use ConfigureRequest.ProtoReflect.Descriptor instead.

func (*ConfigureRequest) GetData

func (x *ConfigureRequest) GetData() []byte

func (*ConfigureRequest) ProtoMessage

func (*ConfigureRequest) ProtoMessage()

func (*ConfigureRequest) ProtoReflect

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

func (*ConfigureRequest) Reset

func (x *ConfigureRequest) Reset()

func (*ConfigureRequest) String

func (x *ConfigureRequest) String() string

type ConfigureResponse

type ConfigureResponse struct {
	Err string `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"`
	// contains filtered or unexported fields
}

func (*ConfigureResponse) Descriptor deprecated

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

Deprecated: Use ConfigureResponse.ProtoReflect.Descriptor instead.

func (*ConfigureResponse) GetErr

func (x *ConfigureResponse) GetErr() string

func (*ConfigureResponse) ProtoMessage

func (*ConfigureResponse) ProtoMessage()

func (*ConfigureResponse) ProtoReflect

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

func (*ConfigureResponse) Reset

func (x *ConfigureResponse) Reset()

func (*ConfigureResponse) String

func (x *ConfigureResponse) String() string

type EmitLogMessageRequest

type EmitLogMessageRequest struct {
	Level   uint32 `protobuf:"varint,1,opt,name=level,proto3" json:"level,omitempty"`
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*EmitLogMessageRequest) Descriptor deprecated

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

Deprecated: Use EmitLogMessageRequest.ProtoReflect.Descriptor instead.

func (*EmitLogMessageRequest) GetLevel

func (x *EmitLogMessageRequest) GetLevel() uint32

func (*EmitLogMessageRequest) GetMessage

func (x *EmitLogMessageRequest) GetMessage() string

func (*EmitLogMessageRequest) ProtoMessage

func (*EmitLogMessageRequest) ProtoMessage()

func (*EmitLogMessageRequest) ProtoReflect

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

func (*EmitLogMessageRequest) Reset

func (x *EmitLogMessageRequest) Reset()

func (*EmitLogMessageRequest) String

func (x *EmitLogMessageRequest) String() string

type Empty

type Empty struct {
	// contains filtered or unexported fields
}

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type GRPCClient

type GRPCClient struct {
	// contains filtered or unexported fields
}

func (*GRPCClient) Configure

func (c *GRPCClient) Configure(settings map[string]interface{}) error

func (*GRPCClient) Load

func (c *GRPCClient) Load(ctx context.Context, logger Logger) (herd.Hosts, error)

type GRPCLoggerClient

type GRPCLoggerClient struct {
	// contains filtered or unexported fields
}

func (*GRPCLoggerClient) EmitLogMessage

func (c *GRPCLoggerClient) EmitLogMessage(level logrus.Level, message string)

func (*GRPCLoggerClient) LoadingMessage

func (c *GRPCLoggerClient) LoadingMessage(name string, done bool, err error)

type GRPCLoggerServer

type GRPCLoggerServer struct {
	UnimplementedLoggerServer
	Impl Logger
}

func (*GRPCLoggerServer) EmitLogMessage

func (s *GRPCLoggerServer) EmitLogMessage(ctx context.Context, req *EmitLogMessageRequest) (*Empty, error)

func (*GRPCLoggerServer) LoadingMessage

func (s *GRPCLoggerServer) LoadingMessage(ctx context.Context, req *LoadingMessageRequest) (*Empty, error)

type GRPCServer

type GRPCServer struct {
	UnimplementedProviderServer
	Impl Provider
	// contains filtered or unexported fields
}

func (*GRPCServer) Configure

func (s *GRPCServer) Configure(ctx context.Context, req *ConfigureRequest) (*ConfigureResponse, error)

func (*GRPCServer) Load

func (s *GRPCServer) Load(ctx context.Context, req *LoadRequest) (*LoadResponse, error)

type LoadRequest

type LoadRequest struct {
	Logger   uint32                 `protobuf:"varint,1,opt,name=logger,proto3" json:"logger,omitempty"`
	Deadline *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=deadline,proto3" json:"deadline,omitempty"`
	// contains filtered or unexported fields
}

func (*LoadRequest) Descriptor deprecated

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

Deprecated: Use LoadRequest.ProtoReflect.Descriptor instead.

func (*LoadRequest) GetDeadline

func (x *LoadRequest) GetDeadline() *timestamppb.Timestamp

func (*LoadRequest) GetLogger

func (x *LoadRequest) GetLogger() uint32

func (*LoadRequest) ProtoMessage

func (*LoadRequest) ProtoMessage()

func (*LoadRequest) ProtoReflect

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

func (*LoadRequest) Reset

func (x *LoadRequest) Reset()

func (*LoadRequest) String

func (x *LoadRequest) String() string

type LoadResponse

type LoadResponse struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	Err  string `protobuf:"bytes,2,opt,name=err,proto3" json:"err,omitempty"`
	// contains filtered or unexported fields
}

func (*LoadResponse) Descriptor deprecated

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

Deprecated: Use LoadResponse.ProtoReflect.Descriptor instead.

func (*LoadResponse) GetData

func (x *LoadResponse) GetData() []byte

func (*LoadResponse) GetErr

func (x *LoadResponse) GetErr() string

func (*LoadResponse) ProtoMessage

func (*LoadResponse) ProtoMessage()

func (*LoadResponse) ProtoReflect

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

func (*LoadResponse) Reset

func (x *LoadResponse) Reset()

func (*LoadResponse) String

func (x *LoadResponse) String() string

type LoadingMessageRequest

type LoadingMessageRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Done bool   `protobuf:"varint,2,opt,name=done,proto3" json:"done,omitempty"`
	Err  string `protobuf:"bytes,3,opt,name=err,proto3" json:"err,omitempty"`
	// contains filtered or unexported fields
}

func (*LoadingMessageRequest) Descriptor deprecated

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

Deprecated: Use LoadingMessageRequest.ProtoReflect.Descriptor instead.

func (*LoadingMessageRequest) GetDone

func (x *LoadingMessageRequest) GetDone() bool

func (*LoadingMessageRequest) GetErr

func (x *LoadingMessageRequest) GetErr() string

func (*LoadingMessageRequest) GetName

func (x *LoadingMessageRequest) GetName() string

func (*LoadingMessageRequest) ProtoMessage

func (*LoadingMessageRequest) ProtoMessage()

func (*LoadingMessageRequest) ProtoReflect

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

func (*LoadingMessageRequest) Reset

func (x *LoadingMessageRequest) Reset()

func (*LoadingMessageRequest) String

func (x *LoadingMessageRequest) String() string

type Logger

type Logger interface {
	LoadingMessage(name string, done bool, err error)
	EmitLogMessage(level logrus.Level, message string)
}

type LoggerClient

type LoggerClient interface {
	LoadingMessage(ctx context.Context, in *LoadingMessageRequest, opts ...grpc.CallOption) (*Empty, error)
	EmitLogMessage(ctx context.Context, in *EmitLogMessageRequest, opts ...grpc.CallOption) (*Empty, error)
}

LoggerClient is the client API for Logger 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.

func NewLoggerClient

func NewLoggerClient(cc grpc.ClientConnInterface) LoggerClient

type LoggerServer

type LoggerServer interface {
	LoadingMessage(context.Context, *LoadingMessageRequest) (*Empty, error)
	EmitLogMessage(context.Context, *EmitLogMessageRequest) (*Empty, error)
	// contains filtered or unexported methods
}

LoggerServer is the server API for Logger service. All implementations must embed UnimplementedLoggerServer for forward compatibility

type Provider

type Provider interface {
	Configure(map[string]interface{}) error
	Load(ctx context.Context, logger Logger) (herd.Hosts, error)
}

type ProviderClient

type ProviderClient interface {
	Configure(ctx context.Context, in *ConfigureRequest, opts ...grpc.CallOption) (*ConfigureResponse, error)
	Load(ctx context.Context, in *LoadRequest, opts ...grpc.CallOption) (*LoadResponse, error)
}

ProviderClient is the client API for Provider 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.

func NewProviderClient

func NewProviderClient(cc grpc.ClientConnInterface) ProviderClient

type ProviderPlugin

type ProviderPlugin struct {
	plugin.NetRPCUnsupportedPlugin
	Impl Provider
}

func (*ProviderPlugin) GRPCClient

func (p *ProviderPlugin) GRPCClient(ctx context.Context, b *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

func (*ProviderPlugin) GRPCServer

func (p *ProviderPlugin) GRPCServer(b *plugin.GRPCBroker, s *grpc.Server) error

type ProviderServer

type ProviderServer interface {
	Configure(context.Context, *ConfigureRequest) (*ConfigureResponse, error)
	Load(context.Context, *LoadRequest) (*LoadResponse, error)
	// contains filtered or unexported methods
}

ProviderServer is the server API for Provider service. All implementations must embed UnimplementedProviderServer for forward compatibility

type UnimplementedLoggerServer

type UnimplementedLoggerServer struct {
}

UnimplementedLoggerServer must be embedded to have forward compatible implementations.

func (UnimplementedLoggerServer) EmitLogMessage

func (UnimplementedLoggerServer) LoadingMessage

type UnimplementedProviderServer

type UnimplementedProviderServer struct {
}

UnimplementedProviderServer must be embedded to have forward compatible implementations.

func (UnimplementedProviderServer) Configure

func (UnimplementedProviderServer) Load

type UnsafeLoggerServer

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

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

type UnsafeProviderServer

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

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

Jump to

Keyboard shortcuts

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