pushpb

package
v0.0.0-...-ae8612d Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: MIT Imports: 16 Imported by: 1

Documentation

Overview

Package pushpb is a generated protocol buffer package.

It is generated from these files:

github.com/molon/gomsg/pb/pushpb/push.proto

It has these top-level messages:

PlatformConfig
PushRequest

Package pushpb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterPushHandler

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

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

func RegisterPushHandlerClient

func RegisterPushHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PushClient) error

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

func RegisterPushHandlerFromEndpoint

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

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

func RegisterPushServer

func RegisterPushServer(s *grpc.Server, srv PushServer)

Types

type PlatformConfig

type PlatformConfig struct {
	// 不为空则表示只发送给这些平台
	Platforms []string `protobuf:"bytes,1,rep,name=platforms" json:"platforms,omitempty"`
	// 不为空则表示除了这些平台都需要发送
	// 此项在 platforms 项不为空时候无效
	WithoutPlatforms []string `protobuf:"bytes,2,rep,name=without_platforms,json=withoutPlatforms" json:"without_platforms,omitempty"`
}

func (*PlatformConfig) Descriptor

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

func (*PlatformConfig) GetPlatforms

func (m *PlatformConfig) GetPlatforms() []string

func (*PlatformConfig) GetWithoutPlatforms

func (m *PlatformConfig) GetWithoutPlatforms() []string

func (*PlatformConfig) ProtoMessage

func (*PlatformConfig) ProtoMessage()

func (*PlatformConfig) Reset

func (m *PlatformConfig) Reset()

func (*PlatformConfig) String

func (m *PlatformConfig) String() string

type PushClient

type PushClient interface {
	Push(ctx context.Context, in *PushRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
}

func NewPushClient

func NewPushClient(cc *grpc.ClientConn) PushClient

type PushRequest

type PushRequest struct {
	// 接收目标
	Uids []string `protobuf:"bytes,1,rep,name=uids" json:"uids,omitempty"`
	// 平台配置,置空则表示全发送
	PlatformConfig *PlatformConfig `protobuf:"bytes,11,opt,name=platform_config,json=platformConfig" json:"platform_config,omitempty"`
	// 针对某用户单独设置平台配置
	ExclusivePlatformConfig map[string]*PlatformConfig `` /* 200-byte string literal not displayed */
	// 消息内容
	MsgBodies []*google_protobuf1.Any `protobuf:"bytes,21,rep,name=msg_bodies,json=msgBodies" json:"msg_bodies,omitempty"`
	// 消息特性
	MsgOptions msgpb.MessageOption `protobuf:"varint,22,opt,name=msg_options,json=msgOptions,enum=msgpb.MessageOption" json:"msg_options,omitempty"`
	// 针对某用户单独设置消息特性
	ExclusiveMsgOptions map[string]msgpb.MessageOption `` /* 214-byte string literal not displayed */
	// 保留给一些特殊业务使用的项目
	Reserve *google_protobuf1.Any `protobuf:"bytes,88,opt,name=reserve" json:"reserve,omitempty"`
}

func (*PushRequest) Descriptor

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

func (*PushRequest) GetExclusiveMsgOptions

func (m *PushRequest) GetExclusiveMsgOptions() map[string]msgpb.MessageOption

func (*PushRequest) GetExclusivePlatformConfig

func (m *PushRequest) GetExclusivePlatformConfig() map[string]*PlatformConfig

func (*PushRequest) GetMsgBodies

func (m *PushRequest) GetMsgBodies() []*google_protobuf1.Any

func (*PushRequest) GetMsgOptions

func (m *PushRequest) GetMsgOptions() msgpb.MessageOption

func (*PushRequest) GetPlatformConfig

func (m *PushRequest) GetPlatformConfig() *PlatformConfig

func (*PushRequest) GetReserve

func (m *PushRequest) GetReserve() *google_protobuf1.Any

func (*PushRequest) GetUids

func (m *PushRequest) GetUids() []string

func (*PushRequest) ProtoMessage

func (*PushRequest) ProtoMessage()

func (*PushRequest) Reset

func (m *PushRequest) Reset()

func (*PushRequest) String

func (m *PushRequest) String() string

type PushServer

type PushServer interface {
	Push(context.Context, *PushRequest) (*google_protobuf.Empty, error)
}

Jump to

Keyboard shortcuts

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