Documentation ¶
Index ¶
- Constants
- func Dump(o *Object, skipKeys ...string) string
- func Hash(o *Object) []byte
- func ObjectHash(o *Object) ([]byte, error)
- type Member
- type Object
- func (o *Object) Compact() (string, error)
- func (o Object) CompactHash() string
- func (o *Object) Copy() *Object
- func (o *Object) FromMap(m map[string]interface{}) error
- func (o Object) GetParents() []string
- func (o Object) GetPolicy() *Object
- func (o Object) GetRaw(lk string) interface{}
- func (o Object) GetSignature() *Object
- func (o Object) GetType() string
- func (o Object) Hash() []byte
- func (o Object) HashBase58() string
- func (o Object) SetParents(v []string)
- func (o Object) SetPolicy(v *Object)
- func (o *Object) SetRaw(n string, v interface{})
- func (o Object) SetSignature(v *Object)
- func (o Object) SetType(v string)
- func (o Object) ToMap() map[string]interface{}
- func (o *Object) ToObject() *Object
- func (o Object) ToPlainMap() map[string]interface{}
- type Objectable
- type Policy
- type TypeHint
Constants ¶
const (
PolicyType = "/policy"
)
Variables ¶
This section is empty.
Functions ¶
func ObjectHash ¶
ObjectHash consistently hashes a map. It is based on Ben Laurie's object hash, but using the same type hints as TJSON instead. TODO add redaction
Types ¶
type Object ¶
Object for everything f12n
func (Object) CompactHash ¶
CompactHash returns the object's hash in its (not really) compact format
func (Object) GetParents ¶
GetParents returns the object's parent refs
func (Object) GetSignature ¶
GetSignature returns the object's signature, or nil
func (Object) HashBase58 ¶
HashBase58 returns the object's hash base58 encoded
func (Object) SetParents ¶
SetParents sets the object's parents
func (Object) SetSignature ¶
SetSignature sets the object's signature
func (*Object) ToObject ¶
ToObject simply returns a copy of the object This is mostly a hack for generated objects
func (Object) ToPlainMap ¶
ToPlainMap returns the object as a map, without adding type hints on the keys
type Objectable ¶
type Objectable interface {
// contains filtered or unexported methods
}
Objectable is a temp interface, we should consider removing
type Policy ¶
type Policy struct { Description string `json:"description,omitempty"` Subjects []string `json:"subjects,omitempty"` Actions []string `json:"actions,omitempty"` Effect string `json:"effect,omitempty"` }
Policy for object
func (*Policy) FromObject ¶
FromObject populates the struct from a f12n object