Documentation ¶
Index ¶
- Constants
- func NewHelloEndpoints() []*api.Endpoint
- func NewProtoDocEndpoints() []*api.Endpoint
- func RegisterHelloHandler(s server.Server, hdlr HelloHandler, opts ...server.HandlerOption) error
- func RegisterProtoDocHandler(s server.Server, hdlr ProtoDocHandler, opts ...server.HandlerOption) error
- type ConvertReq
- func (*ConvertReq) Descriptor() ([]byte, []int)
- func (m *ConvertReq) GetFilename() string
- func (m *ConvertReq) GetProto() string
- func (*ConvertReq) ProtoMessage()
- func (m *ConvertReq) Reset()
- func (m *ConvertReq) String() string
- func (m *ConvertReq) XXX_DiscardUnknown()
- func (m *ConvertReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ConvertReq) XXX_Merge(src proto.Message)
- func (m *ConvertReq) XXX_Size() int
- func (m *ConvertReq) XXX_Unmarshal(b []byte) error
- type ConvertRes
- func (*ConvertRes) Descriptor() ([]byte, []int)
- func (m *ConvertRes) GetHtml() string
- func (*ConvertRes) ProtoMessage()
- func (m *ConvertRes) Reset()
- func (m *ConvertRes) String() string
- func (m *ConvertRes) XXX_DiscardUnknown()
- func (m *ConvertRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ConvertRes) XXX_Merge(src proto.Message)
- func (m *ConvertRes) XXX_Size() int
- func (m *ConvertRes) XXX_Unmarshal(b []byte) error
- type Hello
- type HelloHandler
- type HelloReq
- func (*HelloReq) Descriptor() ([]byte, []int)
- func (*HelloReq) ProtoMessage()
- func (m *HelloReq) Reset()
- func (m *HelloReq) String() string
- func (m *HelloReq) XXX_DiscardUnknown()
- func (m *HelloReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HelloReq) XXX_Merge(src proto.Message)
- func (m *HelloReq) XXX_Size() int
- func (m *HelloReq) XXX_Unmarshal(b []byte) error
- type HelloRes
- func (*HelloRes) Descriptor() ([]byte, []int)
- func (m *HelloRes) GetData() string
- func (*HelloRes) ProtoMessage()
- func (m *HelloRes) Reset()
- func (m *HelloRes) String() string
- func (m *HelloRes) XXX_DiscardUnknown()
- func (m *HelloRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HelloRes) XXX_Merge(src proto.Message)
- func (m *HelloRes) XXX_Size() int
- func (m *HelloRes) XXX_Unmarshal(b []byte) error
- type HelloService
- type ProtoDoc
- type ProtoDocHandler
- type ProtoDocService
- type Server
Constants ¶
View Source
const (
ServiceName = "protodoc"
)
Variables ¶
This section is empty.
Functions ¶
func NewHelloEndpoints ¶
func NewProtoDocEndpoints ¶
func RegisterHelloHandler ¶
func RegisterHelloHandler(s server.Server, hdlr HelloHandler, opts ...server.HandlerOption) error
func RegisterProtoDocHandler ¶
func RegisterProtoDocHandler(s server.Server, hdlr ProtoDocHandler, opts ...server.HandlerOption) error
Types ¶
type ConvertReq ¶
type ConvertReq struct { // proto3 定义的协议内容 Proto string `protobuf:"bytes,1,opt,name=proto,proto3" json:"proto,omitempty"` // 协议文件名,用于解析时的附加信息 Filename string `protobuf:"bytes,2,opt,name=filename,proto3" json:"filename,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ConvertReq) Descriptor ¶
func (*ConvertReq) Descriptor() ([]byte, []int)
func (*ConvertReq) GetFilename ¶
func (m *ConvertReq) GetFilename() string
func (*ConvertReq) GetProto ¶
func (m *ConvertReq) GetProto() string
func (*ConvertReq) ProtoMessage ¶
func (*ConvertReq) ProtoMessage()
func (*ConvertReq) Reset ¶
func (m *ConvertReq) Reset()
func (*ConvertReq) String ¶
func (m *ConvertReq) String() string
func (*ConvertReq) XXX_DiscardUnknown ¶
func (m *ConvertReq) XXX_DiscardUnknown()
func (*ConvertReq) XXX_Marshal ¶
func (m *ConvertReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ConvertReq) XXX_Merge ¶
func (m *ConvertReq) XXX_Merge(src proto.Message)
func (*ConvertReq) XXX_Size ¶
func (m *ConvertReq) XXX_Size() int
func (*ConvertReq) XXX_Unmarshal ¶
func (m *ConvertReq) XXX_Unmarshal(b []byte) error
type ConvertRes ¶
type ConvertRes struct { // HTML 格式的文档 Html string `protobuf:"bytes,2,opt,name=html,proto3" json:"html,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ConvertRes) Descriptor ¶
func (*ConvertRes) Descriptor() ([]byte, []int)
func (*ConvertRes) GetHtml ¶
func (m *ConvertRes) GetHtml() string
func (*ConvertRes) ProtoMessage ¶
func (*ConvertRes) ProtoMessage()
func (*ConvertRes) Reset ¶
func (m *ConvertRes) Reset()
func (*ConvertRes) String ¶
func (m *ConvertRes) String() string
func (*ConvertRes) XXX_DiscardUnknown ¶
func (m *ConvertRes) XXX_DiscardUnknown()
func (*ConvertRes) XXX_Marshal ¶
func (m *ConvertRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ConvertRes) XXX_Merge ¶
func (m *ConvertRes) XXX_Merge(src proto.Message)
func (*ConvertRes) XXX_Size ¶
func (m *ConvertRes) XXX_Size() int
func (*ConvertRes) XXX_Unmarshal ¶
func (m *ConvertRes) XXX_Unmarshal(b []byte) error
type HelloHandler ¶
type HelloReq ¶
type HelloReq struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HelloReq) Descriptor ¶
func (*HelloReq) ProtoMessage ¶
func (*HelloReq) ProtoMessage()
func (*HelloReq) XXX_DiscardUnknown ¶
func (m *HelloReq) XXX_DiscardUnknown()
func (*HelloReq) XXX_Marshal ¶
func (*HelloReq) XXX_Unmarshal ¶
type HelloRes ¶
type HelloRes struct { Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HelloRes) Descriptor ¶
func (*HelloRes) ProtoMessage ¶
func (*HelloRes) ProtoMessage()
func (*HelloRes) XXX_DiscardUnknown ¶
func (m *HelloRes) XXX_DiscardUnknown()
func (*HelloRes) XXX_Marshal ¶
func (*HelloRes) XXX_Unmarshal ¶
type HelloService ¶
type HelloService interface { // 用于性能测试 Hello(ctx context.Context, in *HelloReq, opts ...client.CallOption) (*HelloRes, error) }
func NewHelloService ¶
func NewHelloService(name string, c client.Client) HelloService
type ProtoDoc ¶
type ProtoDoc struct{}
func (*ProtoDoc) Convert ¶
func (p *ProtoDoc) Convert(ctx context.Context, req *ConvertReq, res *ConvertRes) error
type ProtoDocHandler ¶
type ProtoDocHandler interface { // 把 proto3 定义的协议转换成文档 Convert(context.Context, *ConvertReq, *ConvertRes) error }
type ProtoDocService ¶
type ProtoDocService interface { // 把 proto3 定义的协议转换成文档 Convert(ctx context.Context, in *ConvertReq, opts ...client.CallOption) (*ConvertRes, error) }
func NewProtoDocService ¶
func NewProtoDocService(name string, c client.Client) ProtoDocService
Click to show internal directories.
Click to hide internal directories.