registry

package
v3.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package registry is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRegistryHandler

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

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

func RegisterRegistryHandlerClient

func RegisterRegistryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RegistryClient) error

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

func RegisterRegistryHandlerFromEndpoint

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

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

func RegisterRegistryServer

func RegisterRegistryServer(s *grpc.Server, srv RegistryServer)

Types

type Broker

type Broker struct {
	// Registry metadata.
	Tags map[string]string `` /* 149-byte string literal not displayed */
	// Broker metadata from ZooKeeper.
	Id                          uint32            `protobuf:"varint,5,opt,name=id,proto3" json:"id,omitempty"`
	Listenersecurityprotocolmap map[string]string `` /* 195-byte string literal not displayed */
	Endpoints                   []string          `protobuf:"bytes,7,rep,name=endpoints,proto3" json:"endpoints,omitempty"`
	Rack                        string            `protobuf:"bytes,8,opt,name=rack,proto3" json:"rack,omitempty"`
	Jmxport                     uint32            `protobuf:"varint,9,opt,name=jmxport,proto3" json:"jmxport,omitempty"`
	Host                        string            `protobuf:"bytes,10,opt,name=host,proto3" json:"host,omitempty"`
	Timestamp                   int64             `protobuf:"varint,11,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Port                        uint32            `protobuf:"varint,12,opt,name=port,proto3" json:"port,omitempty"`
	Version                     uint32            `protobuf:"varint,13,opt,name=version,proto3" json:"version,omitempty"`
	XXX_NoUnkeyedLiteral        struct{}          `json:"-"`
	XXX_unrecognized            []byte            `json:"-"`
	XXX_sizecache               int32             `json:"-"`
}

func (*Broker) Descriptor

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

func (*Broker) GetEndpoints

func (m *Broker) GetEndpoints() []string

func (*Broker) GetHost

func (m *Broker) GetHost() string

func (*Broker) GetId

func (m *Broker) GetId() uint32

func (*Broker) GetJmxport

func (m *Broker) GetJmxport() uint32

func (*Broker) GetListenersecurityprotocolmap

func (m *Broker) GetListenersecurityprotocolmap() map[string]string

func (*Broker) GetPort

func (m *Broker) GetPort() uint32

func (*Broker) GetRack

func (m *Broker) GetRack() string

func (*Broker) GetTags

func (m *Broker) GetTags() map[string]string

func (*Broker) GetTimestamp

func (m *Broker) GetTimestamp() int64

func (*Broker) GetVersion

func (m *Broker) GetVersion() uint32

func (*Broker) ProtoMessage

func (*Broker) ProtoMessage()

func (*Broker) Reset

func (m *Broker) Reset()

func (*Broker) String

func (m *Broker) String() string

func (*Broker) XXX_DiscardUnknown

func (m *Broker) XXX_DiscardUnknown()

func (*Broker) XXX_Marshal

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

func (*Broker) XXX_Merge

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

func (*Broker) XXX_Size

func (m *Broker) XXX_Size() int

func (*Broker) XXX_Unmarshal

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

type BrokerRequest

type BrokerRequest struct {
	Tag                  []string `protobuf:"bytes,1,rep,name=tag,proto3" json:"tag,omitempty"`
	Id                   uint32   `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*BrokerRequest) Descriptor

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

func (*BrokerRequest) GetId

func (m *BrokerRequest) GetId() uint32

func (*BrokerRequest) GetTag

func (m *BrokerRequest) GetTag() []string

func (*BrokerRequest) ProtoMessage

func (*BrokerRequest) ProtoMessage()

func (*BrokerRequest) Reset

func (m *BrokerRequest) Reset()

func (*BrokerRequest) String

func (m *BrokerRequest) String() string

func (*BrokerRequest) XXX_DiscardUnknown

func (m *BrokerRequest) XXX_DiscardUnknown()

func (*BrokerRequest) XXX_Marshal

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

func (*BrokerRequest) XXX_Merge

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

func (*BrokerRequest) XXX_Size

func (m *BrokerRequest) XXX_Size() int

func (*BrokerRequest) XXX_Unmarshal

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

type BrokerResponse

type BrokerResponse struct {
	Brokers              map[uint32]*Broker `` /* 156-byte string literal not displayed */
	Ids                  []uint32           `protobuf:"varint,6,rep,packed,name=ids,proto3" json:"ids,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

func (*BrokerResponse) Descriptor

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

func (*BrokerResponse) GetBrokers

func (m *BrokerResponse) GetBrokers() map[uint32]*Broker

func (*BrokerResponse) GetIds

func (m *BrokerResponse) GetIds() []uint32

func (*BrokerResponse) ProtoMessage

func (*BrokerResponse) ProtoMessage()

func (*BrokerResponse) Reset

func (m *BrokerResponse) Reset()

func (*BrokerResponse) String

func (m *BrokerResponse) String() string

func (*BrokerResponse) XXX_DiscardUnknown

func (m *BrokerResponse) XXX_DiscardUnknown()

func (*BrokerResponse) XXX_Marshal

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

func (*BrokerResponse) XXX_Merge

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

func (*BrokerResponse) XXX_Size

func (m *BrokerResponse) XXX_Size() int

func (*BrokerResponse) XXX_Unmarshal

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

type RegistryClient

type RegistryClient interface {
	// GetBrokers returns a BrokerResponse with the brokers field populated
	// with full broker metadata. If the input BrokerRequest.id field is
	// non-nil, a single broker is returned matching the ID specified in the
	// Broker object. Otherwise all brokers are returned, optionally filtered
	// by any provided BrokerRequest.tags parameters.
	GetBrokers(ctx context.Context, in *BrokerRequest, opts ...grpc.CallOption) (*BrokerResponse, error)
	// ListBrokers returns a BrokerResponse with the ids field populated
	// with broker IDs. If the input BrokerRequest.id field is non-nil,
	// a single broker ID is returned matching the ID specified in the
	// Broker object if the broker exists. Otherwise all brokers are returned,
	// optionally filtered by any provided BrokerRequest.tags parameters.
	ListBrokers(ctx context.Context, in *BrokerRequest, opts ...grpc.CallOption) (*BrokerResponse, error)
	// GetTopics returns a TopicResponse with the topics field populated
	// with full topic metadata. If the input TopicRequest.name field is
	// non-nil, a single topic is returned matching the name specified in the
	// Topic object. Otherwise all topics are returned, optionally filtered
	// by any provided TopicRequest.tags parameters.
	GetTopics(ctx context.Context, in *TopicRequest, opts ...grpc.CallOption) (*TopicResponse, error)
	// ListTopics returns a TopicResponse with the names field populated
	// with topic names. If the input TopicRequest.name field is non-nil,
	// a single topic name is returned matching the name specified in the
	// Topic object if the topic exists. Otherwise all topics are returned,
	// optionally filtered by any provided TopicRequest.tags parameters.
	ListTopics(ctx context.Context, in *TopicRequest, opts ...grpc.CallOption) (*TopicResponse, error)
	// TopicMappings returns a BrokerResponse with the ids field
	// populated with broker IDs that hold at least one partition
	// for the requested topic. The topic is specified in the
	// TopicRequest.name field.
	TopicMappings(ctx context.Context, in *TopicRequest, opts ...grpc.CallOption) (*BrokerResponse, error)
	// BrokerMappings returns a TopicResponse with the names field
	// populated with topics that the broker holds at least one partition
	// for the requested broker. The broker is specified in the
	// BrokerRequest.id field.
	BrokerMappings(ctx context.Context, in *BrokerRequest, opts ...grpc.CallOption) (*TopicResponse, error)
	// TagTopic takes a TopicRequest and sets any specified
	// tags for the named topic. Any existing tags that are
	// not specified in the request are left unmodified.
	TagTopic(ctx context.Context, in *TopicRequest, opts ...grpc.CallOption) (*TagResponse, error)
	// DeleteTopicTags takes a TopicRequest and deletes any
	// specified tags for the named topic. Tags must be provided
	// as key names only; "key:value" will not target the tag "key".
	DeleteTopicTags(ctx context.Context, in *TopicRequest, opts ...grpc.CallOption) (*TagResponse, error)
	// TagBroker takes a BrokerRequest and sets any specified
	// tags for the named broker. Any existing tags that are
	// not specified in the request are left unmodified.
	TagBroker(ctx context.Context, in *BrokerRequest, opts ...grpc.CallOption) (*TagResponse, error)
	// DeleteBrokerTags takes a BrokerRequest and deletes any
	// specified tags for the named broker. Tags must be provided
	// as key names only; "key:value" will not target the tag "key".
	DeleteBrokerTags(ctx context.Context, in *BrokerRequest, opts ...grpc.CallOption) (*TagResponse, error)
}

RegistryClient is the client API for Registry service.

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

func NewRegistryClient

func NewRegistryClient(cc *grpc.ClientConn) RegistryClient

type RegistryServer

type RegistryServer interface {
	// GetBrokers returns a BrokerResponse with the brokers field populated
	// with full broker metadata. If the input BrokerRequest.id field is
	// non-nil, a single broker is returned matching the ID specified in the
	// Broker object. Otherwise all brokers are returned, optionally filtered
	// by any provided BrokerRequest.tags parameters.
	GetBrokers(context.Context, *BrokerRequest) (*BrokerResponse, error)
	// ListBrokers returns a BrokerResponse with the ids field populated
	// with broker IDs. If the input BrokerRequest.id field is non-nil,
	// a single broker ID is returned matching the ID specified in the
	// Broker object if the broker exists. Otherwise all brokers are returned,
	// optionally filtered by any provided BrokerRequest.tags parameters.
	ListBrokers(context.Context, *BrokerRequest) (*BrokerResponse, error)
	// GetTopics returns a TopicResponse with the topics field populated
	// with full topic metadata. If the input TopicRequest.name field is
	// non-nil, a single topic is returned matching the name specified in the
	// Topic object. Otherwise all topics are returned, optionally filtered
	// by any provided TopicRequest.tags parameters.
	GetTopics(context.Context, *TopicRequest) (*TopicResponse, error)
	// ListTopics returns a TopicResponse with the names field populated
	// with topic names. If the input TopicRequest.name field is non-nil,
	// a single topic name is returned matching the name specified in the
	// Topic object if the topic exists. Otherwise all topics are returned,
	// optionally filtered by any provided TopicRequest.tags parameters.
	ListTopics(context.Context, *TopicRequest) (*TopicResponse, error)
	// TopicMappings returns a BrokerResponse with the ids field
	// populated with broker IDs that hold at least one partition
	// for the requested topic. The topic is specified in the
	// TopicRequest.name field.
	TopicMappings(context.Context, *TopicRequest) (*BrokerResponse, error)
	// BrokerMappings returns a TopicResponse with the names field
	// populated with topics that the broker holds at least one partition
	// for the requested broker. The broker is specified in the
	// BrokerRequest.id field.
	BrokerMappings(context.Context, *BrokerRequest) (*TopicResponse, error)
	// TagTopic takes a TopicRequest and sets any specified
	// tags for the named topic. Any existing tags that are
	// not specified in the request are left unmodified.
	TagTopic(context.Context, *TopicRequest) (*TagResponse, error)
	// DeleteTopicTags takes a TopicRequest and deletes any
	// specified tags for the named topic. Tags must be provided
	// as key names only; "key:value" will not target the tag "key".
	DeleteTopicTags(context.Context, *TopicRequest) (*TagResponse, error)
	// TagBroker takes a BrokerRequest and sets any specified
	// tags for the named broker. Any existing tags that are
	// not specified in the request are left unmodified.
	TagBroker(context.Context, *BrokerRequest) (*TagResponse, error)
	// DeleteBrokerTags takes a BrokerRequest and deletes any
	// specified tags for the named broker. Tags must be provided
	// as key names only; "key:value" will not target the tag "key".
	DeleteBrokerTags(context.Context, *BrokerRequest) (*TagResponse, error)
}

RegistryServer is the server API for Registry service.

type TagResponse

type TagResponse struct {
	Message              string   `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*TagResponse) Descriptor

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

func (*TagResponse) GetMessage

func (m *TagResponse) GetMessage() string

func (*TagResponse) ProtoMessage

func (*TagResponse) ProtoMessage()

func (*TagResponse) Reset

func (m *TagResponse) Reset()

func (*TagResponse) String

func (m *TagResponse) String() string

func (*TagResponse) XXX_DiscardUnknown

func (m *TagResponse) XXX_DiscardUnknown()

func (*TagResponse) XXX_Marshal

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

func (*TagResponse) XXX_Merge

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

func (*TagResponse) XXX_Size

func (m *TagResponse) XXX_Size() int

func (*TagResponse) XXX_Unmarshal

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

type Topic

type Topic struct {
	// Registry metadata.
	Tags map[string]string `` /* 149-byte string literal not displayed */
	// Topic metadata from ZooKeeper.
	Name                 string   `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"`
	Partitions           uint32   `protobuf:"varint,6,opt,name=partitions,proto3" json:"partitions,omitempty"`
	Replication          uint32   `protobuf:"varint,7,opt,name=replication,proto3" json:"replication,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Topic) Descriptor

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

func (*Topic) GetName

func (m *Topic) GetName() string

func (*Topic) GetPartitions

func (m *Topic) GetPartitions() uint32

func (*Topic) GetReplication

func (m *Topic) GetReplication() uint32

func (*Topic) GetTags

func (m *Topic) GetTags() map[string]string

func (*Topic) ProtoMessage

func (*Topic) ProtoMessage()

func (*Topic) Reset

func (m *Topic) Reset()

func (*Topic) String

func (m *Topic) String() string

func (*Topic) XXX_DiscardUnknown

func (m *Topic) XXX_DiscardUnknown()

func (*Topic) XXX_Marshal

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

func (*Topic) XXX_Merge

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

func (*Topic) XXX_Size

func (m *Topic) XXX_Size() int

func (*Topic) XXX_Unmarshal

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

type TopicRequest

type TopicRequest struct {
	Tag                  []string `protobuf:"bytes,1,rep,name=tag,proto3" json:"tag,omitempty"`
	Name                 string   `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*TopicRequest) Descriptor

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

func (*TopicRequest) GetName

func (m *TopicRequest) GetName() string

func (*TopicRequest) GetTag

func (m *TopicRequest) GetTag() []string

func (*TopicRequest) ProtoMessage

func (*TopicRequest) ProtoMessage()

func (*TopicRequest) Reset

func (m *TopicRequest) Reset()

func (*TopicRequest) String

func (m *TopicRequest) String() string

func (*TopicRequest) XXX_DiscardUnknown

func (m *TopicRequest) XXX_DiscardUnknown()

func (*TopicRequest) XXX_Marshal

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

func (*TopicRequest) XXX_Merge

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

func (*TopicRequest) XXX_Size

func (m *TopicRequest) XXX_Size() int

func (*TopicRequest) XXX_Unmarshal

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

type TopicResponse

type TopicResponse struct {
	Topics               map[string]*Topic `` /* 153-byte string literal not displayed */
	Names                []string          `protobuf:"bytes,6,rep,name=names,proto3" json:"names,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*TopicResponse) Descriptor

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

func (*TopicResponse) GetNames

func (m *TopicResponse) GetNames() []string

func (*TopicResponse) GetTopics

func (m *TopicResponse) GetTopics() map[string]*Topic

func (*TopicResponse) ProtoMessage

func (*TopicResponse) ProtoMessage()

func (*TopicResponse) Reset

func (m *TopicResponse) Reset()

func (*TopicResponse) String

func (m *TopicResponse) String() string

func (*TopicResponse) XXX_DiscardUnknown

func (m *TopicResponse) XXX_DiscardUnknown()

func (*TopicResponse) XXX_Marshal

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

func (*TopicResponse) XXX_Merge

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

func (*TopicResponse) XXX_Size

func (m *TopicResponse) XXX_Size() int

func (*TopicResponse) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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