protobufs

package
v1.3.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: MIT Imports: 9 Imported by: 0

README

To generate go code for the notifier.proto files, run :

protoc --go_out=. --go_opt=paths=source_relative \
    --go-grpc_out=. --go-grpc_opt=paths=source_relative \
    proto/alert.proto`

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_notifier_proto protoreflect.FileDescriptor

Functions

func RegisterNotifierServer

func RegisterNotifierServer(s *grpc.Server, srv NotifierServer)

Types

type Config

type Config struct {
	Config []byte `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated

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

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetConfig

func (x *Config) GetConfig() []byte

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

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

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) 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 (m *GRPCClient) Configure(ctx context.Context, config *Config) (*Empty, error)

func (*GRPCClient) Notify

func (m *GRPCClient) Notify(ctx context.Context, notification *Notification) (*Empty, error)

type GRPCServer

type GRPCServer struct {
	Impl Notifier
}

type Notification

type Notification struct {
	Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*Notification) Descriptor deprecated

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

Deprecated: Use Notification.ProtoReflect.Descriptor instead.

func (*Notification) GetName

func (x *Notification) GetName() string

func (*Notification) GetText

func (x *Notification) GetText() string

func (*Notification) ProtoMessage

func (*Notification) ProtoMessage()

func (*Notification) ProtoReflect

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

func (*Notification) Reset

func (x *Notification) Reset()

func (*Notification) String

func (x *Notification) String() string

type Notifier

type Notifier interface {
	Notify(ctx context.Context, notification *Notification) (*Empty, error)
	Configure(ctx context.Context, config *Config) (*Empty, error)
}

type NotifierClient

type NotifierClient interface {
	Notify(ctx context.Context, in *Notification, opts ...grpc.CallOption) (*Empty, error)
	Configure(ctx context.Context, in *Config, opts ...grpc.CallOption) (*Empty, error)
}

NotifierClient is the client API for Notifier service.

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

func NewNotifierClient

func NewNotifierClient(cc grpc.ClientConnInterface) NotifierClient

type NotifierPlugin

type NotifierPlugin struct {
	// GRPCPlugin must still implement the Plugin interface
	plugin.Plugin
	// Concrete implementation, written in Go. This is only used for plugins
	// that are written in Go.
	Impl Notifier
}

This is the implementation of plugin.NotifierPlugin so we can serve/consume this.

func (*NotifierPlugin) GRPCClient

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

func (*NotifierPlugin) GRPCServer

func (p *NotifierPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

type NotifierServer

type NotifierServer interface {
	Notify(context.Context, *Notification) (*Empty, error)
	Configure(context.Context, *Config) (*Empty, error)
}

NotifierServer is the server API for Notifier service.

type UnimplementedNotifierServer

type UnimplementedNotifierServer struct {
}

UnimplementedNotifierServer can be embedded to have forward compatible implementations.

func (*UnimplementedNotifierServer) Configure

func (*UnimplementedNotifierServer) Notify

Jump to

Keyboard shortcuts

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