article

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

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

func (*Article) GetContent

func (m *Article) GetContent() string

func (*Article) GetCreatedAt

func (m *Article) GetCreatedAt() time.Time

func (*Article) GetId

func (m *Article) GetId() int64

func (*Article) GetStatus

func (m *Article) GetStatus() int32

func (*Article) GetTitle

func (m *Article) GetTitle() string

func (*Article) GetUpdatedAt

func (m *Article) GetUpdatedAt() time.Time

func (*Article) Marshal added in v0.0.3

func (m *Article) Marshal() (dAtA []byte, err error)

func (*Article) MarshalTo added in v0.0.3

func (m *Article) MarshalTo(dAtA []byte) (int, error)

func (*Article) ProtoMessage

func (*Article) ProtoMessage()

func (*Article) Reset

func (m *Article) Reset()

func (*Article) Size added in v0.0.3

func (m *Article) Size() (n int)

func (*Article) String

func (m *Article) String() string

func (*Article) Unmarshal added in v0.0.3

func (m *Article) Unmarshal(dAtA []byte) error

func (*Article) XXX_DiscardUnknown

func (m *Article) XXX_DiscardUnknown()

func (*Article) XXX_Marshal

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

func (*Article) XXX_Merge

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

func (*Article) XXX_Size

func (m *Article) XXX_Size() int

func (*Article) XXX_Unmarshal

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

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

func (*Id) GetId

func (m *Id) GetId() int64

func (*Id) Marshal added in v0.0.3

func (m *Id) Marshal() (dAtA []byte, err error)

func (*Id) MarshalTo added in v0.0.3

func (m *Id) MarshalTo(dAtA []byte) (int, error)

func (*Id) ProtoMessage

func (*Id) ProtoMessage()

func (*Id) Reset

func (m *Id) Reset()

func (*Id) Size added in v0.0.3

func (m *Id) Size() (n int)

func (*Id) String

func (m *Id) String() string

func (*Id) Unmarshal added in v0.0.3

func (m *Id) Unmarshal(dAtA []byte) error

func (*Id) XXX_DiscardUnknown

func (m *Id) XXX_DiscardUnknown()

func (*Id) XXX_Marshal

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

func (*Id) XXX_Merge

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

func (*Id) XXX_Size

func (m *Id) XXX_Size() int

func (*Id) XXX_Unmarshal

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

type Null

type Null struct {
}

func (*Null) Descriptor

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

func (*Null) Marshal added in v0.0.3

func (m *Null) Marshal() (dAtA []byte, err error)

func (*Null) MarshalTo added in v0.0.3

func (m *Null) MarshalTo(dAtA []byte) (int, error)

func (*Null) ProtoMessage

func (*Null) ProtoMessage()

func (*Null) Reset

func (m *Null) Reset()

func (*Null) Size added in v0.0.3

func (m *Null) Size() (n int)

func (*Null) String

func (m *Null) String() string

func (*Null) Unmarshal added in v0.0.3

func (m *Null) Unmarshal(dAtA []byte) error

func (*Null) XXX_DiscardUnknown

func (m *Null) XXX_DiscardUnknown()

func (*Null) XXX_Marshal

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

func (*Null) XXX_Merge

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

func (*Null) XXX_Size

func (m *Null) XXX_Size() int

func (*Null) XXX_Unmarshal

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

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

func (*Page) GetLimit

func (m *Page) GetLimit() int64

func (*Page) GetPage

func (m *Page) GetPage() int64

func (*Page) Marshal added in v0.0.3

func (m *Page) Marshal() (dAtA []byte, err error)

func (*Page) MarshalTo added in v0.0.3

func (m *Page) MarshalTo(dAtA []byte) (int, error)

func (*Page) ProtoMessage

func (*Page) ProtoMessage()

func (*Page) Reset

func (m *Page) Reset()

func (*Page) Size added in v0.0.3

func (m *Page) Size() (n int)

func (*Page) String

func (m *Page) String() string

func (*Page) Unmarshal added in v0.0.3

func (m *Page) Unmarshal(dAtA []byte) error

func (*Page) XXX_DiscardUnknown

func (m *Page) XXX_DiscardUnknown()

func (*Page) XXX_Marshal

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

func (*Page) XXX_Merge

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

func (*Page) XXX_Size

func (m *Page) XXX_Size() int

func (*Page) XXX_Unmarshal

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

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

func (*PageUID) GetLimit

func (m *PageUID) GetLimit() int64

func (*PageUID) GetPage

func (m *PageUID) GetPage() int64

func (*PageUID) GetUid

func (m *PageUID) GetUid() int64

func (*PageUID) Marshal added in v0.0.3

func (m *PageUID) Marshal() (dAtA []byte, err error)

func (*PageUID) MarshalTo added in v0.0.3

func (m *PageUID) MarshalTo(dAtA []byte) (int, error)

func (*PageUID) ProtoMessage

func (*PageUID) ProtoMessage()

func (*PageUID) Reset

func (m *PageUID) Reset()

func (*PageUID) Size added in v0.0.3

func (m *PageUID) Size() (n int)

func (*PageUID) String

func (m *PageUID) String() string

func (*PageUID) Unmarshal added in v0.0.3

func (m *PageUID) Unmarshal(dAtA []byte) error

func (*PageUID) XXX_DiscardUnknown

func (m *PageUID) XXX_DiscardUnknown()

func (*PageUID) XXX_Marshal

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

func (*PageUID) XXX_Merge

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

func (*PageUID) XXX_Size

func (m *PageUID) XXX_Size() int

func (*PageUID) XXX_Unmarshal

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

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

func NewService

func NewService(name string, c client.Client) Service

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
}

Jump to

Keyboard shortcuts

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