Documentation ¶
Index ¶
- Variables
- func Finalize(isLocked bool)
- func Init(isLocked bool) (err error)
- func InitConfig() error
- func RegisterManServiceServer(s grpc.ServiceRegistrar, srv ManServiceServer)
- func Reset() (err error)
- func SetIsTest()
- func UnsetIsTest()
- type ArticleReply
- func (*ArticleReply) Descriptor() ([]byte, []int)deprecated
- func (x *ArticleReply) GetCacheKey() string
- func (x *ArticleReply) GetContent() []byte
- func (x *ArticleReply) GetFileSize() int64
- func (x *ArticleReply) GetSelectedOffset() int64
- func (x *ArticleReply) GetSelectedSize() int64
- func (*ArticleReply) ProtoMessage()
- func (x *ArticleReply) ProtoReflect() protoreflect.Message
- func (x *ArticleReply) Reset()
- func (x *ArticleReply) String() string
- type ArticleRequest
- func (*ArticleRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ArticleRequest) GetBoardName() string
- func (x *ArticleRequest) GetCacheKey() string
- func (x *ArticleRequest) GetMaxLength() int64
- func (x *ArticleRequest) GetOffset() int64
- func (x *ArticleRequest) GetPath() string
- func (x *ArticleRequest) GetSelectType() ArticleRequest_SelectType
- func (*ArticleRequest) ProtoMessage()
- func (x *ArticleRequest) ProtoReflect() protoreflect.Message
- func (x *ArticleRequest) Reset()
- func (x *ArticleRequest) String() string
- type ArticleRequest_SelectType
- func (ArticleRequest_SelectType) Descriptor() protoreflect.EnumDescriptor
- func (x ArticleRequest_SelectType) Enum() *ArticleRequest_SelectType
- func (ArticleRequest_SelectType) EnumDescriptor() ([]byte, []int)deprecated
- func (x ArticleRequest_SelectType) Number() protoreflect.EnumNumber
- func (x ArticleRequest_SelectType) String() string
- func (ArticleRequest_SelectType) Type() protoreflect.EnumType
- type Entry
- func (*Entry) Descriptor() ([]byte, []int)deprecated
- func (x *Entry) GetBoardName() string
- func (x *Entry) GetIsDir() bool
- func (x *Entry) GetPath() string
- func (x *Entry) GetTitle() string
- func (*Entry) ProtoMessage()
- func (x *Entry) ProtoReflect() protoreflect.Message
- func (x *Entry) Reset()
- func (x *Entry) String() string
- type ListReply
- type ListRequest
- func (*ListRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListRequest) GetBoardName() string
- func (x *ListRequest) GetPath() string
- func (*ListRequest) ProtoMessage()
- func (x *ListRequest) ProtoReflect() protoreflect.Message
- func (x *ListRequest) Reset()
- func (x *ListRequest) String() string
- type ManServiceClient
- type ManServiceServer
- type MockClientConn
- type UnimplementedManServiceServer
- type UnsafeManServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( ArticleRequest_SelectType_name = map[int32]string{ 0: "SELECT_FULL", 1: "SELECT_HEAD", 2: "SELECT_TAIL", } ArticleRequest_SelectType_value = map[string]int32{ "SELECT_FULL": 0, "SELECT_HEAD": 1, "SELECT_TAIL": 2, } )
Enum value maps for ArticleRequest_SelectType.
var ( IsTest = false TestMutex sync.Mutex )
var ErrCliAlreadyInit = errors.New("cli already init")
var File_man_proto protoreflect.FileDescriptor
var GRPC_HOST = "localhost:5151"
var ManService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pttbbs.man.ManService", HandlerType: (*ManServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "List", Handler: _ManService_List_Handler, }, { MethodName: "Article", Handler: _ManService_Article_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "man.proto", }
ManService_ServiceDesc is the grpc.ServiceDesc for ManService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func InitConfig ¶
func InitConfig() error
func RegisterManServiceServer ¶
func RegisterManServiceServer(s grpc.ServiceRegistrar, srv ManServiceServer)
func UnsetIsTest ¶
func UnsetIsTest()
Types ¶
type ArticleReply ¶
type ArticleReply struct { Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` CacheKey string `protobuf:"bytes,2,opt,name=cache_key,json=cacheKey,proto3" json:"cache_key,omitempty"` FileSize int64 `protobuf:"varint,3,opt,name=file_size,json=fileSize,proto3" json:"file_size,omitempty"` SelectedOffset int64 `protobuf:"varint,4,opt,name=selected_offset,json=selectedOffset,proto3" json:"selected_offset,omitempty"` SelectedSize int64 `protobuf:"varint,5,opt,name=selected_size,json=selectedSize,proto3" json:"selected_size,omitempty"` // contains filtered or unexported fields }
func (*ArticleReply) Descriptor
deprecated
func (*ArticleReply) Descriptor() ([]byte, []int)
Deprecated: Use ArticleReply.ProtoReflect.Descriptor instead.
func (*ArticleReply) GetCacheKey ¶
func (x *ArticleReply) GetCacheKey() string
func (*ArticleReply) GetContent ¶
func (x *ArticleReply) GetContent() []byte
func (*ArticleReply) GetFileSize ¶
func (x *ArticleReply) GetFileSize() int64
func (*ArticleReply) GetSelectedOffset ¶
func (x *ArticleReply) GetSelectedOffset() int64
func (*ArticleReply) GetSelectedSize ¶
func (x *ArticleReply) GetSelectedSize() int64
func (*ArticleReply) ProtoMessage ¶
func (*ArticleReply) ProtoMessage()
func (*ArticleReply) ProtoReflect ¶
func (x *ArticleReply) ProtoReflect() protoreflect.Message
func (*ArticleReply) Reset ¶
func (x *ArticleReply) Reset()
func (*ArticleReply) String ¶
func (x *ArticleReply) String() string
type ArticleRequest ¶
type ArticleRequest struct { BoardName string `protobuf:"bytes,1,opt,name=board_name,json=boardName,proto3" json:"board_name,omitempty"` Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` SelectType ArticleRequest_SelectType `` /* 134-byte string literal not displayed */ CacheKey string `protobuf:"bytes,4,opt,name=cache_key,json=cacheKey,proto3" json:"cache_key,omitempty"` Offset int64 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` MaxLength int64 `protobuf:"varint,6,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` // contains filtered or unexported fields }
func (*ArticleRequest) Descriptor
deprecated
func (*ArticleRequest) Descriptor() ([]byte, []int)
Deprecated: Use ArticleRequest.ProtoReflect.Descriptor instead.
func (*ArticleRequest) GetBoardName ¶
func (x *ArticleRequest) GetBoardName() string
func (*ArticleRequest) GetCacheKey ¶
func (x *ArticleRequest) GetCacheKey() string
func (*ArticleRequest) GetMaxLength ¶
func (x *ArticleRequest) GetMaxLength() int64
func (*ArticleRequest) GetOffset ¶
func (x *ArticleRequest) GetOffset() int64
func (*ArticleRequest) GetPath ¶
func (x *ArticleRequest) GetPath() string
func (*ArticleRequest) GetSelectType ¶
func (x *ArticleRequest) GetSelectType() ArticleRequest_SelectType
func (*ArticleRequest) ProtoMessage ¶
func (*ArticleRequest) ProtoMessage()
func (*ArticleRequest) ProtoReflect ¶
func (x *ArticleRequest) ProtoReflect() protoreflect.Message
func (*ArticleRequest) Reset ¶
func (x *ArticleRequest) Reset()
func (*ArticleRequest) String ¶
func (x *ArticleRequest) String() string
type ArticleRequest_SelectType ¶
type ArticleRequest_SelectType int32
const ( ArticleRequest_SELECT_FULL ArticleRequest_SelectType = 0 ArticleRequest_SELECT_HEAD ArticleRequest_SelectType = 1 ArticleRequest_SELECT_TAIL ArticleRequest_SelectType = 2 )
func (ArticleRequest_SelectType) Descriptor ¶
func (ArticleRequest_SelectType) Descriptor() protoreflect.EnumDescriptor
func (ArticleRequest_SelectType) Enum ¶
func (x ArticleRequest_SelectType) Enum() *ArticleRequest_SelectType
func (ArticleRequest_SelectType) EnumDescriptor
deprecated
func (ArticleRequest_SelectType) EnumDescriptor() ([]byte, []int)
Deprecated: Use ArticleRequest_SelectType.Descriptor instead.
func (ArticleRequest_SelectType) Number ¶
func (x ArticleRequest_SelectType) Number() protoreflect.EnumNumber
func (ArticleRequest_SelectType) String ¶
func (x ArticleRequest_SelectType) String() string
func (ArticleRequest_SelectType) Type ¶
func (ArticleRequest_SelectType) Type() protoreflect.EnumType
type Entry ¶
type Entry struct { BoardName string `protobuf:"bytes,1,opt,name=board_name,json=boardName,proto3" json:"board_name,omitempty"` Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` IsDir bool `protobuf:"varint,4,opt,name=is_dir,json=isDir,proto3" json:"is_dir,omitempty"` // contains filtered or unexported fields }
func (*Entry) Descriptor
deprecated
func (*Entry) GetBoardName ¶
func (*Entry) ProtoMessage ¶
func (*Entry) ProtoMessage()
func (*Entry) ProtoReflect ¶
func (x *Entry) ProtoReflect() protoreflect.Message
type ListReply ¶
type ListReply struct { IsSuccess bool `protobuf:"varint,1,opt,name=is_success,json=isSuccess,proto3" json:"is_success,omitempty"` Entries []*Entry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"` // contains filtered or unexported fields }
func (*ListReply) Descriptor
deprecated
func (*ListReply) GetEntries ¶
func (*ListReply) GetIsSuccess ¶
func (*ListReply) ProtoMessage ¶
func (*ListReply) ProtoMessage()
func (*ListReply) ProtoReflect ¶
func (x *ListReply) ProtoReflect() protoreflect.Message
type ListRequest ¶
type ListRequest struct { BoardName string `protobuf:"bytes,1,opt,name=board_name,json=boardName,proto3" json:"board_name,omitempty"` Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` // contains filtered or unexported fields }
func (*ListRequest) Descriptor
deprecated
func (*ListRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.
func (*ListRequest) GetBoardName ¶
func (x *ListRequest) GetBoardName() string
func (*ListRequest) GetPath ¶
func (x *ListRequest) GetPath() string
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) ProtoReflect ¶
func (x *ListRequest) ProtoReflect() protoreflect.Message
func (*ListRequest) Reset ¶
func (x *ListRequest) Reset()
func (*ListRequest) String ¶
func (x *ListRequest) String() string
type ManServiceClient ¶
type ManServiceClient interface { List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListReply, error) Article(ctx context.Context, in *ArticleRequest, opts ...grpc.CallOption) (*ArticleReply, error) }
ManServiceClient is the client API for ManService 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.
var Cli ManServiceClient
func NewManServiceClient ¶
func NewManServiceClient(cc grpc.ClientConnInterface) ManServiceClient
type ManServiceServer ¶
type ManServiceServer interface { List(context.Context, *ListRequest) (*ListReply, error) Article(context.Context, *ArticleRequest) (*ArticleReply, error) // contains filtered or unexported methods }
ManServiceServer is the server API for ManService service. All implementations must embed UnimplementedManServiceServer for forward compatibility
type MockClientConn ¶
type MockClientConn struct{}
func NewMockClientConn ¶
func NewMockClientConn() *MockClientConn
func (*MockClientConn) Close ¶
func (c *MockClientConn) Close()
func (*MockClientConn) Invoke ¶
func (c *MockClientConn) Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...grpc.CallOption) (err error)
func (*MockClientConn) NewStream ¶
func (c *MockClientConn) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (cs grpc.ClientStream, err error)
type UnimplementedManServiceServer ¶
type UnimplementedManServiceServer struct{}
UnimplementedManServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedManServiceServer) Article ¶
func (UnimplementedManServiceServer) Article(context.Context, *ArticleRequest) (*ArticleReply, error)
func (UnimplementedManServiceServer) List ¶
func (UnimplementedManServiceServer) List(context.Context, *ListRequest) (*ListReply, error)
type UnsafeManServiceServer ¶
type UnsafeManServiceServer interface {
// contains filtered or unexported methods
}
UnsafeManServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ManServiceServer will result in compilation errors.