protodoc

package
v0.0.0-...-90dec0a Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceName = "protodoc"
)

Variables

This section is empty.

Functions

func NewHelloEndpoints

func NewHelloEndpoints() []*api.Endpoint

func NewProtoDocEndpoints

func NewProtoDocEndpoints() []*api.Endpoint

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 Hello

type Hello struct{}

func (*Hello) Hello

func (h *Hello) Hello(ctx context.Context, req *HelloReq, res *HelloRes) error

type HelloHandler

type HelloHandler interface {
	// 用于性能测试
	Hello(context.Context, *HelloReq, *HelloRes) error
}

type HelloReq

type HelloReq struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HelloReq) Descriptor

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

func (*HelloReq) ProtoMessage

func (*HelloReq) ProtoMessage()

func (*HelloReq) Reset

func (m *HelloReq) Reset()

func (*HelloReq) String

func (m *HelloReq) String() string

func (*HelloReq) XXX_DiscardUnknown

func (m *HelloReq) XXX_DiscardUnknown()

func (*HelloReq) XXX_Marshal

func (m *HelloReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HelloReq) XXX_Merge

func (m *HelloReq) XXX_Merge(src proto.Message)

func (*HelloReq) XXX_Size

func (m *HelloReq) XXX_Size() int

func (*HelloReq) XXX_Unmarshal

func (m *HelloReq) XXX_Unmarshal(b []byte) error

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

func (*HelloRes) GetData

func (m *HelloRes) GetData() string

func (*HelloRes) ProtoMessage

func (*HelloRes) ProtoMessage()

func (*HelloRes) Reset

func (m *HelloRes) Reset()

func (*HelloRes) String

func (m *HelloRes) String() string

func (*HelloRes) XXX_DiscardUnknown

func (m *HelloRes) XXX_DiscardUnknown()

func (*HelloRes) XXX_Marshal

func (m *HelloRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HelloRes) XXX_Merge

func (m *HelloRes) XXX_Merge(src proto.Message)

func (*HelloRes) XXX_Size

func (m *HelloRes) XXX_Size() int

func (*HelloRes) XXX_Unmarshal

func (m *HelloRes) XXX_Unmarshal(b []byte) error

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

type Server

type Server struct {
	Namespace string `json:"namespace"`
}

func NewServer

func NewServer() *Server

func (*Server) Name

func (s *Server) Name() string

func (*Server) Run

func (s *Server) Run()

Jump to

Keyboard shortcuts

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