proto_posts

package
Version: v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostsEndpoints

func NewPostsEndpoints() []*api.Endpoint

func RegisterPostsHandler

func RegisterPostsHandler(s server.Server, hdlr PostsHandler, opts ...server.HandlerOption) error

Types

type DeleteRequest

type DeleteRequest struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DeleteRequest) Descriptor

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

func (*DeleteRequest) GetId

func (m *DeleteRequest) GetId() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) Reset

func (m *DeleteRequest) Reset()

func (*DeleteRequest) String

func (m *DeleteRequest) String() string

func (*DeleteRequest) XXX_DiscardUnknown

func (m *DeleteRequest) XXX_DiscardUnknown()

func (*DeleteRequest) XXX_Marshal

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

func (*DeleteRequest) XXX_Merge

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

func (*DeleteRequest) XXX_Size

func (m *DeleteRequest) XXX_Size() int

func (*DeleteRequest) XXX_Unmarshal

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

type DeleteResponse

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

func (*DeleteResponse) Descriptor

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

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) Reset

func (m *DeleteResponse) Reset()

func (*DeleteResponse) String

func (m *DeleteResponse) String() string

func (*DeleteResponse) XXX_DiscardUnknown

func (m *DeleteResponse) XXX_DiscardUnknown()

func (*DeleteResponse) XXX_Marshal

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

func (*DeleteResponse) XXX_Merge

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

func (*DeleteResponse) XXX_Size

func (m *DeleteResponse) XXX_Size() int

func (*DeleteResponse) XXX_Unmarshal

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

type Post

type Post struct {
	Id                   string            `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Title                string            `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
	Slug                 string            `protobuf:"bytes,3,opt,name=slug,proto3" json:"slug,omitempty"`
	Content              string            `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"`
	Created              int64             `protobuf:"varint,5,opt,name=created,proto3" json:"created,omitempty"`
	Updated              int64             `protobuf:"varint,6,opt,name=updated,proto3" json:"updated,omitempty"`
	Author               string            `protobuf:"bytes,7,opt,name=author,proto3" json:"author,omitempty"`
	Tags                 []string          `protobuf:"bytes,8,rep,name=tags,proto3" json:"tags,omitempty"`
	Metadata             map[string]string `` /* 157-byte string literal not displayed */
	Image                string            `protobuf:"bytes,19,opt,name=image,proto3" json:"image,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*Post) Descriptor

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

func (*Post) GetAuthor

func (m *Post) GetAuthor() string

func (*Post) GetContent

func (m *Post) GetContent() string

func (*Post) GetCreated

func (m *Post) GetCreated() int64

func (*Post) GetId

func (m *Post) GetId() string

func (*Post) GetImage

func (m *Post) GetImage() string

func (*Post) GetMetadata

func (m *Post) GetMetadata() map[string]string

func (*Post) GetSlug

func (m *Post) GetSlug() string

func (*Post) GetTags

func (m *Post) GetTags() []string

func (*Post) GetTitle

func (m *Post) GetTitle() string

func (*Post) GetUpdated

func (m *Post) GetUpdated() int64

func (*Post) ProtoMessage

func (*Post) ProtoMessage()

func (*Post) Reset

func (m *Post) Reset()

func (*Post) String

func (m *Post) String() string

func (*Post) XXX_DiscardUnknown

func (m *Post) XXX_DiscardUnknown()

func (*Post) XXX_Marshal

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

func (*Post) XXX_Merge

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

func (*Post) XXX_Size

func (m *Post) XXX_Size() int

func (*Post) XXX_Unmarshal

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

type PostsHandler

type PostsHandler interface {
	// Query currently only supports read by slug or timestamp, no listing.
	Query(context.Context, *QueryRequest, *QueryResponse) error
	// Save post
	Save(context.Context, *SaveRequest, *SaveResponse) error
	// Delete post
	Delete(context.Context, *DeleteRequest, *DeleteResponse) error
	Report(context.Context, *ReportRequest, *empty.Empty) error
}

type PostsService

type PostsService interface {
	// Query currently only supports read by slug or timestamp, no listing.
	Query(ctx context.Context, in *QueryRequest, opts ...client.CallOption) (*QueryResponse, error)
	// Save post
	Save(ctx context.Context, in *SaveRequest, opts ...client.CallOption) (*SaveResponse, error)
	// Delete post
	Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error)
	Report(ctx context.Context, in *ReportRequest, opts ...client.CallOption) (*empty.Empty, error)
}

func NewPostsService

func NewPostsService(name string, c client.Client) PostsService

type QueryRequest

type QueryRequest struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Slug                 string   `protobuf:"bytes,2,opt,name=slug,proto3" json:"slug,omitempty"`
	Tag                  string   `protobuf:"bytes,3,opt,name=tag,proto3" json:"tag,omitempty"`
	Offset               int64    `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"`
	Limit                int64    `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Query posts. Acts as a listing when no id or slug provided. Gets a single post by id or slug if any of them provided.

func (*QueryRequest) Descriptor

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

func (*QueryRequest) GetId

func (m *QueryRequest) GetId() string

func (*QueryRequest) GetLimit

func (m *QueryRequest) GetLimit() int64

func (*QueryRequest) GetOffset

func (m *QueryRequest) GetOffset() int64

func (*QueryRequest) GetSlug

func (m *QueryRequest) GetSlug() string

func (*QueryRequest) GetTag

func (m *QueryRequest) GetTag() string

func (*QueryRequest) ProtoMessage

func (*QueryRequest) ProtoMessage()

func (*QueryRequest) Reset

func (m *QueryRequest) Reset()

func (*QueryRequest) String

func (m *QueryRequest) String() string

func (*QueryRequest) XXX_DiscardUnknown

func (m *QueryRequest) XXX_DiscardUnknown()

func (*QueryRequest) XXX_Marshal

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

func (*QueryRequest) XXX_Merge

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

func (*QueryRequest) XXX_Size

func (m *QueryRequest) XXX_Size() int

func (*QueryRequest) XXX_Unmarshal

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

type QueryResponse

type QueryResponse struct {
	Posts                []*Post  `protobuf:"bytes,1,rep,name=posts,proto3" json:"posts,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*QueryResponse) Descriptor

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

func (*QueryResponse) GetPosts

func (m *QueryResponse) GetPosts() []*Post

func (*QueryResponse) ProtoMessage

func (*QueryResponse) ProtoMessage()

func (*QueryResponse) Reset

func (m *QueryResponse) Reset()

func (*QueryResponse) String

func (m *QueryResponse) String() string

func (*QueryResponse) XXX_DiscardUnknown

func (m *QueryResponse) XXX_DiscardUnknown()

func (*QueryResponse) XXX_Marshal

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

func (*QueryResponse) XXX_Merge

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

func (*QueryResponse) XXX_Size

func (m *QueryResponse) XXX_Size() int

func (*QueryResponse) XXX_Unmarshal

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

type ReportRequest

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

func (*ReportRequest) Descriptor

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

func (*ReportRequest) ProtoMessage

func (*ReportRequest) ProtoMessage()

func (*ReportRequest) Reset

func (m *ReportRequest) Reset()

func (*ReportRequest) String

func (m *ReportRequest) String() string

func (*ReportRequest) XXX_DiscardUnknown

func (m *ReportRequest) XXX_DiscardUnknown()

func (*ReportRequest) XXX_Marshal

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

func (*ReportRequest) XXX_Merge

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

func (*ReportRequest) XXX_Size

func (m *ReportRequest) XXX_Size() int

func (*ReportRequest) XXX_Unmarshal

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

type SaveRequest

type SaveRequest struct {
	Id        string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Title     string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
	Slug      string `protobuf:"bytes,3,opt,name=slug,proto3" json:"slug,omitempty"`
	Content   string `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"`
	Timestamp int64  `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// When updating a post and wanting to delete all tags,
	// send a list of tags with only one member being an empty string [""]
	Tags                 []string          `protobuf:"bytes,6,rep,name=tags,proto3" json:"tags,omitempty"`
	Metadata             map[string]string `` /* 157-byte string literal not displayed */
	Image                string            `protobuf:"bytes,8,opt,name=image,proto3" json:"image,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*SaveRequest) Descriptor

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

func (*SaveRequest) GetContent

func (m *SaveRequest) GetContent() string

func (*SaveRequest) GetId

func (m *SaveRequest) GetId() string

func (*SaveRequest) GetImage

func (m *SaveRequest) GetImage() string

func (*SaveRequest) GetMetadata

func (m *SaveRequest) GetMetadata() map[string]string

func (*SaveRequest) GetSlug

func (m *SaveRequest) GetSlug() string

func (*SaveRequest) GetTags

func (m *SaveRequest) GetTags() []string

func (*SaveRequest) GetTimestamp

func (m *SaveRequest) GetTimestamp() int64

func (*SaveRequest) GetTitle

func (m *SaveRequest) GetTitle() string

func (*SaveRequest) ProtoMessage

func (*SaveRequest) ProtoMessage()

func (*SaveRequest) Reset

func (m *SaveRequest) Reset()

func (*SaveRequest) String

func (m *SaveRequest) String() string

func (*SaveRequest) XXX_DiscardUnknown

func (m *SaveRequest) XXX_DiscardUnknown()

func (*SaveRequest) XXX_Marshal

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

func (*SaveRequest) XXX_Merge

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

func (*SaveRequest) XXX_Size

func (m *SaveRequest) XXX_Size() int

func (*SaveRequest) XXX_Unmarshal

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

type SaveResponse

type SaveResponse struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*SaveResponse) Descriptor

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

func (*SaveResponse) GetId

func (m *SaveResponse) GetId() string

func (*SaveResponse) ProtoMessage

func (*SaveResponse) ProtoMessage()

func (*SaveResponse) Reset

func (m *SaveResponse) Reset()

func (*SaveResponse) String

func (m *SaveResponse) String() string

func (*SaveResponse) XXX_DiscardUnknown

func (m *SaveResponse) XXX_DiscardUnknown()

func (*SaveResponse) XXX_Marshal

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

func (*SaveResponse) XXX_Merge

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

func (*SaveResponse) XXX_Size

func (m *SaveResponse) XXX_Size() int

func (*SaveResponse) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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