proto

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2020 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Overview

Package proto is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	Alert_AlertSeverity_name = map[int32]string{
		0: "UNSPECIFIED",
		1: "LOW",
		2: "MEDIUM",
		3: "HIGH",
		4: "CRITICAL",
	}
	Alert_AlertSeverity_value = map[string]int32{
		"UNSPECIFIED": 0,
		"LOW":         1,
		"MEDIUM":      2,
		"HIGH":        3,
		"CRITICAL":    4,
	}
)

Enum value maps for Alert_AlertSeverity.

View Source
var File_input_api_proto protoreflect.FileDescriptor

Functions

func RegisterAlertServiceHandler

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

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

func RegisterAlertServiceHandlerClient

func RegisterAlertServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AlertServiceClient) error

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

func RegisterAlertServiceHandlerFromEndpoint

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

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

func RegisterAlertServiceHandlerServer

func RegisterAlertServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AlertServiceServer) error

RegisterAlertServiceHandlerServer registers the http handlers for service AlertService to "mux". UnaryRPC :call AlertServiceServer 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterAlertServiceHandlerFromEndpoint instead.

func RegisterAlertServiceServer

func RegisterAlertServiceServer(s *grpc.Server, srv AlertServiceServer)

Types

type Alert

type Alert struct {
	AffectedSystem string              `protobuf:"bytes,1,opt,name=affectedSystem,proto3" json:"affectedSystem,omitempty"`
	SourceSystem   string              `protobuf:"bytes,2,opt,name=sourceSystem,proto3" json:"sourceSystem,omitempty"`
	Severity       Alert_AlertSeverity `protobuf:"varint,3,opt,name=severity,proto3,enum=proto.Alert_AlertSeverity" json:"severity,omitempty"`
	Message        string              `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"`
	State          string              `protobuf:"bytes,5,opt,name=state,proto3" json:"state,omitempty"`
	Trigger        string              `protobuf:"bytes,6,opt,name=trigger,proto3" json:"trigger,omitempty"`
	Metadata       map[string]string   `` /* 157-byte string literal not displayed */
	Owner          string              `protobuf:"bytes,8,opt,name=owner,proto3" json:"owner,omitempty"`
	// contains filtered or unexported fields
}

func (*Alert) Descriptor deprecated

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

Deprecated: Use Alert.ProtoReflect.Descriptor instead.

func (*Alert) GetAffectedSystem

func (x *Alert) GetAffectedSystem() string

func (*Alert) GetMessage

func (x *Alert) GetMessage() string

func (*Alert) GetMetadata added in v1.0.2

func (x *Alert) GetMetadata() map[string]string

func (*Alert) GetOwner added in v1.0.9

func (x *Alert) GetOwner() string

func (*Alert) GetSeverity

func (x *Alert) GetSeverity() Alert_AlertSeverity

func (*Alert) GetSourceSystem

func (x *Alert) GetSourceSystem() string

func (*Alert) GetState

func (x *Alert) GetState() string

func (*Alert) GetTrigger

func (x *Alert) GetTrigger() string

func (*Alert) ProtoMessage

func (*Alert) ProtoMessage()

func (*Alert) ProtoReflect

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

func (*Alert) Reset

func (x *Alert) Reset()

func (*Alert) String

func (x *Alert) String() string

type AlertServiceClient

type AlertServiceClient interface {
	// SendAlert to API
	SendAlert(ctx context.Context, in *Alert, opts ...grpc.CallOption) (*Alert, error)
}

AlertServiceClient is the client API for AlertService service.

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

type AlertServiceServer

type AlertServiceServer interface {
	// SendAlert to API
	SendAlert(context.Context, *Alert) (*Alert, error)
}

AlertServiceServer is the server API for AlertService service.

type Alert_AlertSeverity

type Alert_AlertSeverity int32
const (
	Alert_UNSPECIFIED Alert_AlertSeverity = 0
	Alert_LOW         Alert_AlertSeverity = 1
	Alert_MEDIUM      Alert_AlertSeverity = 2
	Alert_HIGH        Alert_AlertSeverity = 3
	Alert_CRITICAL    Alert_AlertSeverity = 4
)

func (Alert_AlertSeverity) Descriptor

func (Alert_AlertSeverity) Enum

func (Alert_AlertSeverity) EnumDescriptor deprecated

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

Deprecated: Use Alert_AlertSeverity.Descriptor instead.

func (Alert_AlertSeverity) Number

func (Alert_AlertSeverity) String

func (x Alert_AlertSeverity) String() string

func (Alert_AlertSeverity) Type

type Alerts

type Alerts struct {
	Alert []*Alert `protobuf:"bytes,1,rep,name=alert,proto3" json:"alert,omitempty"`
	// contains filtered or unexported fields
}

func (*Alerts) Descriptor deprecated

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

Deprecated: Use Alerts.ProtoReflect.Descriptor instead.

func (*Alerts) GetAlert

func (x *Alerts) GetAlert() []*Alert

func (*Alerts) ProtoMessage

func (*Alerts) ProtoMessage()

func (*Alerts) ProtoReflect

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

func (*Alerts) Reset

func (x *Alerts) Reset()

func (*Alerts) String

func (x *Alerts) 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 ID

type ID struct {
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*ID) Descriptor deprecated

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

Deprecated: Use ID.ProtoReflect.Descriptor instead.

func (*ID) GetId

func (x *ID) GetId() int64

func (*ID) ProtoMessage

func (*ID) ProtoMessage()

func (*ID) ProtoReflect

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

func (*ID) Reset

func (x *ID) Reset()

func (*ID) String

func (x *ID) String() string

type UnimplementedAlertServiceServer

type UnimplementedAlertServiceServer struct {
}

UnimplementedAlertServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedAlertServiceServer) SendAlert

Directories

Path Synopsis
genswagger
Package genswagger provides a code generator for swagger.
Package genswagger provides a code generator for swagger.

Jump to

Keyboard shortcuts

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