Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

custom_resource source realm

Constants 1

Functions 8

func AddMember

crossing Action
1func AddMember(cur realm)
source

Bypass limitation by adding yourself to the DAO. It is necessary to be part of the DAO to create a Proposal.

func Execute

crossing Action
1func Execute(cur realm, proposalID uint64)
source

Execute triggers the implementation of a proposal's actions

func ProposeNewPost

crossing Action
1func ProposeNewPost(cur realm, title, content string)
source

Creates a Proposal to create a new blog post. This demonstrates the custom resource functionality of the DAO. Parameters:

  • title: The title of the blog post
  • content: The content of the blog post

func Render

1func Render(path string) string
source

Render generates a UI representation of the DAO's state

func Vote

crossing Action
1func Vote(cur realm, proposalID uint64, vote daocond.Vote)
source

Vote allows DAO members to cast their vote on a specific proposal

Types 3

type ActionNewPost

struct
1type ActionNewPost struct {
2	Title   string
3	Content string
4}
source

Methods on ActionNewPost

func String

method on ActionNewPost
1func (m *ActionNewPost) String() string
source

func Type

method on ActionNewPost
1func (m *ActionNewPost) Type() string
source

type Blog

struct
1type Blog struct {
2	Post []Post
3}
source

Methods on Blog

func NewPost

method on Blog
1func (a *Blog) NewPost(title string, content string, rlm realm)
source

The realm is threaded in from the action handler, which receives the DAO's own. It is last because the VM reads a leading realm parameter as a crossing function, and receivers do not exempt a method from that rule.

func Render

method on Blog
1func (a *Blog) Render() string
source

type Post

struct
1type Post struct {
2	Title   string
3	Content string
4	Created time.Time
5	Creator string // id of the creator, address or pkg path
6}
source

Imports 9

Source Files 5