mand

package
v0.36.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
var (
	IsTest    = false
	TestMutex sync.Mutex
)
View Source
var ErrCliAlreadyInit = errors.New("cli already init")
View Source
var GRPC_HOST = "localhost:5151"
View Source
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 Finalize

func Finalize(isLocked bool)

func Init

func Init(isLocked bool) (err error)

func InitConfig

func InitConfig() error

func RegisterManServiceServer

func RegisterManServiceServer(s grpc.ServiceRegistrar, srv ManServiceServer)

func Reset

func Reset() (err error)

func SetIsTest

func SetIsTest()

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) Enum

func (ArticleRequest_SelectType) EnumDescriptor deprecated

func (ArticleRequest_SelectType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ArticleRequest_SelectType.Descriptor instead.

func (ArticleRequest_SelectType) Number

func (ArticleRequest_SelectType) String

func (x ArticleRequest_SelectType) String() string

func (ArticleRequest_SelectType) Type

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) Descriptor() ([]byte, []int)

Deprecated: Use Entry.ProtoReflect.Descriptor instead.

func (*Entry) GetBoardName

func (x *Entry) GetBoardName() string

func (*Entry) GetIsDir

func (x *Entry) GetIsDir() bool

func (*Entry) GetPath

func (x *Entry) GetPath() string

func (*Entry) GetTitle

func (x *Entry) GetTitle() string

func (*Entry) ProtoMessage

func (*Entry) ProtoMessage()

func (*Entry) ProtoReflect

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

func (*Entry) Reset

func (x *Entry) Reset()

func (*Entry) String

func (x *Entry) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use ListReply.ProtoReflect.Descriptor instead.

func (*ListReply) GetEntries

func (x *ListReply) GetEntries() []*Entry

func (*ListReply) GetIsSuccess

func (x *ListReply) GetIsSuccess() bool

func (*ListReply) ProtoMessage

func (*ListReply) ProtoMessage()

func (*ListReply) ProtoReflect

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

func (*ListReply) Reset

func (x *ListReply) Reset()

func (*ListReply) String

func (x *ListReply) String() string

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.

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) List

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.

Jump to

Keyboard shortcuts

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