blog

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

README

Blog module

Requirements

This module defines the required components for blog.

  • A blog is where a user posts their article
  • Every user can post article on their blog and has permission delete only their article
  • Blog owner can set a time to delete the article during and after creation
  • Users can like and comment to others articles
State
  • User
    • ID
    • Username
    • Bio
  • Blog
    • ID
    • Owner
    • Title
    • Description
    • CreatedAt
  • Article
    • ID
    • BlogID
    • Title
    • Content
    • CreatedAt
    • DeleteAt
    • CommentCount
    • LikeCount
  • Comment
    • ID
    • ArticleID
    • Owner
    • Content
  • Like
    • ID
    • ArticleID
    • Owner
Messages
  • Create User
    • Username
    • Bio
  • Create Blog
    • Title
    • Description
  • Create Article
    • BlogID
    • Title
    • Content
    • DeleteAt
  • Delete Article
    • ArticleID
    • DeleteAt
  • Create Comment
    • ArticleID
    • Content
  • Like Article
    • ArticleID

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthCodec = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCodec   = fmt.Errorf("proto: integer overflow")
)

Functions

func BuildArticleUserIndex

func BuildArticleUserIndex(comment *Comment) []byte

BuildArticleUserIndex indexByteSize = 8(ArticleID) + 8(UserID)

func BuildBlogTimedIndex

func BuildBlogTimedIndex(article *Article) ([]byte, error)

BuildBlogTimedIndex produces 8 bytes BlogID || big-endian createdAt This allows lexographical searches over the time ranges (or earliest or latest) of all articles within one blog

func NewCancelDeleteArticleTaskHandler

func NewCancelDeleteArticleTaskHandler(auth x.Authenticator, scheduler weave.Scheduler) weave.Handler

NewCancelDeleteArticleTaskHandler creates a cancel delete article task msg handler

func NewChangeBlogOwnerHandler

func NewChangeBlogOwnerHandler(auth x.Authenticator) weave.Handler

NewChangeBlogOwnerHandler creates a blog message handler

func NewCreateArticleHandler

func NewCreateArticleHandler(auth x.Authenticator, scheduler weave.Scheduler) weave.Handler

NewCreateArticleHandler creates a article message handler

func NewCreateBlogHandler

func NewCreateBlogHandler(auth x.Authenticator) weave.Handler

NewCreateBlogHandler creates a blog message handler

func NewCreateCommentHandler

func NewCreateCommentHandler(auth x.Authenticator) weave.Handler

NewCreateCommentHandler creates a comment message handler

func NewCreateLikeHandler

func NewCreateLikeHandler(auth x.Authenticator) weave.Handler

NewCreateLikeHandler creates a like message handler

func NewCreateUserHandler

func NewCreateUserHandler(auth x.Authenticator) weave.Handler

NewCreateUserHandler creates a user message handler

func NewDeleteArticleHandler

func NewDeleteArticleHandler(auth x.Authenticator) weave.Handler

NewDeleteArticleHandler creates a article message handler

func RegisterCronRoutes

func RegisterCronRoutes(
	r weave.Registry,
	auth x.Authenticator,
)

RegisterCronRoutes registers routes that are not exposed to routers

func RegisterQuery

func RegisterQuery(qr weave.QueryRouter)

RegisterQuery registers buckets for querying.

func RegisterRoutes

func RegisterRoutes(r weave.Registry, auth x.Authenticator, scheduler weave.Scheduler)

RegisterRoutes registers handlers for message processing.

Types

type Article

type Article struct {
	Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// ID is article's identifier
	ID []byte `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	// BlogID identifies blog that article is posted to
	BlogID []byte `protobuf:"bytes,3,opt,name=blog_id,json=blogId,proto3" json:"blog_id,omitempty"`
	// Owner is the owner address of the blog
	Owner github_com_iov_one_weave.Address `protobuf:"bytes,4,opt,name=owner,proto3,casttype=github.com/iov-one/weave.Address" json:"owner,omitempty"`
	// Title is title of the article
	Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"`
	// Content is content of the blog
	Content string `protobuf:"bytes,6,opt,name=content,proto3" json:"content,omitempty"`
	// CommentCount is total number of comments posted under article
	CommentCount int64 `protobuf:"varint,7,opt,name=comment_count,json=commentCount,proto3" json:"comment_count,omitempty"`
	// LikeCount is total number of likes posted under article
	LikeCount int64 `protobuf:"varint,8,opt,name=like_count,json=likeCount,proto3" json:"like_count,omitempty"`
	// CreatedAt defines creation time of the article
	CreatedAt github_com_iov_one_weave.UnixTime `` /* 132-byte string literal not displayed */
	// DeleteAt defines deletion time of the article.
	// Could be nil if there is not a time of deletion
	DeleteAt github_com_iov_one_weave.UnixTime `` /* 130-byte string literal not displayed */
}

func (*Article) Copy

func (m *Article) Copy() orm.CloneableData

Copy produces a new copy to fulfill the Model interface TODO remove after weave 0.22.0 is released

func (*Article) Descriptor

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

func (*Article) GetBlogID

func (m *Article) GetBlogID() []byte

func (*Article) GetCommentCount

func (m *Article) GetCommentCount() int64

func (*Article) GetContent

func (m *Article) GetContent() string

func (*Article) GetCreatedAt

func (m *Article) GetCreatedAt() github_com_iov_one_weave.UnixTime

func (*Article) GetDeleteAt

func (m *Article) GetDeleteAt() github_com_iov_one_weave.UnixTime

func (*Article) GetID

func (m *Article) GetID() []byte

func (*Article) GetLikeCount

func (m *Article) GetLikeCount() int64

func (*Article) GetMetadata

func (m *Article) GetMetadata() *weave.Metadata

func (*Article) GetOwner

func (*Article) GetTitle

func (m *Article) GetTitle() string

func (*Article) Marshal

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

func (*Article) MarshalTo

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

func (*Article) ProtoMessage

func (*Article) ProtoMessage()

func (*Article) Reset

func (m *Article) Reset()

func (*Article) SetID

func (m *Article) SetID(id []byte) error

SetID is a minimal implementation, useful when the ID is a separate protobuf field

func (*Article) Size

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

func (*Article) String

func (m *Article) String() string

func (*Article) Unmarshal

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

func (*Article) Validate

func (m *Article) Validate() error

Validate validates article's fields

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 ArticleBucket

type ArticleBucket struct {
	morm.ModelBucket
}

func NewArticleBucket

func NewArticleBucket() *ArticleBucket

NewArticleBucket returns a new article bucket

type Blog

type Blog struct {
	Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// ID is blog's identifier
	ID []byte `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	// Owner is the owner address of the blog
	Owner github_com_iov_one_weave.Address `protobuf:"bytes,3,opt,name=owner,proto3,casttype=github.com/iov-one/weave.Address" json:"owner,omitempty"`
	// Title is title of the blog
	Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"`
	// Description is description section of the blog
	Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
	// CreatedAt defines creation time of the blog
	CreatedAt github_com_iov_one_weave.UnixTime `` /* 132-byte string literal not displayed */
}

func (*Blog) Copy

func (m *Blog) Copy() orm.CloneableData

Copy produces a new copy to fulfill the Model interface

func (*Blog) Descriptor

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

func (*Blog) GetCreatedAt

func (m *Blog) GetCreatedAt() github_com_iov_one_weave.UnixTime

func (*Blog) GetDescription

func (m *Blog) GetDescription() string

func (*Blog) GetID

func (m *Blog) GetID() []byte

func (*Blog) GetMetadata

func (m *Blog) GetMetadata() *weave.Metadata

func (*Blog) GetOwner

func (m *Blog) GetOwner() github_com_iov_one_weave.Address

func (*Blog) GetTitle

func (m *Blog) GetTitle() string

func (*Blog) Marshal

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

func (*Blog) MarshalTo

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

func (*Blog) ProtoMessage

func (*Blog) ProtoMessage()

func (*Blog) Reset

func (m *Blog) Reset()

func (*Blog) SetID

func (m *Blog) SetID(id []byte) error

SetID is a minimal implementation, useful when the ID is a separate protobuf field

func (*Blog) Size

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

func (*Blog) String

func (m *Blog) String() string

func (*Blog) Unmarshal

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

func (*Blog) Validate

func (m *Blog) Validate() error

Validate validates blog's fields

func (*Blog) XXX_DiscardUnknown

func (m *Blog) XXX_DiscardUnknown()

func (*Blog) XXX_Marshal

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

func (*Blog) XXX_Merge

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

func (*Blog) XXX_Size

func (m *Blog) XXX_Size() int

func (*Blog) XXX_Unmarshal

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

type BlogBucket

type BlogBucket struct {
	morm.ModelBucket
}

func NewBlogBucket

func NewBlogBucket() *BlogBucket

NewBlogBucket returns a new blog bucket

type CancelDeleteArticleTaskHandler

type CancelDeleteArticleTaskHandler struct {
	// contains filtered or unexported fields
}

CancelDeleteArticleTaskHandler will handle CancelDeleteArticleTaskMsg

func (CancelDeleteArticleTaskHandler) Check

Check just verifies it is properly formed and returns the cost of executing it.

func (CancelDeleteArticleTaskHandler) Deliver

Deliver cancels delete task if conditions are met

type CancelDeleteArticleTaskMsg

type CancelDeleteArticleTaskMsg struct {
	Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// TaskID is the identifier of the task
	TaskID []byte `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
}

CancelDeleteArticleTaskMsg message cancelles scheduled article deletion

func (*CancelDeleteArticleTaskMsg) Descriptor

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

func (*CancelDeleteArticleTaskMsg) GetMetadata

func (m *CancelDeleteArticleTaskMsg) GetMetadata() *weave.Metadata

func (*CancelDeleteArticleTaskMsg) GetTaskID

func (m *CancelDeleteArticleTaskMsg) GetTaskID() []byte

func (*CancelDeleteArticleTaskMsg) Marshal

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

func (*CancelDeleteArticleTaskMsg) MarshalTo

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

func (CancelDeleteArticleTaskMsg) Path

Path returns the routing path for this message.

func (*CancelDeleteArticleTaskMsg) ProtoMessage

func (*CancelDeleteArticleTaskMsg) ProtoMessage()

func (*CancelDeleteArticleTaskMsg) Reset

func (m *CancelDeleteArticleTaskMsg) Reset()

func (*CancelDeleteArticleTaskMsg) Size

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

func (*CancelDeleteArticleTaskMsg) String

func (m *CancelDeleteArticleTaskMsg) String() string

func (*CancelDeleteArticleTaskMsg) Unmarshal

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

func (CancelDeleteArticleTaskMsg) Validate

func (m CancelDeleteArticleTaskMsg) Validate() error

Validate ensures the CancelDeleteArticleTaskMsg is valid

func (*CancelDeleteArticleTaskMsg) XXX_DiscardUnknown

func (m *CancelDeleteArticleTaskMsg) XXX_DiscardUnknown()

func (*CancelDeleteArticleTaskMsg) XXX_Marshal

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

func (*CancelDeleteArticleTaskMsg) XXX_Merge

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

func (*CancelDeleteArticleTaskMsg) XXX_Size

func (m *CancelDeleteArticleTaskMsg) XXX_Size() int

func (*CancelDeleteArticleTaskMsg) XXX_Unmarshal

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

type ChangeBlogOwnerHandler

type ChangeBlogOwnerHandler struct {
	// contains filtered or unexported fields
}

ChangeBlogOwnerHandler will handle ChangeBlogOWnerMsg

func (ChangeBlogOwnerHandler) Check

Check just verifies it is properly formed and returns the cost of executing it.

func (ChangeBlogOwnerHandler) Deliver

Deliver creates an custom state and saves if all preconditions are met

type ChangeBlogOwnerMsg

type ChangeBlogOwnerMsg struct {
	Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// ID of the blog that is desired to change owner
	BlogID []byte `protobuf:"bytes,2,opt,name=blog_id,json=blogId,proto3" json:"blog_id,omitempty"`
	// Address of the new owner
	NewOwner github_com_iov_one_weave.Address `` /* 127-byte string literal not displayed */
}

func (*ChangeBlogOwnerMsg) Descriptor

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

func (*ChangeBlogOwnerMsg) GetBlogID

func (m *ChangeBlogOwnerMsg) GetBlogID() []byte

func (*ChangeBlogOwnerMsg) GetMetadata

func (m *ChangeBlogOwnerMsg) GetMetadata() *weave.Metadata

func (*ChangeBlogOwnerMsg) GetNewOwner

func (*ChangeBlogOwnerMsg) Marshal

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

func (*ChangeBlogOwnerMsg) MarshalTo

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

func (ChangeBlogOwnerMsg) Path

func (ChangeBlogOwnerMsg) Path() string

Path returns the routing path for this message.

func (*ChangeBlogOwnerMsg) ProtoMessage

func (*ChangeBlogOwnerMsg) ProtoMessage()

func (*ChangeBlogOwnerMsg) Reset

func (m *ChangeBlogOwnerMsg) Reset()

func (*ChangeBlogOwnerMsg) Size

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

func (*ChangeBlogOwnerMsg) String

func (m *ChangeBlogOwnerMsg) String() string

func (*ChangeBlogOwnerMsg) Unmarshal

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

func (ChangeBlogOwnerMsg) Validate

func (m ChangeBlogOwnerMsg) Validate() error

Validate ensures the ChangeBlogOwner is valid

func (*ChangeBlogOwnerMsg) XXX_DiscardUnknown

func (m *ChangeBlogOwnerMsg) XXX_DiscardUnknown()

func (*ChangeBlogOwnerMsg) XXX_Marshal

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

func (*ChangeBlogOwnerMsg) XXX_Merge

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

func (*ChangeBlogOwnerMsg) XXX_Size

func (m *ChangeBlogOwnerMsg) XXX_Size() int

func (*ChangeBlogOwnerMsg) XXX_Unmarshal

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

type Comment

type Comment struct {
	Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// ID is comment's identifier
	ID []byte `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	// ArticleID identifies article that comment is posted to
	ArticleID []byte `protobuf:"bytes,3,opt,name=article_id,json=articleId,proto3" json:"article_id,omitempty"`
	// Owner is the owner address of the comment
	Owner github_com_iov_one_weave.Address `protobuf:"bytes,4,opt,name=owner,proto3,casttype=github.com/iov-one/weave.Address" json:"owner,omitempty"`
	// Content is content of the comment
	Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"`
	// CreatedAt defines creation time of the comment
	CreatedAt github_com_iov_one_weave.UnixTime `` /* 132-byte string literal not displayed */
}

func (*Comment) Copy

func (m *Comment) Copy() orm.CloneableData

Copy produces a new copy to fulfill the Model interface TODO remove after weave 0.22.0 is released

func (*Comment) Descriptor

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

func (*Comment) GetArticleID

func (m *Comment) GetArticleID() []byte

func (*Comment) GetContent

func (m *Comment) GetContent() string

func (*Comment) GetCreatedAt

func (m *Comment) GetCreatedAt() github_com_iov_one_weave.UnixTime

func (*Comment) GetID

func (m *Comment) GetID() []byte

func (*Comment) GetMetadata

func (m *Comment) GetMetadata() *weave.Metadata

func (*Comment) GetOwner

func (*Comment) Marshal

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

func (*Comment) MarshalTo

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

func (*Comment) ProtoMessage

func (*Comment) ProtoMessage()

func (*Comment) Reset

func (m *Comment) Reset()

func (*Comment) SetID

func (m *Comment) SetID(id []byte) error

SetID is a minimal implementation, useful when the ID is a separate protobuf field

func (*Comment) Size

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

func (*Comment) String

func (m *Comment) String() string

func (*Comment) Unmarshal

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

func (*Comment) Validate

func (m *Comment) Validate() error

Validate validates comment's fields

func (*Comment) XXX_DiscardUnknown

func (m *Comment) XXX_DiscardUnknown()

func (*Comment) XXX_Marshal

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

func (*Comment) XXX_Merge

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

func (*Comment) XXX_Size

func (m *Comment) XXX_Size() int

func (*Comment) XXX_Unmarshal

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

type CommentBucket

type CommentBucket struct {
	morm.ModelBucket
}

func NewCommentBucket

func NewCommentBucket() *CommentBucket

NewCommentBucket returns a new comment bucket

type CreateArticleHandler

type CreateArticleHandler struct {
	// contains filtered or unexported fields
}

CreateArticleHandler will handle CreateArticleMsg

func (CreateArticleHandler) Check

Check just verifies it is properly formed and returns the cost of executing it.

func (CreateArticleHandler) Deliver

Deliver creates an custom state and saves if all preconditions are met

type CreateArticleMsg

type CreateArticleMsg struct {
	Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// BlogID identifies blog that article is posted to
	BlogID []byte `protobuf:"bytes,2,opt,name=blog_id,json=blogId,proto3" json:"blog_id,omitempty"`
	// Title is title of the article
	Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
	// Content is content of the blog
	Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"`
	// DeleteAt defines deletion time of the article.
	// Could be nil if there is not a time of deletion, or in future
	DeleteAt github_com_iov_one_weave.UnixTime `` /* 129-byte string literal not displayed */
}

func (*CreateArticleMsg) Descriptor

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

func (*CreateArticleMsg) GetBlogID

func (m *CreateArticleMsg) GetBlogID() []byte

func (*CreateArticleMsg) GetContent

func (m *CreateArticleMsg) GetContent() string

func (*CreateArticleMsg) GetDeleteAt

func (*CreateArticleMsg) GetMetadata

func (m *CreateArticleMsg) GetMetadata() *weave.Metadata

func (*CreateArticleMsg) GetTitle

func (m *CreateArticleMsg) GetTitle() string

func (*CreateArticleMsg) Marshal

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

func (*CreateArticleMsg) MarshalTo

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

func (CreateArticleMsg) Path

func (CreateArticleMsg) Path() string

Path returns the routing path for this message.

func (*CreateArticleMsg) ProtoMessage

func (*CreateArticleMsg) ProtoMessage()

func (*CreateArticleMsg) Reset

func (m *CreateArticleMsg) Reset()

func (*CreateArticleMsg) Size

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

func (*CreateArticleMsg) String

func (m *CreateArticleMsg) String() string

func (*CreateArticleMsg) Unmarshal

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

func (CreateArticleMsg) Validate

func (m CreateArticleMsg) Validate() error

Validate ensures the CreateArticleMsg is valid

func (*CreateArticleMsg) XXX_DiscardUnknown

func (m *CreateArticleMsg) XXX_DiscardUnknown()

func (*CreateArticleMsg) XXX_Marshal

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

func (*CreateArticleMsg) XXX_Merge

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

func (*CreateArticleMsg) XXX_Size

func (m *CreateArticleMsg) XXX_Size() int

func (*CreateArticleMsg) XXX_Unmarshal

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

type CreateBlogHandler

type CreateBlogHandler struct {
	// contains filtered or unexported fields
}

CreateBlogHandler will handle CreateBlogMsg

func (CreateBlogHandler) Check

func (h CreateBlogHandler) Check(ctx weave.Context, store weave.KVStore, tx weave.Tx) (*weave.CheckResult, error)

Check just verifies it is properly formed and returns the cost of executing it.

func (CreateBlogHandler) Deliver

func (h CreateBlogHandler) Deliver(ctx weave.Context, store weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error)

Deliver creates an custom state and saves if all preconditions are met

type CreateBlogMsg

type CreateBlogMsg struct {
	Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// Title is title of the blog
	Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
	// Description is description section of the blog
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
}

func (*CreateBlogMsg) Descriptor

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

func (*CreateBlogMsg) GetDescription

func (m *CreateBlogMsg) GetDescription() string

func (*CreateBlogMsg) GetMetadata

func (m *CreateBlogMsg) GetMetadata() *weave.Metadata

func (*CreateBlogMsg) GetTitle

func (m *CreateBlogMsg) GetTitle() string

func (*CreateBlogMsg) Marshal

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

func (*CreateBlogMsg) MarshalTo

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

func (CreateBlogMsg) Path

func (CreateBlogMsg) Path() string

Path returns the routing path for this message.

func (*CreateBlogMsg) ProtoMessage

func (*CreateBlogMsg) ProtoMessage()

func (*CreateBlogMsg) Reset

func (m *CreateBlogMsg) Reset()

func (*CreateBlogMsg) Size

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

func (*CreateBlogMsg) String

func (m *CreateBlogMsg) String() string

func (*CreateBlogMsg) Unmarshal

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

func (CreateBlogMsg) Validate

func (m CreateBlogMsg) Validate() error

Validate ensures the CreateBlogMsg is valid

func (*CreateBlogMsg) XXX_DiscardUnknown

func (m *CreateBlogMsg) XXX_DiscardUnknown()

func (*CreateBlogMsg) XXX_Marshal

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

func (*CreateBlogMsg) XXX_Merge

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

func (*CreateBlogMsg) XXX_Size

func (m *CreateBlogMsg) XXX_Size() int

func (*CreateBlogMsg) XXX_Unmarshal

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

type CreateCommentHandler

type CreateCommentHandler struct {
	// contains filtered or unexported fields
}

CreateCommentHandler will handle CreateCommentMsg

func (CreateCommentHandler) Check

Check just verifies it is properly formed and returns the cost of executing it.

func (CreateCommentHandler) Deliver

Deliver creates a comment and saves if all preconditions are met

type CreateCommentMsg

type CreateCommentMsg struct {
	Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// ArticleID is the identifier of the article that is desired to be commented
	ArticleID []byte `protobuf:"bytes,2,opt,name=article_id,json=articleId,proto3" json:"article_id,omitempty"`
	// Content is the comment's content
	Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
}

func (*CreateCommentMsg) Descriptor

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

func (*CreateCommentMsg) GetArticleID

func (m *CreateCommentMsg) GetArticleID() []byte

func (*CreateCommentMsg) GetContent

func (m *CreateCommentMsg) GetContent() string

func (*CreateCommentMsg) GetMetadata

func (m *CreateCommentMsg) GetMetadata() *weave.Metadata

func (*CreateCommentMsg) Marshal

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

func (*CreateCommentMsg) MarshalTo

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

func (CreateCommentMsg) Path

func (CreateCommentMsg) Path() string

Path returns the routing path for this message.

func (*CreateCommentMsg) ProtoMessage

func (*CreateCommentMsg) ProtoMessage()

func (*CreateCommentMsg) Reset

func (m *CreateCommentMsg) Reset()

func (*CreateCommentMsg) Size

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

func (*CreateCommentMsg) String

func (m *CreateCommentMsg) String() string

func (*CreateCommentMsg) Unmarshal

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

func (CreateCommentMsg) Validate

func (m CreateCommentMsg) Validate() error

Validate ensures the CreateCommentMsg is valid

func (*CreateCommentMsg) XXX_DiscardUnknown

func (m *CreateCommentMsg) XXX_DiscardUnknown()

func (*CreateCommentMsg) XXX_Marshal

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

func (*CreateCommentMsg) XXX_Merge

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

func (*CreateCommentMsg) XXX_Size

func (m *CreateCommentMsg) XXX_Size() int

func (*CreateCommentMsg) XXX_Unmarshal

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

type CreateLikeHandler

type CreateLikeHandler struct {
	// contains filtered or unexported fields
}

CreateLikeHander will handle CreateLikeMsg

func (CreateLikeHandler) Check

func (h CreateLikeHandler) Check(ctx weave.Context, store weave.KVStore, tx weave.Tx) (*weave.CheckResult, error)

Check just verifies it is properly formed and returns the cost of executing it.

func (CreateLikeHandler) Deliver

func (h CreateLikeHandler) Deliver(ctx weave.Context, store weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error)

Deliver creates a like and saves if all preconditions are met

type CreateLikeMsg

type CreateLikeMsg struct {
	Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// ArticleID is the identifier of the article that is desired to be liked
	ArticleID []byte `protobuf:"bytes,2,opt,name=article_id,json=articleId,proto3" json:"article_id,omitempty"`
}

func (*CreateLikeMsg) Descriptor

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

func (*CreateLikeMsg) GetArticleID

func (m *CreateLikeMsg) GetArticleID() []byte

func (*CreateLikeMsg) GetMetadata

func (m *CreateLikeMsg) GetMetadata() *weave.Metadata

func (*CreateLikeMsg) Marshal

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

func (*CreateLikeMsg) MarshalTo

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

func (CreateLikeMsg) Path

func (CreateLikeMsg) Path() string

Path returns the routing path for this message.

func (*CreateLikeMsg) ProtoMessage

func (*CreateLikeMsg) ProtoMessage()

func (*CreateLikeMsg) Reset

func (m *CreateLikeMsg) Reset()

func (*CreateLikeMsg) Size

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

func (*CreateLikeMsg) String

func (m *CreateLikeMsg) String() string

func (*CreateLikeMsg) Unmarshal

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

func (CreateLikeMsg) Validate

func (m CreateLikeMsg) Validate() error

Validate ensures the CreateLikeMsg is valid

func (*CreateLikeMsg) XXX_DiscardUnknown

func (m *CreateLikeMsg) XXX_DiscardUnknown()

func (*CreateLikeMsg) XXX_Marshal

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

func (*CreateLikeMsg) XXX_Merge

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

func (*CreateLikeMsg) XXX_Size

func (m *CreateLikeMsg) XXX_Size() int

func (*CreateLikeMsg) XXX_Unmarshal

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

type CreateUserHandler

type CreateUserHandler struct {
	// contains filtered or unexported fields
}

CreateUserHandler will handle CreateUserMsg

func (CreateUserHandler) Check

func (h CreateUserHandler) Check(ctx weave.Context, store weave.KVStore, tx weave.Tx) (*weave.CheckResult, error)

Check just verifies it is properly formed and returns the cost of executing it.

func (CreateUserHandler) Deliver

func (h CreateUserHandler) Deliver(ctx weave.Context, store weave.KVStore, tx weave.Tx) (*weave.DeliverResult, error)

Deliver creates an custom state and saves if all preconditions are met

type CreateUserMsg

type CreateUserMsg struct {
	Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// Username is user's alias
	Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	// Bio is user information
	Bio string `protobuf:"bytes,3,opt,name=bio,proto3" json:"bio,omitempty"`
}

func (*CreateUserMsg) Descriptor

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

func (*CreateUserMsg) GetBio

func (m *CreateUserMsg) GetBio() string

func (*CreateUserMsg) GetMetadata

func (m *CreateUserMsg) GetMetadata() *weave.Metadata

func (*CreateUserMsg) GetUsername

func (m *CreateUserMsg) GetUsername() string

func (*CreateUserMsg) Marshal

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

func (*CreateUserMsg) MarshalTo

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

func (CreateUserMsg) Path

func (CreateUserMsg) Path() string

Path returns the routing path for this message.

func (*CreateUserMsg) ProtoMessage

func (*CreateUserMsg) ProtoMessage()

func (*CreateUserMsg) Reset

func (m *CreateUserMsg) Reset()

func (*CreateUserMsg) Size

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

func (*CreateUserMsg) String

func (m *CreateUserMsg) String() string

func (*CreateUserMsg) Unmarshal

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

func (CreateUserMsg) Validate

func (m CreateUserMsg) Validate() error

Validate ensures the CreateUserMsg is valid

func (*CreateUserMsg) XXX_DiscardUnknown

func (m *CreateUserMsg) XXX_DiscardUnknown()

func (*CreateUserMsg) XXX_Marshal

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

func (*CreateUserMsg) XXX_Merge

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

func (*CreateUserMsg) XXX_Size

func (m *CreateUserMsg) XXX_Size() int

func (*CreateUserMsg) XXX_Unmarshal

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

type CronDeleteArticleHandler

type CronDeleteArticleHandler struct {
	// contains filtered or unexported fields
}

CronDeleteArticleHandler will handle scheduled DeleteArticleMsg

func (CronDeleteArticleHandler) Check

Check just verifies it is properly formed and returns the cost of executing it.

func (CronDeleteArticleHandler) Deliver

Deliver stages a scheduled deletion if all preconditions are met

type DeleteArticleHandler

type DeleteArticleHandler struct {
	// contains filtered or unexported fields
}

DeleteArticleHandler will handle DeleteArticleMsg

func (DeleteArticleHandler) Check

Check just verifies it is properly formed and returns the cost of executing it.

func (DeleteArticleHandler) Deliver

Deliver creates an custom state and saves if all preconditions are met

type DeleteArticleMsg

type DeleteArticleMsg struct {
	Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// ArticleID is the identifier of the article that is desired to be deleted
	ArticleID []byte `protobuf:"bytes,2,opt,name=article_id,json=articleId,proto3" json:"article_id,omitempty"`
}

DeleteArticleMsg message deletes the the article instantly

func (*DeleteArticleMsg) Descriptor

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

func (*DeleteArticleMsg) GetArticleID

func (m *DeleteArticleMsg) GetArticleID() []byte

func (*DeleteArticleMsg) GetMetadata

func (m *DeleteArticleMsg) GetMetadata() *weave.Metadata

func (*DeleteArticleMsg) Marshal

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

func (*DeleteArticleMsg) MarshalTo

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

func (DeleteArticleMsg) Path

func (DeleteArticleMsg) Path() string

Path returns the routing path for this message.

func (*DeleteArticleMsg) ProtoMessage

func (*DeleteArticleMsg) ProtoMessage()

func (*DeleteArticleMsg) Reset

func (m *DeleteArticleMsg) Reset()

func (*DeleteArticleMsg) Size

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

func (*DeleteArticleMsg) String

func (m *DeleteArticleMsg) String() string

func (*DeleteArticleMsg) Unmarshal

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

func (DeleteArticleMsg) Validate

func (m DeleteArticleMsg) Validate() error

Validate ensures the DeleteArticle is valid

func (*DeleteArticleMsg) XXX_DiscardUnknown

func (m *DeleteArticleMsg) XXX_DiscardUnknown()

func (*DeleteArticleMsg) XXX_Marshal

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

func (*DeleteArticleMsg) XXX_Merge

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

func (*DeleteArticleMsg) XXX_Size

func (m *DeleteArticleMsg) XXX_Size() int

func (*DeleteArticleMsg) XXX_Unmarshal

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

type DeleteArticleTask

type DeleteArticleTask struct {
	Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// TaskID is the unique identifier of the task
	ID []byte `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	// ArticleID is the id of the article that will be deleted
	ArticleID []byte `protobuf:"bytes,3,opt,name=article_id,json=articleId,proto3" json:"article_id,omitempty"`
	// TaskOwner is the creator of the task
	TaskOwner github_com_iov_one_weave.Address `` /* 130-byte string literal not displayed */
}

DeleteArticleTask is used for representing scheduled task id. Used when deleting the task

func (*DeleteArticleTask) Copy

Copy produces a new copy to fulfill the Model interface

func (*DeleteArticleTask) Descriptor

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

func (*DeleteArticleTask) GetArticleID

func (m *DeleteArticleTask) GetArticleID() []byte

func (*DeleteArticleTask) GetID

func (m *DeleteArticleTask) GetID() []byte

func (*DeleteArticleTask) GetMetadata

func (m *DeleteArticleTask) GetMetadata() *weave.Metadata

func (*DeleteArticleTask) GetTaskOwner

func (*DeleteArticleTask) Marshal

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

func (*DeleteArticleTask) MarshalTo

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

func (*DeleteArticleTask) ProtoMessage

func (*DeleteArticleTask) ProtoMessage()

func (*DeleteArticleTask) Reset

func (m *DeleteArticleTask) Reset()

func (*DeleteArticleTask) SetID

func (m *DeleteArticleTask) SetID(id []byte) error

SetID is a minimal implementation, useful when the ID is a separate protobuf field

func (*DeleteArticleTask) Size

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

func (*DeleteArticleTask) String

func (m *DeleteArticleTask) String() string

func (*DeleteArticleTask) Unmarshal

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

func (*DeleteArticleTask) Validate

func (m *DeleteArticleTask) Validate() error

Validate validates user's fields

func (*DeleteArticleTask) XXX_DiscardUnknown

func (m *DeleteArticleTask) XXX_DiscardUnknown()

func (*DeleteArticleTask) XXX_Marshal

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

func (*DeleteArticleTask) XXX_Merge

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

func (*DeleteArticleTask) XXX_Size

func (m *DeleteArticleTask) XXX_Size() int

func (*DeleteArticleTask) XXX_Unmarshal

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

type DeleteArticleTaskBucket

type DeleteArticleTaskBucket struct {
	morm.ModelBucket
}

func NewDeleteArticleTaskBucket

func NewDeleteArticleTaskBucket() *DeleteArticleTaskBucket

NewDeleteArticleTaskBucket returns a new delete article task bucket

type Like

type Like struct {
	Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// ID is like's identifier
	ID []byte `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	// ArticleID identifies article that like is posted to
	ArticleID []byte `protobuf:"bytes,3,opt,name=article_id,json=articleId,proto3" json:"article_id,omitempty"`
	// Owner is the owner address of the like
	Owner github_com_iov_one_weave.Address `protobuf:"bytes,4,opt,name=owner,proto3,casttype=github.com/iov-one/weave.Address" json:"owner,omitempty"`
	// CreatedAt defines creation time of the like
	CreatedAt github_com_iov_one_weave.UnixTime `` /* 132-byte string literal not displayed */
}

func (*Like) Copy

func (m *Like) Copy() orm.CloneableData

Copy produces a new copy to fulfill the Model interface TODO remove after weave 0.22.0 is released

func (*Like) Descriptor

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

func (*Like) GetArticleID

func (m *Like) GetArticleID() []byte

func (*Like) GetCreatedAt

func (m *Like) GetCreatedAt() github_com_iov_one_weave.UnixTime

func (*Like) GetID

func (m *Like) GetID() []byte

func (*Like) GetMetadata

func (m *Like) GetMetadata() *weave.Metadata

func (*Like) GetOwner

func (m *Like) GetOwner() github_com_iov_one_weave.Address

func (*Like) Marshal

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

func (*Like) MarshalTo

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

func (*Like) ProtoMessage

func (*Like) ProtoMessage()

func (*Like) Reset

func (m *Like) Reset()

func (*Like) SetID

func (m *Like) SetID(id []byte) error

SetID is a minimal implementation, useful when the ID is a separate protobuf field

func (*Like) Size

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

func (*Like) String

func (m *Like) String() string

func (*Like) Unmarshal

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

func (*Like) Validate

func (m *Like) Validate() error

Validate validates like's fields

func (*Like) XXX_DiscardUnknown

func (m *Like) XXX_DiscardUnknown()

func (*Like) XXX_Marshal

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

func (*Like) XXX_Merge

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

func (*Like) XXX_Size

func (m *Like) XXX_Size() int

func (*Like) XXX_Unmarshal

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

type LikeBucket

type LikeBucket struct {
	morm.ModelBucket
}

func NewLikeBucket

func NewLikeBucket() *LikeBucket

NewLikeBucket returns a new like bucket

type User

type User struct {
	Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// ID is users identifier
	ID []byte `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	// Username is user's alias
	Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"`
	// Bio is user information
	Bio string `protobuf:"bytes,4,opt,name=bio,proto3" json:"bio,omitempty"`
	// RegisteredAt defines registration time of the user
	RegisteredAt github_com_iov_one_weave.UnixTime `` /* 141-byte string literal not displayed */
}

func (*User) Copy

func (m *User) Copy() orm.CloneableData

Copy produces a new copy to fulfill the Model interface

func (*User) Descriptor

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

func (*User) GetBio

func (m *User) GetBio() string

func (*User) GetID

func (m *User) GetID() []byte

func (*User) GetMetadata

func (m *User) GetMetadata() *weave.Metadata

func (*User) GetRegisteredAt

func (m *User) GetRegisteredAt() github_com_iov_one_weave.UnixTime

func (*User) GetUsername

func (m *User) GetUsername() string

func (*User) Marshal

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

func (*User) MarshalTo

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

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) SetID

func (m *User) SetID(id []byte) error

SetID is a minimal implementation, useful when the ID is a separate protobuf field

func (*User) Size

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

func (*User) String

func (m *User) String() string

func (*User) Unmarshal

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

func (*User) Validate

func (m *User) Validate() error

Validate validates user's fields

func (*User) XXX_DiscardUnknown

func (m *User) XXX_DiscardUnknown()

func (*User) XXX_Marshal

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

func (*User) XXX_Merge

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

func (*User) XXX_Size

func (m *User) XXX_Size() int

func (*User) XXX_Unmarshal

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

type UserBucket

type UserBucket struct {
	morm.ModelBucket
}

func NewUserBucket

func NewUserBucket() *UserBucket

NewUserBucket returns a new user bucket

Jump to

Keyboard shortcuts

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