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

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v0 state

Back to all declarations

payee

type

payee is a single share holder inside a group.

Value

v0.payee

group

type

group is one payment-splitting arrangement.

Value

v0.group

groups

v0.Tree

// id (zero-padded string) -> \*group

Open
OID
0ee00d…e25b:4
groups details

Inspect ref

nextID

int

Value

0

Register

func(payees string, shares string) int

Register creates a new group from comma-separated payees and shares. payees: "g1abc...,g1def..." (addresses) shares: "3,1" (positive integers, same count as payees) Returns the new group id. Panics on malformed input.

Open
OID
0ee00d…e25b:9
Register details

Inspect func

RecordIncome

func(id int, amount int)

RecordIncome adds amount to the pool of group id. amount must be positive.

Open
OID
0ee00d…e25b:11
RecordIncome details

Inspect func

Render

func(path string) string

Render shows all groups, their payees, shares, and computed owed amounts.

Open
OID
0ee00d…e25b:12
Render details

Inspect func

splitTrim

func(s string) []string

splitTrim splits on commas and trims whitespace around each element.

Open
OID
0ee00d…e25b:13
splitTrim details

Inspect func

key

func(id int) string

key produces a zero-padded, lexicographically-sortable avl key for an id, so Render iterates groups in ascending numeric order.

Open
OID
0ee00d…e25b:14
key details

Inspect func
payee : type =v0.payee
group : type =v0.group
groups : v0.Tree Inspect
nextID : int =0
errEmpty : *errors.errorString Inspect
Register : func(payees string, shares string) int Inspect
RecordIncome : func(id int, amount int) Inspect
Render : func(path string) string Inspect
splitTrim : func(s string) []string Inspect
key : func(id int) string Inspect