pb

package
v0.0.0-...-483d5da Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package pb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_api_rotator_rotator_proto protoreflect.FileDescriptor
View Source
var Rotator_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "rotator.Rotator",
	HandlerType: (*RotatorServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateBanner",
			Handler:    _Rotator_CreateBanner_Handler,
		},
		{
			MethodName: "CreateSlot",
			Handler:    _Rotator_CreateSlot_Handler,
		},
		{
			MethodName: "CreateGroup",
			Handler:    _Rotator_CreateGroup_Handler,
		},
		{
			MethodName: "AddBanner",
			Handler:    _Rotator_AddBanner_Handler,
		},
		{
			MethodName: "DeleteBanner",
			Handler:    _Rotator_DeleteBanner_Handler,
		},
		{
			MethodName: "AddClick",
			Handler:    _Rotator_AddClick_Handler,
		},
		{
			MethodName: "AddBannerDisplay",
			Handler:    _Rotator_AddBannerDisplay_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/rotator/rotator.proto",
}

Rotator_ServiceDesc is the grpc.ServiceDesc for Rotator service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterRotatorHandler

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

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

func RegisterRotatorHandlerClient

func RegisterRotatorHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RotatorClient) error

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

func RegisterRotatorHandlerFromEndpoint

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

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

func RegisterRotatorHandlerServer

func RegisterRotatorHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RotatorServer) error

RegisterRotatorHandlerServer registers the http handlers for service Rotator to "mux". UnaryRPC :call RotatorServer 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 RegisterRotatorHandlerFromEndpoint instead.

func RegisterRotatorServer

func RegisterRotatorServer(s grpc.ServiceRegistrar, srv RotatorServer)

Types

type AddBannerDisplayRequest

type AddBannerDisplayRequest struct {
	SlotId  string `protobuf:"bytes,1,opt,name=slot_id,json=slotId,proto3" json:"slot_id,omitempty"`
	GroupId string `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	// contains filtered or unexported fields
}

func (*AddBannerDisplayRequest) Descriptor deprecated

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

Deprecated: Use AddBannerDisplayRequest.ProtoReflect.Descriptor instead.

func (*AddBannerDisplayRequest) GetGroupId

func (x *AddBannerDisplayRequest) GetGroupId() string

func (*AddBannerDisplayRequest) GetSlotId

func (x *AddBannerDisplayRequest) GetSlotId() string

func (*AddBannerDisplayRequest) ProtoMessage

func (*AddBannerDisplayRequest) ProtoMessage()

func (*AddBannerDisplayRequest) ProtoReflect

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

func (*AddBannerDisplayRequest) Reset

func (x *AddBannerDisplayRequest) Reset()

func (*AddBannerDisplayRequest) String

func (x *AddBannerDisplayRequest) String() string

type AddBannerDisplayResponse

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

func (*AddBannerDisplayResponse) Descriptor deprecated

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

Deprecated: Use AddBannerDisplayResponse.ProtoReflect.Descriptor instead.

func (*AddBannerDisplayResponse) GetId

func (x *AddBannerDisplayResponse) GetId() string

func (*AddBannerDisplayResponse) ProtoMessage

func (*AddBannerDisplayResponse) ProtoMessage()

func (*AddBannerDisplayResponse) ProtoReflect

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

func (*AddBannerDisplayResponse) Reset

func (x *AddBannerDisplayResponse) Reset()

func (*AddBannerDisplayResponse) String

func (x *AddBannerDisplayResponse) String() string

type AddBannerRequest

type AddBannerRequest struct {
	BannerId string `protobuf:"bytes,1,opt,name=banner_id,json=bannerId,proto3" json:"banner_id,omitempty"`
	SlotId   string `protobuf:"bytes,2,opt,name=slot_id,json=slotId,proto3" json:"slot_id,omitempty"`
	// contains filtered or unexported fields
}

func (*AddBannerRequest) Descriptor deprecated

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

Deprecated: Use AddBannerRequest.ProtoReflect.Descriptor instead.

func (*AddBannerRequest) GetBannerId

func (x *AddBannerRequest) GetBannerId() string

func (*AddBannerRequest) GetSlotId

func (x *AddBannerRequest) GetSlotId() string

func (*AddBannerRequest) ProtoMessage

func (*AddBannerRequest) ProtoMessage()

func (*AddBannerRequest) ProtoReflect

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

func (*AddBannerRequest) Reset

func (x *AddBannerRequest) Reset()

func (*AddBannerRequest) String

func (x *AddBannerRequest) String() string

type AddBannerResponse

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

func (*AddBannerResponse) Descriptor deprecated

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

Deprecated: Use AddBannerResponse.ProtoReflect.Descriptor instead.

func (*AddBannerResponse) GetStatus

func (x *AddBannerResponse) GetStatus() string

func (*AddBannerResponse) ProtoMessage

func (*AddBannerResponse) ProtoMessage()

func (*AddBannerResponse) ProtoReflect

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

func (*AddBannerResponse) Reset

func (x *AddBannerResponse) Reset()

func (*AddBannerResponse) String

func (x *AddBannerResponse) String() string

type AddClickRequest

type AddClickRequest struct {
	BannerId string `protobuf:"bytes,1,opt,name=banner_id,json=bannerId,proto3" json:"banner_id,omitempty"`
	SlotId   string `protobuf:"bytes,2,opt,name=slot_id,json=slotId,proto3" json:"slot_id,omitempty"`
	GroupId  string `protobuf:"bytes,3,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	// contains filtered or unexported fields
}

func (*AddClickRequest) Descriptor deprecated

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

Deprecated: Use AddClickRequest.ProtoReflect.Descriptor instead.

func (*AddClickRequest) GetBannerId

func (x *AddClickRequest) GetBannerId() string

func (*AddClickRequest) GetGroupId

func (x *AddClickRequest) GetGroupId() string

func (*AddClickRequest) GetSlotId

func (x *AddClickRequest) GetSlotId() string

func (*AddClickRequest) ProtoMessage

func (*AddClickRequest) ProtoMessage()

func (*AddClickRequest) ProtoReflect

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

func (*AddClickRequest) Reset

func (x *AddClickRequest) Reset()

func (*AddClickRequest) String

func (x *AddClickRequest) String() string

type AddClickResponse

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

func (*AddClickResponse) Descriptor deprecated

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

Deprecated: Use AddClickResponse.ProtoReflect.Descriptor instead.

func (*AddClickResponse) GetStatus

func (x *AddClickResponse) GetStatus() string

func (*AddClickResponse) ProtoMessage

func (*AddClickResponse) ProtoMessage()

func (*AddClickResponse) ProtoReflect

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

func (*AddClickResponse) Reset

func (x *AddClickResponse) Reset()

func (*AddClickResponse) String

func (x *AddClickResponse) String() string

type CreateBannerRequest

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

func (*CreateBannerRequest) Descriptor deprecated

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

Deprecated: Use CreateBannerRequest.ProtoReflect.Descriptor instead.

func (*CreateBannerRequest) GetDescription

func (x *CreateBannerRequest) GetDescription() string

func (*CreateBannerRequest) GetId

func (x *CreateBannerRequest) GetId() string

func (*CreateBannerRequest) ProtoMessage

func (*CreateBannerRequest) ProtoMessage()

func (*CreateBannerRequest) ProtoReflect

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

func (*CreateBannerRequest) Reset

func (x *CreateBannerRequest) Reset()

func (*CreateBannerRequest) String

func (x *CreateBannerRequest) String() string

type CreateBannerResponse

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

func (*CreateBannerResponse) Descriptor deprecated

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

Deprecated: Use CreateBannerResponse.ProtoReflect.Descriptor instead.

func (*CreateBannerResponse) GetId

func (x *CreateBannerResponse) GetId() string

func (*CreateBannerResponse) ProtoMessage

func (*CreateBannerResponse) ProtoMessage()

func (*CreateBannerResponse) ProtoReflect

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

func (*CreateBannerResponse) Reset

func (x *CreateBannerResponse) Reset()

func (*CreateBannerResponse) String

func (x *CreateBannerResponse) String() string

type CreateGroupRequest

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

func (*CreateGroupRequest) Descriptor deprecated

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

Deprecated: Use CreateGroupRequest.ProtoReflect.Descriptor instead.

func (*CreateGroupRequest) GetDescription

func (x *CreateGroupRequest) GetDescription() string

func (*CreateGroupRequest) GetId

func (x *CreateGroupRequest) GetId() string

func (*CreateGroupRequest) ProtoMessage

func (*CreateGroupRequest) ProtoMessage()

func (*CreateGroupRequest) ProtoReflect

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

func (*CreateGroupRequest) Reset

func (x *CreateGroupRequest) Reset()

func (*CreateGroupRequest) String

func (x *CreateGroupRequest) String() string

type CreateGroupResponse

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

func (*CreateGroupResponse) Descriptor deprecated

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

Deprecated: Use CreateGroupResponse.ProtoReflect.Descriptor instead.

func (*CreateGroupResponse) GetId

func (x *CreateGroupResponse) GetId() string

func (*CreateGroupResponse) ProtoMessage

func (*CreateGroupResponse) ProtoMessage()

func (*CreateGroupResponse) ProtoReflect

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

func (*CreateGroupResponse) Reset

func (x *CreateGroupResponse) Reset()

func (*CreateGroupResponse) String

func (x *CreateGroupResponse) String() string

type CreateSlotRequest

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

func (*CreateSlotRequest) Descriptor deprecated

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

Deprecated: Use CreateSlotRequest.ProtoReflect.Descriptor instead.

func (*CreateSlotRequest) GetDescription

func (x *CreateSlotRequest) GetDescription() string

func (*CreateSlotRequest) GetId

func (x *CreateSlotRequest) GetId() string

func (*CreateSlotRequest) ProtoMessage

func (*CreateSlotRequest) ProtoMessage()

func (*CreateSlotRequest) ProtoReflect

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

func (*CreateSlotRequest) Reset

func (x *CreateSlotRequest) Reset()

func (*CreateSlotRequest) String

func (x *CreateSlotRequest) String() string

type CreateSlotResponse

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

func (*CreateSlotResponse) Descriptor deprecated

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

Deprecated: Use CreateSlotResponse.ProtoReflect.Descriptor instead.

func (*CreateSlotResponse) GetId

func (x *CreateSlotResponse) GetId() string

func (*CreateSlotResponse) ProtoMessage

func (*CreateSlotResponse) ProtoMessage()

func (*CreateSlotResponse) ProtoReflect

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

func (*CreateSlotResponse) Reset

func (x *CreateSlotResponse) Reset()

func (*CreateSlotResponse) String

func (x *CreateSlotResponse) String() string

type DeleteBannerRequest

type DeleteBannerRequest struct {
	BannerId string `protobuf:"bytes,1,opt,name=banner_id,json=bannerId,proto3" json:"banner_id,omitempty"`
	SlotId   string `protobuf:"bytes,2,opt,name=slot_id,json=slotId,proto3" json:"slot_id,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteBannerRequest) Descriptor deprecated

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

Deprecated: Use DeleteBannerRequest.ProtoReflect.Descriptor instead.

func (*DeleteBannerRequest) GetBannerId

func (x *DeleteBannerRequest) GetBannerId() string

func (*DeleteBannerRequest) GetSlotId

func (x *DeleteBannerRequest) GetSlotId() string

func (*DeleteBannerRequest) ProtoMessage

func (*DeleteBannerRequest) ProtoMessage()

func (*DeleteBannerRequest) ProtoReflect

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

func (*DeleteBannerRequest) Reset

func (x *DeleteBannerRequest) Reset()

func (*DeleteBannerRequest) String

func (x *DeleteBannerRequest) String() string

type DeleteBannerResponse

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

func (*DeleteBannerResponse) Descriptor deprecated

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

Deprecated: Use DeleteBannerResponse.ProtoReflect.Descriptor instead.

func (*DeleteBannerResponse) GetStatus

func (x *DeleteBannerResponse) GetStatus() string

func (*DeleteBannerResponse) ProtoMessage

func (*DeleteBannerResponse) ProtoMessage()

func (*DeleteBannerResponse) ProtoReflect

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

func (*DeleteBannerResponse) Reset

func (x *DeleteBannerResponse) Reset()

func (*DeleteBannerResponse) String

func (x *DeleteBannerResponse) String() string

type RotatorClient

type RotatorClient interface {
	// CreateBanner creates a new banner.
	CreateBanner(ctx context.Context, in *CreateBannerRequest, opts ...grpc.CallOption) (*CreateBannerResponse, error)
	// CreateSlot creates a new slot.
	CreateSlot(ctx context.Context, in *CreateSlotRequest, opts ...grpc.CallOption) (*CreateSlotResponse, error)
	// CreateGroup creates a new group.
	CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*CreateGroupResponse, error)
	// AddBanner adds the banner to the slot.
	AddBanner(ctx context.Context, in *AddBannerRequest, opts ...grpc.CallOption) (*AddBannerResponse, error)
	// DeleteBanner deletes the banner from the slot.
	DeleteBanner(ctx context.Context, in *DeleteBannerRequest, opts ...grpc.CallOption) (*DeleteBannerResponse, error)
	// AddClick adds a click on the banner.
	AddClick(ctx context.Context, in *AddClickRequest, opts ...grpc.CallOption) (*AddClickResponse, error)
	// AddBannerDisplay adds a banner to display.
	AddBannerDisplay(ctx context.Context, in *AddBannerDisplayRequest, opts ...grpc.CallOption) (*AddBannerDisplayResponse, error)
}

RotatorClient is the client API for Rotator 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 NewRotatorClient

func NewRotatorClient(cc grpc.ClientConnInterface) RotatorClient

type RotatorServer

type RotatorServer interface {
	// CreateBanner creates a new banner.
	CreateBanner(context.Context, *CreateBannerRequest) (*CreateBannerResponse, error)
	// CreateSlot creates a new slot.
	CreateSlot(context.Context, *CreateSlotRequest) (*CreateSlotResponse, error)
	// CreateGroup creates a new group.
	CreateGroup(context.Context, *CreateGroupRequest) (*CreateGroupResponse, error)
	// AddBanner adds the banner to the slot.
	AddBanner(context.Context, *AddBannerRequest) (*AddBannerResponse, error)
	// DeleteBanner deletes the banner from the slot.
	DeleteBanner(context.Context, *DeleteBannerRequest) (*DeleteBannerResponse, error)
	// AddClick adds a click on the banner.
	AddClick(context.Context, *AddClickRequest) (*AddClickResponse, error)
	// AddBannerDisplay adds a banner to display.
	AddBannerDisplay(context.Context, *AddBannerDisplayRequest) (*AddBannerDisplayResponse, error)
	// contains filtered or unexported methods
}

RotatorServer is the server API for Rotator service. All implementations must embed UnimplementedRotatorServer for forward compatibility

type UnimplementedRotatorServer

type UnimplementedRotatorServer struct {
}

UnimplementedRotatorServer must be embedded to have forward compatible implementations.

func (UnimplementedRotatorServer) AddBanner

func (UnimplementedRotatorServer) AddBannerDisplay

func (UnimplementedRotatorServer) AddClick

func (UnimplementedRotatorServer) CreateBanner

func (UnimplementedRotatorServer) CreateGroup

func (UnimplementedRotatorServer) CreateSlot

func (UnimplementedRotatorServer) DeleteBanner

type UnsafeRotatorServer

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

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

Jump to

Keyboard shortcuts

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