channel

package
v0.12.6 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package channel is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_channel_proto protoreflect.FileDescriptor

Functions

func RegisterChannelAPIHandler

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

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

func RegisterChannelAPIHandlerClient

func RegisterChannelAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChannelAPIClient) error

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

func RegisterChannelAPIHandlerFromEndpoint

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

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

func RegisterChannelAPIHandlerServer

func RegisterChannelAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChannelAPIServer) error

RegisterChannelAPIHandlerServer registers the http handlers for service ChannelAPI to "mux". UnaryRPC :call ChannelAPIServer 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 to stop working. Consider using RegisterChannelAPIHandlerFromEndpoint instead.

func RegisterChannelAPIServer

func RegisterChannelAPIServer(s grpc.ServiceRegistrar, srv ChannelAPIServer)

Types

type Channel

type Channel struct {
	Id                string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Title             string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
	Label             string `protobuf:"bytes,3,opt,name=label,proto3" json:"label,omitempty"`
	Description       string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
	OwnerId           string `protobuf:"bytes,5,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"`
	CreateTimeSeconds int32  `protobuf:"varint,6,opt,name=create_time_seconds,json=createTimeSeconds,proto3" json:"create_time_seconds,omitempty"`
	Subscribers       int32  `protobuf:"varint,7,opt,name=subscribers,proto3" json:"subscribers,omitempty"`
	// contains filtered or unexported fields
}

func (*Channel) Descriptor deprecated

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

Deprecated: Use Channel.ProtoReflect.Descriptor instead.

func (*Channel) GetCreateTimeSeconds

func (x *Channel) GetCreateTimeSeconds() int32

func (*Channel) GetDescription

func (x *Channel) GetDescription() string

func (*Channel) GetId

func (x *Channel) GetId() string

func (*Channel) GetLabel

func (x *Channel) GetLabel() string

func (*Channel) GetOwnerId

func (x *Channel) GetOwnerId() string

func (*Channel) GetSubscribers

func (x *Channel) GetSubscribers() int32

func (*Channel) GetTitle

func (x *Channel) GetTitle() string

func (*Channel) ProtoMessage

func (*Channel) ProtoMessage()

func (*Channel) ProtoReflect

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

func (*Channel) Reset

func (x *Channel) Reset()

func (*Channel) String

func (x *Channel) String() string

type ChannelAPIClient

type ChannelAPIClient interface {
	// Creates a new subscriber channel
	CreateChannel(ctx context.Context, in *CreateChannelRequest, opts ...grpc.CallOption) (*CreateChannelResponse, error)
	// Updates an existing channel resource
	UpdateChannel(ctx context.Context, in *UpdateChannelRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	// Removes a subscribers channel
	DeleteChannel(ctx context.Context, in *DeleteChannelRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	// Retrieves a collection of channels resource
	ListChannels(ctx context.Context, in *ListChannelsRequest, opts ...grpc.CallOption) (*ListChannelsResponse, error)
	// Searches for channels
	SearchChannels(ctx context.Context, in *SearchChannelsRequest, opts ...grpc.CallOption) (*ListChannelsResponse, error)
	// Retrieves a single channel resource
	GetChannel(ctx context.Context, in *GetChannelRequest, opts ...grpc.CallOption) (*Channel, error)
	// Increment subscribers by one.
	IncrementSubscribers(ctx context.Context, in *SubscribersRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	// Decrement subscribers by one.
	DecrementSubscribers(ctx context.Context, in *SubscribersRequest, opts ...grpc.CallOption) (*empty.Empty, error)
}

ChannelAPIClient is the client API for ChannelAPI 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 NewChannelAPIClient

func NewChannelAPIClient(cc grpc.ClientConnInterface) ChannelAPIClient

type ChannelAPIServer

type ChannelAPIServer interface {
	// Creates a new subscriber channel
	CreateChannel(context.Context, *CreateChannelRequest) (*CreateChannelResponse, error)
	// Updates an existing channel resource
	UpdateChannel(context.Context, *UpdateChannelRequest) (*empty.Empty, error)
	// Removes a subscribers channel
	DeleteChannel(context.Context, *DeleteChannelRequest) (*empty.Empty, error)
	// Retrieves a collection of channels resource
	ListChannels(context.Context, *ListChannelsRequest) (*ListChannelsResponse, error)
	// Searches for channels
	SearchChannels(context.Context, *SearchChannelsRequest) (*ListChannelsResponse, error)
	// Retrieves a single channel resource
	GetChannel(context.Context, *GetChannelRequest) (*Channel, error)
	// Increment subscribers by one.
	IncrementSubscribers(context.Context, *SubscribersRequest) (*empty.Empty, error)
	// Decrement subscribers by one.
	DecrementSubscribers(context.Context, *SubscribersRequest) (*empty.Empty, error)
	// contains filtered or unexported methods
}

ChannelAPIServer is the server API for ChannelAPI service. All implementations must embed UnimplementedChannelAPIServer for forward compatibility

type CreateChannelRequest

type CreateChannelRequest struct {
	Channel *Channel `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateChannelRequest) Descriptor deprecated

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

Deprecated: Use CreateChannelRequest.ProtoReflect.Descriptor instead.

func (*CreateChannelRequest) GetChannel

func (x *CreateChannelRequest) GetChannel() *Channel

func (*CreateChannelRequest) ProtoMessage

func (*CreateChannelRequest) ProtoMessage()

func (*CreateChannelRequest) ProtoReflect

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

func (*CreateChannelRequest) Reset

func (x *CreateChannelRequest) Reset()

func (*CreateChannelRequest) String

func (x *CreateChannelRequest) String() string

type CreateChannelResponse

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

func (*CreateChannelResponse) Descriptor deprecated

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

Deprecated: Use CreateChannelResponse.ProtoReflect.Descriptor instead.

func (*CreateChannelResponse) GetId

func (x *CreateChannelResponse) GetId() string

func (*CreateChannelResponse) ProtoMessage

func (*CreateChannelResponse) ProtoMessage()

func (*CreateChannelResponse) ProtoReflect

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

func (*CreateChannelResponse) Reset

func (x *CreateChannelResponse) Reset()

func (*CreateChannelResponse) String

func (x *CreateChannelResponse) String() string

type DeleteChannelRequest

type DeleteChannelRequest struct {
	Id      string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	OwnerId string `protobuf:"bytes,2,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteChannelRequest) Descriptor deprecated

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

Deprecated: Use DeleteChannelRequest.ProtoReflect.Descriptor instead.

func (*DeleteChannelRequest) GetId

func (x *DeleteChannelRequest) GetId() string

func (*DeleteChannelRequest) GetOwnerId

func (x *DeleteChannelRequest) GetOwnerId() string

func (*DeleteChannelRequest) ProtoMessage

func (*DeleteChannelRequest) ProtoMessage()

func (*DeleteChannelRequest) ProtoReflect

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

func (*DeleteChannelRequest) Reset

func (x *DeleteChannelRequest) Reset()

func (*DeleteChannelRequest) String

func (x *DeleteChannelRequest) String() string

type GetChannelRequest

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

func (*GetChannelRequest) Descriptor deprecated

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

Deprecated: Use GetChannelRequest.ProtoReflect.Descriptor instead.

func (*GetChannelRequest) GetId

func (x *GetChannelRequest) GetId() string

func (*GetChannelRequest) ProtoMessage

func (*GetChannelRequest) ProtoMessage()

func (*GetChannelRequest) ProtoReflect

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

func (*GetChannelRequest) Reset

func (x *GetChannelRequest) Reset()

func (*GetChannelRequest) String

func (x *GetChannelRequest) String() string

type ListChannelsRequest

type ListChannelsRequest struct {
	PageToken string      `protobuf:"bytes,1,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	PageSize  int32       `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	Filter    *ListFilter `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"`
	// contains filtered or unexported fields
}

func (*ListChannelsRequest) Descriptor deprecated

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

Deprecated: Use ListChannelsRequest.ProtoReflect.Descriptor instead.

func (*ListChannelsRequest) GetFilter

func (x *ListChannelsRequest) GetFilter() *ListFilter

func (*ListChannelsRequest) GetPageSize

func (x *ListChannelsRequest) GetPageSize() int32

func (*ListChannelsRequest) GetPageToken

func (x *ListChannelsRequest) GetPageToken() string

func (*ListChannelsRequest) ProtoMessage

func (*ListChannelsRequest) ProtoMessage()

func (*ListChannelsRequest) ProtoReflect

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

func (*ListChannelsRequest) Reset

func (x *ListChannelsRequest) Reset()

func (*ListChannelsRequest) String

func (x *ListChannelsRequest) String() string

type ListChannelsResponse

type ListChannelsResponse struct {
	Channels        []*Channel `protobuf:"bytes,1,rep,name=channels,proto3" json:"channels,omitempty"`
	NextPageToken   string     `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
	CollectionCount int64      `protobuf:"varint,3,opt,name=collection_count,json=collectionCount,proto3" json:"collection_count,omitempty"`
	// contains filtered or unexported fields
}

func (*ListChannelsResponse) Descriptor deprecated

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

Deprecated: Use ListChannelsResponse.ProtoReflect.Descriptor instead.

func (*ListChannelsResponse) GetChannels

func (x *ListChannelsResponse) GetChannels() []*Channel

func (*ListChannelsResponse) GetCollectionCount

func (x *ListChannelsResponse) GetCollectionCount() int64

func (*ListChannelsResponse) GetNextPageToken

func (x *ListChannelsResponse) GetNextPageToken() string

func (*ListChannelsResponse) ProtoMessage

func (*ListChannelsResponse) ProtoMessage()

func (*ListChannelsResponse) ProtoReflect

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

func (*ListChannelsResponse) Reset

func (x *ListChannelsResponse) Reset()

func (*ListChannelsResponse) String

func (x *ListChannelsResponse) String() string

type ListFilter

type ListFilter struct {
	Labels []string `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"`
	// contains filtered or unexported fields
}

func (*ListFilter) Descriptor deprecated

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

Deprecated: Use ListFilter.ProtoReflect.Descriptor instead.

func (*ListFilter) GetLabels

func (x *ListFilter) GetLabels() []string

func (*ListFilter) ProtoMessage

func (*ListFilter) ProtoMessage()

func (*ListFilter) ProtoReflect

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

func (*ListFilter) Reset

func (x *ListFilter) Reset()

func (*ListFilter) String

func (x *ListFilter) String() string

type SearchChannelsRequest

type SearchChannelsRequest struct {
	PageToken string      `protobuf:"bytes,1,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	PageSize  int32       `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	Query     string      `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"`
	Filter    *ListFilter `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"`
	// contains filtered or unexported fields
}

func (*SearchChannelsRequest) Descriptor deprecated

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

Deprecated: Use SearchChannelsRequest.ProtoReflect.Descriptor instead.

func (*SearchChannelsRequest) GetFilter

func (x *SearchChannelsRequest) GetFilter() *ListFilter

func (*SearchChannelsRequest) GetPageSize

func (x *SearchChannelsRequest) GetPageSize() int32

func (*SearchChannelsRequest) GetPageToken

func (x *SearchChannelsRequest) GetPageToken() string

func (*SearchChannelsRequest) GetQuery

func (x *SearchChannelsRequest) GetQuery() string

func (*SearchChannelsRequest) ProtoMessage

func (*SearchChannelsRequest) ProtoMessage()

func (*SearchChannelsRequest) ProtoReflect

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

func (*SearchChannelsRequest) Reset

func (x *SearchChannelsRequest) Reset()

func (*SearchChannelsRequest) String

func (x *SearchChannelsRequest) String() string

type SubscribersRequest

type SubscribersRequest struct {
	ChannelNames []string `protobuf:"bytes,1,rep,name=channel_names,json=channelNames,proto3" json:"channel_names,omitempty"`
	// contains filtered or unexported fields
}

func (*SubscribersRequest) Descriptor deprecated

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

Deprecated: Use SubscribersRequest.ProtoReflect.Descriptor instead.

func (*SubscribersRequest) GetChannelNames

func (x *SubscribersRequest) GetChannelNames() []string

func (*SubscribersRequest) ProtoMessage

func (*SubscribersRequest) ProtoMessage()

func (*SubscribersRequest) ProtoReflect

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

func (*SubscribersRequest) Reset

func (x *SubscribersRequest) Reset()

func (*SubscribersRequest) String

func (x *SubscribersRequest) String() string

type UnimplementedChannelAPIServer

type UnimplementedChannelAPIServer struct {
}

UnimplementedChannelAPIServer must be embedded to have forward compatible implementations.

func (UnimplementedChannelAPIServer) CreateChannel

func (UnimplementedChannelAPIServer) DecrementSubscribers

func (UnimplementedChannelAPIServer) DeleteChannel

func (UnimplementedChannelAPIServer) GetChannel

func (UnimplementedChannelAPIServer) IncrementSubscribers

func (UnimplementedChannelAPIServer) ListChannels

func (UnimplementedChannelAPIServer) SearchChannels

func (UnimplementedChannelAPIServer) UpdateChannel

type UnsafeChannelAPIServer

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

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

type UpdateChannelRequest

type UpdateChannelRequest struct {
	OwnerId string   `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"`
	Channel *Channel `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateChannelRequest) Descriptor deprecated

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

Deprecated: Use UpdateChannelRequest.ProtoReflect.Descriptor instead.

func (*UpdateChannelRequest) GetChannel

func (x *UpdateChannelRequest) GetChannel() *Channel

func (*UpdateChannelRequest) GetOwnerId

func (x *UpdateChannelRequest) GetOwnerId() string

func (*UpdateChannelRequest) ProtoMessage

func (*UpdateChannelRequest) ProtoMessage()

func (*UpdateChannelRequest) ProtoReflect

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

func (*UpdateChannelRequest) Reset

func (x *UpdateChannelRequest) Reset()

func (*UpdateChannelRequest) String

func (x *UpdateChannelRequest) String() string

Jump to

Keyboard shortcuts

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