Documentation ¶
Overview ¶
Package blog is a generated protocol buffer package.
It is generated from these files:
x/blog/messages.proto x/blog/state.proto
It has these top-level messages:
CreateBlogMsg RenameBlogMsg ChangeBlogAuthorsMsg CreatePostMsg SetProfileMsg Blog Post Profile
Index ¶
- Constants
- Variables
- func RegisterQuery(qr weave.QueryRouter)
- func RegisterRoutes(r weave.Registry, auth x.Authenticator)
- type Blog
- func (b *Blog) Copy() orm.CloneableData
- func (*Blog) Descriptor() ([]byte, []int)
- func (m *Blog) GetAuthors() [][]byte
- func (m *Blog) GetNumArticles() int64
- func (m *Blog) GetTitle() string
- func (m *Blog) Marshal() (dAtA []byte, err error)
- func (m *Blog) MarshalTo(dAtA []byte) (int, error)
- func (*Blog) ProtoMessage()
- func (m *Blog) Reset()
- func (m *Blog) Size() (n int)
- func (m *Blog) String() string
- func (m *Blog) Unmarshal(dAtA []byte) error
- func (b *Blog) Validate() error
- type BlogBucket
- type ChangeBlogAuthorsMsg
- func (*ChangeBlogAuthorsMsg) Descriptor() ([]byte, []int)
- func (m *ChangeBlogAuthorsMsg) GetAdd() bool
- func (m *ChangeBlogAuthorsMsg) GetAuthor() []byte
- func (m *ChangeBlogAuthorsMsg) GetSlug() string
- func (m *ChangeBlogAuthorsMsg) Marshal() (dAtA []byte, err error)
- func (m *ChangeBlogAuthorsMsg) MarshalTo(dAtA []byte) (int, error)
- func (ChangeBlogAuthorsMsg) Path() string
- func (*ChangeBlogAuthorsMsg) ProtoMessage()
- func (m *ChangeBlogAuthorsMsg) Reset()
- func (m *ChangeBlogAuthorsMsg) Size() (n int)
- func (m *ChangeBlogAuthorsMsg) String() string
- func (m *ChangeBlogAuthorsMsg) Unmarshal(dAtA []byte) error
- func (s *ChangeBlogAuthorsMsg) Validate() error
- type ChangeBlogAuthorsMsgHandler
- type CreateBlogMsg
- func (*CreateBlogMsg) Descriptor() ([]byte, []int)
- func (m *CreateBlogMsg) GetAuthors() [][]byte
- func (m *CreateBlogMsg) GetSlug() string
- func (m *CreateBlogMsg) GetTitle() string
- func (m *CreateBlogMsg) Marshal() (dAtA []byte, err error)
- func (m *CreateBlogMsg) MarshalTo(dAtA []byte) (int, error)
- func (CreateBlogMsg) Path() string
- func (*CreateBlogMsg) ProtoMessage()
- func (m *CreateBlogMsg) Reset()
- func (m *CreateBlogMsg) Size() (n int)
- func (m *CreateBlogMsg) String() string
- func (m *CreateBlogMsg) Unmarshal(dAtA []byte) error
- func (s *CreateBlogMsg) Validate() error
- type CreateBlogMsgHandler
- type CreatePostMsg
- func (*CreatePostMsg) Descriptor() ([]byte, []int)
- func (m *CreatePostMsg) GetAuthor() []byte
- func (m *CreatePostMsg) GetBlog() string
- func (m *CreatePostMsg) GetText() string
- func (m *CreatePostMsg) GetTitle() string
- func (m *CreatePostMsg) Marshal() (dAtA []byte, err error)
- func (m *CreatePostMsg) MarshalTo(dAtA []byte) (int, error)
- func (CreatePostMsg) Path() string
- func (*CreatePostMsg) ProtoMessage()
- func (m *CreatePostMsg) Reset()
- func (m *CreatePostMsg) Size() (n int)
- func (m *CreatePostMsg) String() string
- func (m *CreatePostMsg) Unmarshal(dAtA []byte) error
- func (s *CreatePostMsg) Validate() error
- type CreatePostMsgHandler
- type Post
- func (p *Post) Copy() orm.CloneableData
- func (*Post) Descriptor() ([]byte, []int)
- func (m *Post) GetAuthor() []byte
- func (m *Post) GetCreationBlock() int64
- func (m *Post) GetText() string
- func (m *Post) GetTitle() string
- func (m *Post) Marshal() (dAtA []byte, err error)
- func (m *Post) MarshalTo(dAtA []byte) (int, error)
- func (*Post) ProtoMessage()
- func (m *Post) Reset()
- func (m *Post) Size() (n int)
- func (m *Post) String() string
- func (m *Post) Unmarshal(dAtA []byte) error
- func (p *Post) Validate() error
- type PostBucket
- type Profile
- func (p *Profile) Copy() orm.CloneableData
- func (*Profile) Descriptor() ([]byte, []int)
- func (m *Profile) GetDescription() string
- func (m *Profile) GetName() string
- func (m *Profile) Marshal() (dAtA []byte, err error)
- func (m *Profile) MarshalTo(dAtA []byte) (int, error)
- func (*Profile) ProtoMessage()
- func (m *Profile) Reset()
- func (m *Profile) Size() (n int)
- func (m *Profile) String() string
- func (m *Profile) Unmarshal(dAtA []byte) error
- func (p *Profile) Validate() error
- type ProfileBucket
- type RenameBlogMsg
- func (*RenameBlogMsg) Descriptor() ([]byte, []int)
- func (m *RenameBlogMsg) GetSlug() string
- func (m *RenameBlogMsg) GetTitle() string
- func (m *RenameBlogMsg) Marshal() (dAtA []byte, err error)
- func (m *RenameBlogMsg) MarshalTo(dAtA []byte) (int, error)
- func (RenameBlogMsg) Path() string
- func (*RenameBlogMsg) ProtoMessage()
- func (m *RenameBlogMsg) Reset()
- func (m *RenameBlogMsg) Size() (n int)
- func (m *RenameBlogMsg) String() string
- func (m *RenameBlogMsg) Unmarshal(dAtA []byte) error
- func (s *RenameBlogMsg) Validate() error
- type RenameBlogMsgHandler
- type SetProfileMsg
- func (*SetProfileMsg) Descriptor() ([]byte, []int)
- func (m *SetProfileMsg) GetAuthor() []byte
- func (m *SetProfileMsg) GetDescription() string
- func (m *SetProfileMsg) GetName() string
- func (m *SetProfileMsg) Marshal() (dAtA []byte, err error)
- func (m *SetProfileMsg) MarshalTo(dAtA []byte) (int, error)
- func (SetProfileMsg) Path() string
- func (*SetProfileMsg) ProtoMessage()
- func (m *SetProfileMsg) Reset()
- func (m *SetProfileMsg) Size() (n int)
- func (m *SetProfileMsg) String() string
- func (m *SetProfileMsg) Unmarshal(dAtA []byte) error
- func (s *SetProfileMsg) Validate() error
- type SetProfileMsgHandler
Constants ¶
const ( PathCreateBlogMsg = "blog/create" PathRenameBlogMsg = "blog/rename" PathChangeBlogAuthorsMsg = "blog/authors" PathCreatePostMsg = "blog/post" PathSetProfileMsg = "blog/profile" MinAuthors = 1 MaxAuthors = 10 MinTitleLength = 8 MaxTitleLength = 100 MinTextLength = 200 MaxTextLength = 20 * 1000 MinNameLength = 6 MaxNameLength = 30 MaxDescriptionLength = 280 )
const BlogBucketName = "blogs"
const PostBucketName = "posts"
const ProfileBucketName = "profiles"
Variables ¶
var ( ErrInvalidLengthMessages = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowMessages = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthState = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowState = fmt.Errorf("proto: integer overflow") )
var ( // IsValidName is the RegExp to ensure valid profile and blog names IsValidName = regexp.MustCompile(`^[a-zA-Z0-9_\-\.]{6,30}$`).MatchString )
Functions ¶
func RegisterQuery ¶ added in v0.8.0
func RegisterQuery(qr weave.QueryRouter)
RegisterQuery register queries from buckets in this package
func RegisterRoutes ¶ added in v0.7.0
func RegisterRoutes(r weave.Registry, auth x.Authenticator)
RegisterRoutes will instantiate and register all handlers in this package
Types ¶
type Blog ¶
type Blog struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` // Author bytes to be interpreted as weave.Address Authors [][]byte `protobuf:"bytes,2,rep,name=authors" json:"authors,omitempty"` NumArticles int64 `protobuf:"varint,3,opt,name=num_articles,json=numArticles,proto3" json:"num_articles,omitempty"` }
func (*Blog) Copy ¶
func (b *Blog) Copy() orm.CloneableData
Copy makes a new blog with the same data
func (*Blog) Descriptor ¶
func (*Blog) GetAuthors ¶
func (*Blog) GetNumArticles ¶
func (*Blog) ProtoMessage ¶
func (*Blog) ProtoMessage()
type BlogBucket ¶
BlogBucket is a type-safe wrapper around orm.Bucket
func NewBlogBucket ¶
func NewBlogBucket() BlogBucket
NewBlogBucket initializes a BlogBucket with default name
inherit Get and Save from orm.Bucket add run-time check on Save
type ChangeBlogAuthorsMsg ¶
type ChangeBlogAuthorsMsg struct { // slug is a short, unique string used as primary key Slug string `protobuf:"bytes,1,opt,name=slug,proto3" json:"slug,omitempty"` // whether we add or remove them Add bool `protobuf:"varint,2,opt,name=add,proto3" json:"add,omitempty"` // author to add or remove Author []byte `protobuf:"bytes,3,opt,name=author,proto3" json:"author,omitempty"` }
ChangeBlogAuthorsMsg adds or removes an author from the blog's authorized author list
func (*ChangeBlogAuthorsMsg) Descriptor ¶
func (*ChangeBlogAuthorsMsg) Descriptor() ([]byte, []int)
func (*ChangeBlogAuthorsMsg) GetAdd ¶
func (m *ChangeBlogAuthorsMsg) GetAdd() bool
func (*ChangeBlogAuthorsMsg) GetAuthor ¶
func (m *ChangeBlogAuthorsMsg) GetAuthor() []byte
func (*ChangeBlogAuthorsMsg) GetSlug ¶ added in v0.7.0
func (m *ChangeBlogAuthorsMsg) GetSlug() string
func (*ChangeBlogAuthorsMsg) Marshal ¶
func (m *ChangeBlogAuthorsMsg) Marshal() (dAtA []byte, err error)
func (*ChangeBlogAuthorsMsg) MarshalTo ¶
func (m *ChangeBlogAuthorsMsg) MarshalTo(dAtA []byte) (int, error)
func (ChangeBlogAuthorsMsg) Path ¶
func (ChangeBlogAuthorsMsg) Path() string
Path returns the routing path for this message
func (*ChangeBlogAuthorsMsg) ProtoMessage ¶
func (*ChangeBlogAuthorsMsg) ProtoMessage()
func (*ChangeBlogAuthorsMsg) Reset ¶
func (m *ChangeBlogAuthorsMsg) Reset()
func (*ChangeBlogAuthorsMsg) Size ¶
func (m *ChangeBlogAuthorsMsg) Size() (n int)
func (*ChangeBlogAuthorsMsg) String ¶
func (m *ChangeBlogAuthorsMsg) String() string
func (*ChangeBlogAuthorsMsg) Unmarshal ¶
func (m *ChangeBlogAuthorsMsg) Unmarshal(dAtA []byte) error
func (*ChangeBlogAuthorsMsg) Validate ¶
func (s *ChangeBlogAuthorsMsg) Validate() error
Validate makes sure that this is sensible
type ChangeBlogAuthorsMsgHandler ¶ added in v0.7.0
type ChangeBlogAuthorsMsgHandler struct {
// contains filtered or unexported fields
}
type CreateBlogMsg ¶
type CreateBlogMsg struct { // slug is a short, unique string used as primary key Slug string `protobuf:"bytes,1,opt,name=slug,proto3" json:"slug,omitempty"` // title is longer text used for display Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` // initial set of authors (must be 1 - MaxAuthors) Authors [][]byte `protobuf:"bytes,3,rep,name=authors" json:"authors,omitempty"` }
CreateBlogMsg starts a new blog with a set of authors
func (*CreateBlogMsg) Descriptor ¶
func (*CreateBlogMsg) Descriptor() ([]byte, []int)
func (*CreateBlogMsg) GetAuthors ¶
func (m *CreateBlogMsg) GetAuthors() [][]byte
func (*CreateBlogMsg) GetSlug ¶
func (m *CreateBlogMsg) GetSlug() string
func (*CreateBlogMsg) GetTitle ¶
func (m *CreateBlogMsg) GetTitle() string
func (*CreateBlogMsg) Marshal ¶
func (m *CreateBlogMsg) Marshal() (dAtA []byte, err 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 (s *CreateBlogMsg) Validate() error
Validate makes sure that this is sensible
type CreateBlogMsgHandler ¶ added in v0.7.0
type CreateBlogMsgHandler struct {
// contains filtered or unexported fields
}
type CreatePostMsg ¶
type CreatePostMsg struct { // blog is the slug of the blog this post belongs to Blog string `protobuf:"bytes,1,opt,name=blog,proto3" json:"blog,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` Text string `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"` // author is optional, by default the first signer, // only needed if it is multisig Author []byte `protobuf:"bytes,4,opt,name=author,proto3" json:"author,omitempty"` }
CreatePostMsg adds a post to a blog
func (*CreatePostMsg) Descriptor ¶
func (*CreatePostMsg) Descriptor() ([]byte, []int)
func (*CreatePostMsg) GetAuthor ¶
func (m *CreatePostMsg) GetAuthor() []byte
func (*CreatePostMsg) GetBlog ¶
func (m *CreatePostMsg) GetBlog() string
func (*CreatePostMsg) GetText ¶
func (m *CreatePostMsg) GetText() string
func (*CreatePostMsg) GetTitle ¶
func (m *CreatePostMsg) GetTitle() string
func (*CreatePostMsg) Marshal ¶
func (m *CreatePostMsg) Marshal() (dAtA []byte, err error)
func (CreatePostMsg) Path ¶
func (CreatePostMsg) Path() string
Path returns the routing path for this message
func (*CreatePostMsg) ProtoMessage ¶
func (*CreatePostMsg) ProtoMessage()
func (*CreatePostMsg) Reset ¶
func (m *CreatePostMsg) Reset()
func (*CreatePostMsg) Size ¶
func (m *CreatePostMsg) Size() (n int)
func (*CreatePostMsg) String ¶
func (m *CreatePostMsg) String() string
func (*CreatePostMsg) Unmarshal ¶
func (m *CreatePostMsg) Unmarshal(dAtA []byte) error
func (*CreatePostMsg) Validate ¶
func (s *CreatePostMsg) Validate() error
Validate makes sure that this is sensible
type CreatePostMsgHandler ¶ added in v0.7.0
type CreatePostMsgHandler struct {
// contains filtered or unexported fields
}
type Post ¶
type Post struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` Author []byte `protobuf:"bytes,2,opt,name=author,proto3" json:"author,omitempty"` // a timestamp would differ between nodes and be // non-deterministic when replaying blocks. // block height is the only constant CreationBlock int64 `protobuf:"varint,3,opt,name=creation_block,json=creationBlock,proto3" json:"creation_block,omitempty"` Text string `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"` }
func (*Post) Copy ¶
func (p *Post) Copy() orm.CloneableData
Copy makes a new Post with the same data
func (*Post) Descriptor ¶
func (*Post) GetCreationBlock ¶
func (*Post) ProtoMessage ¶
func (*Post) ProtoMessage()
type PostBucket ¶
PostBucket is a type-safe wrapper around orm.Bucket
func NewPostBucket ¶
func NewPostBucket() PostBucket
NewPostBucket initializes a PostBucket with default name
inherit Get and Save from orm.Bucket add run-time check on Save
type Profile ¶
type Profile struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` }
func (*Profile) Copy ¶
func (p *Profile) Copy() orm.CloneableData
Copy makes a new Profile with the same data
func (*Profile) Descriptor ¶
func (*Profile) GetDescription ¶
func (*Profile) ProtoMessage ¶
func (*Profile) ProtoMessage()
type ProfileBucket ¶
ProfileBucket is a type-safe wrapper around orm.Bucket
func NewProfileBucket ¶
func NewProfileBucket() ProfileBucket
NewProfileBucket initializes a ProfileBucket with default name
inherit Get and Save from orm.Bucket add run-time check on Save
type RenameBlogMsg ¶
type RenameBlogMsg struct { // slug is a short, unique string used as primary key Slug string `protobuf:"bytes,1,opt,name=slug,proto3" json:"slug,omitempty"` // title is longer text used for display Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` }
RenameBlogMsg updates the title of an existing blog
func (*RenameBlogMsg) Descriptor ¶
func (*RenameBlogMsg) Descriptor() ([]byte, []int)
func (*RenameBlogMsg) GetSlug ¶
func (m *RenameBlogMsg) GetSlug() string
func (*RenameBlogMsg) GetTitle ¶
func (m *RenameBlogMsg) GetTitle() string
func (*RenameBlogMsg) Marshal ¶
func (m *RenameBlogMsg) Marshal() (dAtA []byte, err error)
func (RenameBlogMsg) Path ¶
func (RenameBlogMsg) Path() string
Path returns the routing path for this message
func (*RenameBlogMsg) ProtoMessage ¶
func (*RenameBlogMsg) ProtoMessage()
func (*RenameBlogMsg) Reset ¶
func (m *RenameBlogMsg) Reset()
func (*RenameBlogMsg) Size ¶
func (m *RenameBlogMsg) Size() (n int)
func (*RenameBlogMsg) String ¶
func (m *RenameBlogMsg) String() string
func (*RenameBlogMsg) Unmarshal ¶
func (m *RenameBlogMsg) Unmarshal(dAtA []byte) error
func (*RenameBlogMsg) Validate ¶
func (s *RenameBlogMsg) Validate() error
Validate makes sure that this is sensible
type RenameBlogMsgHandler ¶ added in v0.7.0
type RenameBlogMsgHandler struct {
// contains filtered or unexported fields
}
type SetProfileMsg ¶
type SetProfileMsg struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` // author is optional, by default the first signer, // only needed if it is multisig Author []byte `protobuf:"bytes,3,opt,name=author,proto3" json:"author,omitempty"` }
SetProfileMsg will create or update a profile
func (*SetProfileMsg) Descriptor ¶
func (*SetProfileMsg) Descriptor() ([]byte, []int)
func (*SetProfileMsg) GetAuthor ¶
func (m *SetProfileMsg) GetAuthor() []byte
func (*SetProfileMsg) GetDescription ¶
func (m *SetProfileMsg) GetDescription() string
func (*SetProfileMsg) GetName ¶
func (m *SetProfileMsg) GetName() string
func (*SetProfileMsg) Marshal ¶
func (m *SetProfileMsg) Marshal() (dAtA []byte, err error)
func (SetProfileMsg) Path ¶
func (SetProfileMsg) Path() string
Path returns the routing path for this message
func (*SetProfileMsg) ProtoMessage ¶
func (*SetProfileMsg) ProtoMessage()
func (*SetProfileMsg) Reset ¶
func (m *SetProfileMsg) Reset()
func (*SetProfileMsg) Size ¶
func (m *SetProfileMsg) Size() (n int)
func (*SetProfileMsg) String ¶
func (m *SetProfileMsg) String() string
func (*SetProfileMsg) Unmarshal ¶
func (m *SetProfileMsg) Unmarshal(dAtA []byte) error
func (*SetProfileMsg) Validate ¶
func (s *SetProfileMsg) Validate() error
Validate makes sure that this is sensible
type SetProfileMsgHandler ¶ added in v0.7.0
type SetProfileMsgHandler struct {
// contains filtered or unexported fields
}