introproto

package
v0.9.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Overview

Package introproto is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterPublisherHandler

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

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

func RegisterPublisherHandlerClient

func RegisterPublisherHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PublisherClient) error

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

func RegisterPublisherHandlerFromEndpoint

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

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

func RegisterPublisherServer

func RegisterPublisherServer(s *grpc.Server, srv PublisherServer)

Types

type AllMessageFilterStats

type AllMessageFilterStats struct {
	Filters              []*MessageFilterWithStat `protobuf:"bytes,1,rep,name=Filters,proto3" json:"Filters,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                 `json:"-"`
	XXX_unrecognized     []byte                   `json:"-"`
	XXX_sizecache        int32                    `json:"-"`
}

AllMessageFilterStats map of MessageFilterWithStat per message type.

func (*AllMessageFilterStats) Descriptor

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

func (*AllMessageFilterStats) GetFilters

func (m *AllMessageFilterStats) GetFilters() []*MessageFilterWithStat

func (*AllMessageFilterStats) ProtoMessage

func (*AllMessageFilterStats) ProtoMessage()

func (*AllMessageFilterStats) Reset

func (m *AllMessageFilterStats) Reset()

func (*AllMessageFilterStats) String

func (m *AllMessageFilterStats) String() string

func (*AllMessageFilterStats) XXX_DiscardUnknown

func (m *AllMessageFilterStats) XXX_DiscardUnknown()

func (*AllMessageFilterStats) XXX_Marshal

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

func (*AllMessageFilterStats) XXX_Merge

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

func (*AllMessageFilterStats) XXX_Size

func (m *AllMessageFilterStats) XXX_Size() int

func (*AllMessageFilterStats) XXX_Unmarshal

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

type AllMessageStatByType

type AllMessageStatByType struct {
	Counters             []*MessageStatByType `protobuf:"bytes,1,rep,name=Counters,proto3" json:"Counters,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

AllMessageStatByType is a list of counters per message type.

func (*AllMessageStatByType) Descriptor

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

func (*AllMessageStatByType) GetCounters

func (m *AllMessageStatByType) GetCounters() []*MessageStatByType

func (*AllMessageStatByType) ProtoMessage

func (*AllMessageStatByType) ProtoMessage()

func (*AllMessageStatByType) Reset

func (m *AllMessageStatByType) Reset()

func (*AllMessageStatByType) String

func (m *AllMessageStatByType) String() string

func (*AllMessageStatByType) XXX_DiscardUnknown

func (m *AllMessageStatByType) XXX_DiscardUnknown()

func (*AllMessageStatByType) XXX_Marshal

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

func (*AllMessageStatByType) XXX_Merge

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

func (*AllMessageStatByType) XXX_Size

func (m *AllMessageStatByType) XXX_Size() int

func (*AllMessageStatByType) XXX_Unmarshal

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

type EmptyArgs

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

EmptyArgs is just a stub for grpc methods without arguments.

func (*EmptyArgs) Descriptor

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

func (*EmptyArgs) ProtoMessage

func (*EmptyArgs) ProtoMessage()

func (*EmptyArgs) Reset

func (m *EmptyArgs) Reset()

func (*EmptyArgs) String

func (m *EmptyArgs) String() string

func (*EmptyArgs) XXX_DiscardUnknown

func (m *EmptyArgs) XXX_DiscardUnknown()

func (*EmptyArgs) XXX_Marshal

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

func (*EmptyArgs) XXX_Merge

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

func (*EmptyArgs) XXX_Size

func (m *EmptyArgs) XXX_Size() int

func (*EmptyArgs) XXX_Unmarshal

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

type MessageFilterByType

type MessageFilterByType struct {
	Name                 string   `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
	Enable               bool     `protobuf:"varint,2,opt,name=Enable,proto3" json:"Enable,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MessageFilterByType represents filter state for message type.

func (*MessageFilterByType) Descriptor

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

func (*MessageFilterByType) GetEnable

func (m *MessageFilterByType) GetEnable() bool

func (*MessageFilterByType) GetName

func (m *MessageFilterByType) GetName() string

func (*MessageFilterByType) ProtoMessage

func (*MessageFilterByType) ProtoMessage()

func (*MessageFilterByType) Reset

func (m *MessageFilterByType) Reset()

func (*MessageFilterByType) String

func (m *MessageFilterByType) String() string

func (*MessageFilterByType) XXX_DiscardUnknown

func (m *MessageFilterByType) XXX_DiscardUnknown()

func (*MessageFilterByType) XXX_Marshal

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

func (*MessageFilterByType) XXX_Merge

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

func (*MessageFilterByType) XXX_Size

func (m *MessageFilterByType) XXX_Size() int

func (*MessageFilterByType) XXX_Unmarshal

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

type MessageFilterWithStat

type MessageFilterWithStat struct {
	Name                 string   `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
	Enable               bool     `protobuf:"varint,2,opt,name=Enable,proto3" json:"Enable,omitempty"`
	Filtered             int64    `protobuf:"varint,3,opt,name=Filtered,proto3" json:"Filtered,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MessageFilterWithStat represents filter state and count of filtered messages.

func (*MessageFilterWithStat) Descriptor

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

func (*MessageFilterWithStat) GetEnable

func (m *MessageFilterWithStat) GetEnable() bool

func (*MessageFilterWithStat) GetFiltered

func (m *MessageFilterWithStat) GetFiltered() int64

func (*MessageFilterWithStat) GetName

func (m *MessageFilterWithStat) GetName() string

func (*MessageFilterWithStat) ProtoMessage

func (*MessageFilterWithStat) ProtoMessage()

func (*MessageFilterWithStat) Reset

func (m *MessageFilterWithStat) Reset()

func (*MessageFilterWithStat) String

func (m *MessageFilterWithStat) String() string

func (*MessageFilterWithStat) XXX_DiscardUnknown

func (m *MessageFilterWithStat) XXX_DiscardUnknown()

func (*MessageFilterWithStat) XXX_Marshal

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

func (*MessageFilterWithStat) XXX_Merge

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

func (*MessageFilterWithStat) XXX_Size

func (m *MessageFilterWithStat) XXX_Size() int

func (*MessageFilterWithStat) XXX_Unmarshal

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

type MessageStatByType

type MessageStatByType struct {
	Name                 string   `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
	Count                int64    `protobuf:"varint,2,opt,name=Count,proto3" json:"Count,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MessageStatByType is a counter for message type.

func (*MessageStatByType) Descriptor

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

func (*MessageStatByType) GetCount

func (m *MessageStatByType) GetCount() int64

func (*MessageStatByType) GetName

func (m *MessageStatByType) GetName() string

func (*MessageStatByType) ProtoMessage

func (*MessageStatByType) ProtoMessage()

func (*MessageStatByType) Reset

func (m *MessageStatByType) Reset()

func (*MessageStatByType) String

func (m *MessageStatByType) String() string

func (*MessageStatByType) XXX_DiscardUnknown

func (m *MessageStatByType) XXX_DiscardUnknown()

func (*MessageStatByType) XXX_Marshal

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

func (*MessageStatByType) XXX_Merge

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

func (*MessageStatByType) XXX_Size

func (m *MessageStatByType) XXX_Size() int

func (*MessageStatByType) XXX_Unmarshal

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

type PublisherClient

type PublisherClient interface {
	// SetMessagesFilter enables/disables messages publishing by type.
	SetMessagesFilter(ctx context.Context, in *MessageFilterByType, opts ...grpc.CallOption) (*MessageFilterByType, error)
	// GetMessagesFilters returns map with filter state for every message type.
	GetMessagesFilters(ctx context.Context, in *EmptyArgs, opts ...grpc.CallOption) (*AllMessageFilterStats, error)
	// GetMessagesStat returns statistic for published messages by type.
	GetMessagesStat(ctx context.Context, in *EmptyArgs, opts ...grpc.CallOption) (*AllMessageStatByType, error)
}

PublisherClient is the client API for Publisher service.

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

func NewPublisherClient

func NewPublisherClient(cc *grpc.ClientConn) PublisherClient

type PublisherServer

type PublisherServer interface {
	// SetMessagesFilter enables/disables messages publishing by type.
	SetMessagesFilter(context.Context, *MessageFilterByType) (*MessageFilterByType, error)
	// GetMessagesFilters returns map with filter state for every message type.
	GetMessagesFilters(context.Context, *EmptyArgs) (*AllMessageFilterStats, error)
	// GetMessagesStat returns statistic for published messages by type.
	GetMessagesStat(context.Context, *EmptyArgs) (*AllMessageStatByType, error)
}

PublisherServer is the server API for Publisher service.

type UnimplementedPublisherServer

type UnimplementedPublisherServer struct {
}

UnimplementedPublisherServer can be embedded to have forward compatible implementations.

func (*UnimplementedPublisherServer) GetMessagesFilters

func (*UnimplementedPublisherServer) GetMessagesStat

func (*UnimplementedPublisherServer) SetMessagesFilter

Jump to

Keyboard shortcuts

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