Documentation ¶
Index ¶
- Constants
- func Dump(o Object, skipKeys ...string) string
- func ObjectHash(o Object) ([]byte, error)
- func ObjectHashWithoutSignature(o Object) ([]byte, error)
- type Hash
- 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) Get(lk string) interface{}
- func (o Object) GetParents() []string
- func (o Object) GetPolicy() *Object
- func (o Object) GetRoot() string
- func (o Object) GetSignature() *Object
- func (o Object) GetType() string
- func (o Object) Hash() Hash
- func (o Object) Set(k string, v interface{})
- func (o Object) SetParents(v []string)
- func (o Object) SetPolicy(v Object)
- func (o Object) SetSignature(v Object)
- func (o Object) SetType(v string)
- func (o Object) ToMap() map[string]interface{}
- func (o Object) ToObject() Object
- type Policy
- type TypeHint
Constants ¶
View Source
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
func ObjectHashWithoutSignature ¶ added in v0.4.0
Types ¶
type Object ¶
type Object map[string]interface{}
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) SetParents ¶
SetParents sets the object's parents
func (Object) SetSignature ¶
SetSignature sets the object's signature
type Policy ¶
type Policy struct { Description string `json:"description:s,omitempty"` Subjects []string `json:"subjects:as,omitempty"` Actions []string `json:"actions:as,omitempty"` Effect string `json:"effect:s,omitempty"` }
Policy for object
func (*Policy) FromObject ¶
FromObject populates the struct from a f12n object
Source Files ¶
Click to show internal directories.
Click to hide internal directories.