func (p *Posting) getMetadata(key string) interface{} {
	if value, ok := p.metadata[key]; ok {
		return value
	}
	return p.trans.getMetadata(key)
}
---- local accessors
package dblentry
import "fmt"
import "time"
import "strings"
import "github.com/prataprc/goparsec"
import "github.com/bnclabs/golog"
import "github.com/tn47/goledger/api"
const (
	PostUncleared = "uncleared"
	PostCleared = "cleared"
	PostPending = "pending"
)
var prefix2state = map[rune]string{
	'*': PostCleared,
	'!': PostPending,
}
type Posting struct {
	trans     *Transaction
	account   *Account
	virtual   bool
	balanced  bool
	commodity *Commodity
	lotprice  *Commodity
	lotdate   time.Time
	costprice *Commodity
	balprice  *Commodity
	tags     []string
	metadata map[string]interface{}
	note     string
}
func NewPosting(trans *Transaction) *Posting {
	return &Posting{
		trans:    trans,
		tags:     []string{},
		metadata: map[string]interface{}{},
	}
}