api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

README

Install

  1. Setup Go and protoc on your system: yay -S go protobuf
  2. Install go plugins for protoc:
$ go get google.golang.org/protobuf/cmd/protoc-gen-go \
         google.golang.org/grpc/cmd/protoc-gen-go-grpc
  1. Run ./generate.sh to update server/client code

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Campus_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.Campus",
	HandlerType: (*CampusServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetTopNews",
			Handler:    _Campus_GetTopNews_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "CampusService.proto",
}

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

View Source
var File_CampusService_proto protoreflect.FileDescriptor

Functions

func RegisterCampusServer

func RegisterCampusServer(s grpc.ServiceRegistrar, srv CampusServer)

Types

type CampusClient

type CampusClient interface {
	GetTopNews(ctx context.Context, in *GetTopNewsRequest, opts ...grpc.CallOption) (*GetTopNewsReply, error)
}

CampusClient is the client API for Campus 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 NewCampusClient

func NewCampusClient(cc grpc.ClientConnInterface) CampusClient

type CampusServer

type CampusServer interface {
	GetTopNews(context.Context, *GetTopNewsRequest) (*GetTopNewsReply, error)
	// contains filtered or unexported methods
}

CampusServer is the server API for Campus service. All implementations must embed UnimplementedCampusServer for forward compatibility

type GetTopNewsReply

type GetTopNewsReply struct {
	Name    string               `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Link    string               `protobuf:"bytes,2,opt,name=link,proto3" json:"link,omitempty"`
	Created *timestamp.Timestamp `protobuf:"bytes,3,opt,name=created,proto3" json:"created,omitempty"`
	From    *timestamp.Timestamp `protobuf:"bytes,4,opt,name=from,proto3" json:"from,omitempty"`
	To      *timestamp.Timestamp `protobuf:"bytes,5,opt,name=to,proto3" json:"to,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTopNewsReply) Descriptor deprecated

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

Deprecated: Use GetTopNewsReply.ProtoReflect.Descriptor instead.

func (*GetTopNewsReply) GetCreated

func (x *GetTopNewsReply) GetCreated() *timestamp.Timestamp

func (*GetTopNewsReply) GetFrom

func (x *GetTopNewsReply) GetFrom() *timestamp.Timestamp
func (x *GetTopNewsReply) GetLink() string

func (*GetTopNewsReply) GetName

func (x *GetTopNewsReply) GetName() string

func (*GetTopNewsReply) GetTo

func (x *GetTopNewsReply) GetTo() *timestamp.Timestamp

func (*GetTopNewsReply) ProtoMessage

func (*GetTopNewsReply) ProtoMessage()

func (*GetTopNewsReply) ProtoReflect

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

func (*GetTopNewsReply) Reset

func (x *GetTopNewsReply) Reset()

func (*GetTopNewsReply) String

func (x *GetTopNewsReply) String() string

type GetTopNewsRequest

type GetTopNewsRequest struct {
	// contains filtered or unexported fields
}

func (*GetTopNewsRequest) Descriptor deprecated

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

Deprecated: Use GetTopNewsRequest.ProtoReflect.Descriptor instead.

func (*GetTopNewsRequest) ProtoMessage

func (*GetTopNewsRequest) ProtoMessage()

func (*GetTopNewsRequest) ProtoReflect

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

func (*GetTopNewsRequest) Reset

func (x *GetTopNewsRequest) Reset()

func (*GetTopNewsRequest) String

func (x *GetTopNewsRequest) String() string

type UnimplementedCampusServer

type UnimplementedCampusServer struct {
}

UnimplementedCampusServer must be embedded to have forward compatible implementations.

func (UnimplementedCampusServer) GetTopNews

type UnsafeCampusServer

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

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

Jump to

Keyboard shortcuts

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