Documentation ¶
Index ¶
- Variables
- func RegisterServiceHandler(s server.Server, hdlr ServiceHandler, opts ...server.HandlerOption) error
- type Article
- func (*Article) Descriptor() ([]byte, []int)
- func (m *Article) GetContent() string
- func (m *Article) GetCreatedAt() time.Time
- func (m *Article) GetId() int64
- func (m *Article) GetStatus() int32
- func (m *Article) GetTitle() string
- func (m *Article) GetUpdatedAt() time.Time
- func (m *Article) Marshal() (dAtA []byte, err error)
- func (m *Article) MarshalTo(dAtA []byte) (int, error)
- func (*Article) ProtoMessage()
- func (m *Article) Reset()
- func (m *Article) Size() (n int)
- func (m *Article) String() string
- func (m *Article) Unmarshal(dAtA []byte) error
- func (m *Article) XXX_DiscardUnknown()
- func (m *Article) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Article) XXX_Merge(src proto.Message)
- func (m *Article) XXX_Size() int
- func (m *Article) XXX_Unmarshal(b []byte) error
- type ArticleList
- func (*ArticleList) Descriptor() ([]byte, []int)
- func (m *ArticleList) GetList() []*Article
- func (m *ArticleList) Marshal() (dAtA []byte, err error)
- func (m *ArticleList) MarshalTo(dAtA []byte) (int, error)
- func (*ArticleList) ProtoMessage()
- func (m *ArticleList) Reset()
- func (m *ArticleList) Size() (n int)
- func (m *ArticleList) String() string
- func (m *ArticleList) Unmarshal(dAtA []byte) error
- func (m *ArticleList) XXX_DiscardUnknown()
- func (m *ArticleList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ArticleList) XXX_Merge(src proto.Message)
- func (m *ArticleList) XXX_Size() int
- func (m *ArticleList) XXX_Unmarshal(b []byte) error
- type Id
- func (*Id) Descriptor() ([]byte, []int)
- func (m *Id) GetId() int64
- func (m *Id) Marshal() (dAtA []byte, err error)
- func (m *Id) MarshalTo(dAtA []byte) (int, error)
- func (*Id) ProtoMessage()
- func (m *Id) Reset()
- func (m *Id) Size() (n int)
- func (m *Id) String() string
- func (m *Id) Unmarshal(dAtA []byte) error
- func (m *Id) XXX_DiscardUnknown()
- func (m *Id) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Id) XXX_Merge(src proto.Message)
- func (m *Id) XXX_Size() int
- func (m *Id) XXX_Unmarshal(b []byte) error
- type Null
- func (*Null) Descriptor() ([]byte, []int)
- func (m *Null) Marshal() (dAtA []byte, err error)
- func (m *Null) MarshalTo(dAtA []byte) (int, error)
- func (*Null) ProtoMessage()
- func (m *Null) Reset()
- func (m *Null) Size() (n int)
- func (m *Null) String() string
- func (m *Null) Unmarshal(dAtA []byte) error
- func (m *Null) XXX_DiscardUnknown()
- func (m *Null) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Null) XXX_Merge(src proto.Message)
- func (m *Null) XXX_Size() int
- func (m *Null) XXX_Unmarshal(b []byte) error
- type Page
- func (*Page) Descriptor() ([]byte, []int)
- func (m *Page) GetLimit() int64
- func (m *Page) GetPage() int64
- func (m *Page) Marshal() (dAtA []byte, err error)
- func (m *Page) MarshalTo(dAtA []byte) (int, error)
- func (*Page) ProtoMessage()
- func (m *Page) Reset()
- func (m *Page) Size() (n int)
- func (m *Page) String() string
- func (m *Page) Unmarshal(dAtA []byte) error
- func (m *Page) XXX_DiscardUnknown()
- func (m *Page) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Page) XXX_Merge(src proto.Message)
- func (m *Page) XXX_Size() int
- func (m *Page) XXX_Unmarshal(b []byte) error
- type PageUID
- func (*PageUID) Descriptor() ([]byte, []int)
- func (m *PageUID) GetLimit() int64
- func (m *PageUID) GetPage() int64
- func (m *PageUID) GetUid() int64
- func (m *PageUID) Marshal() (dAtA []byte, err error)
- func (m *PageUID) MarshalTo(dAtA []byte) (int, error)
- func (*PageUID) ProtoMessage()
- func (m *PageUID) Reset()
- func (m *PageUID) Size() (n int)
- func (m *PageUID) String() string
- func (m *PageUID) Unmarshal(dAtA []byte) error
- func (m *PageUID) XXX_DiscardUnknown()
- func (m *PageUID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PageUID) XXX_Merge(src proto.Message)
- func (m *PageUID) XXX_Size() int
- func (m *PageUID) XXX_Unmarshal(b []byte) error
- type Service
- type ServiceHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLengthArticle = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowArticle = fmt.Errorf("proto: integer overflow") )
Functions ¶
func RegisterServiceHandler ¶
func RegisterServiceHandler(s server.Server, hdlr ServiceHandler, opts ...server.HandlerOption) error
Types ¶
type Article ¶
type Article struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` CreatedAt time.Time `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at"` UpdatedAt time.Time `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at"` }
func (*Article) Descriptor ¶
func (*Article) GetContent ¶
func (*Article) GetCreatedAt ¶
func (*Article) GetUpdatedAt ¶
func (*Article) ProtoMessage ¶
func (*Article) ProtoMessage()
func (*Article) XXX_DiscardUnknown ¶
func (m *Article) XXX_DiscardUnknown()
func (*Article) XXX_Marshal ¶
func (*Article) XXX_Unmarshal ¶
type ArticleList ¶
type ArticleList struct {
List []*Article `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
}
func (*ArticleList) Descriptor ¶
func (*ArticleList) Descriptor() ([]byte, []int)
func (*ArticleList) GetList ¶
func (m *ArticleList) GetList() []*Article
func (*ArticleList) Marshal ¶ added in v0.0.3
func (m *ArticleList) Marshal() (dAtA []byte, err error)
func (*ArticleList) MarshalTo ¶ added in v0.0.3
func (m *ArticleList) MarshalTo(dAtA []byte) (int, error)
func (*ArticleList) ProtoMessage ¶
func (*ArticleList) ProtoMessage()
func (*ArticleList) Reset ¶
func (m *ArticleList) Reset()
func (*ArticleList) Size ¶ added in v0.0.3
func (m *ArticleList) Size() (n int)
func (*ArticleList) String ¶
func (m *ArticleList) String() string
func (*ArticleList) Unmarshal ¶ added in v0.0.3
func (m *ArticleList) Unmarshal(dAtA []byte) error
func (*ArticleList) XXX_DiscardUnknown ¶
func (m *ArticleList) XXX_DiscardUnknown()
func (*ArticleList) XXX_Marshal ¶
func (m *ArticleList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ArticleList) XXX_Merge ¶
func (m *ArticleList) XXX_Merge(src proto.Message)
func (*ArticleList) XXX_Size ¶
func (m *ArticleList) XXX_Size() int
func (*ArticleList) XXX_Unmarshal ¶
func (m *ArticleList) XXX_Unmarshal(b []byte) error
type Id ¶
type Id struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}
func (*Id) Descriptor ¶
func (*Id) ProtoMessage ¶
func (*Id) ProtoMessage()
func (*Id) XXX_DiscardUnknown ¶
func (m *Id) XXX_DiscardUnknown()
func (*Id) XXX_Unmarshal ¶
type Null ¶
type Null struct { }
func (*Null) Descriptor ¶
func (*Null) ProtoMessage ¶
func (*Null) ProtoMessage()
func (*Null) XXX_DiscardUnknown ¶
func (m *Null) XXX_DiscardUnknown()
func (*Null) XXX_Unmarshal ¶
type Page ¶
type Page struct { Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` }
func (*Page) Descriptor ¶
func (*Page) ProtoMessage ¶
func (*Page) ProtoMessage()
func (*Page) XXX_DiscardUnknown ¶
func (m *Page) XXX_DiscardUnknown()
func (*Page) XXX_Unmarshal ¶
type PageUID ¶
type PageUID struct { Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` Uid int64 `protobuf:"varint,3,opt,name=uid,proto3" json:"uid,omitempty"` }
func (*PageUID) Descriptor ¶
func (*PageUID) ProtoMessage ¶
func (*PageUID) ProtoMessage()
func (*PageUID) XXX_DiscardUnknown ¶
func (m *PageUID) XXX_DiscardUnknown()
func (*PageUID) XXX_Marshal ¶
func (*PageUID) XXX_Unmarshal ¶
type Service ¶
type Service interface { // Create 创建 Create(ctx context.Context, in *Article, opts ...client.CallOption) (*Article, error) // Update 更新 Update(ctx context.Context, in *Article, opts ...client.CallOption) (*Article, error) // Delete 删除 Delete(ctx context.Context, in *Id, opts ...client.CallOption) (*Null, error) // ListWithPage 文章分页 ListWithPage(ctx context.Context, in *Page, opts ...client.CallOption) (*ArticleList, error) // ListByUIDWithPage 用户文章分页 ListByUIDWithPage(ctx context.Context, in *PageUID, opts ...client.CallOption) (*ArticleList, error) }
type ServiceHandler ¶
type ServiceHandler interface { // Create 创建 Create(context.Context, *Article, *Article) error // Update 更新 Update(context.Context, *Article, *Article) error // Delete 删除 Delete(context.Context, *Id, *Null) error // ListWithPage 文章分页 ListWithPage(context.Context, *Page, *ArticleList) error // ListByUIDWithPage 用户文章分页 ListByUIDWithPage(context.Context, *PageUID, *ArticleList) error }
Click to show internal directories.
Click to hide internal directories.