Documentation ¶
Index ¶
- type DoormanDefinition
- func (dmd *DoormanDefinition) AsDoormanUpdatePayload() ([]byte, error)
- func (dmd *DoormanDefinition) AsWriteAccess(email string) bool
- func (dmd *DoormanDefinition) CanBeUpdatedBy(dmd2 *DoormanDefinition) error
- func (dm *DoormanDefinition) MarshalJSON() ([]byte, error)
- func (dm *DoormanDefinition) UnmarshalJSON(data []byte) error
- func (dmd *DoormanDefinition) Validate(author string) (err error)
- func (dmd *DoormanDefinition) ValidateDoormanValueNames() error
- func (dmd *DoormanDefinition) ValidateDoormanValueProbabilities() error
- type DoormanId
- type DoormanValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DoormanDefinition ¶
type DoormanDefinition struct { Id bson.ObjectId `bson:"_id"` Name string `bson:"name"` Values []*DoormanValue `bson:"values"` OwnerEmails []string `bson:"emails"` }
func NewDoormanDefinition ¶
func NewDoormanDefinition(name string, ownerEmails ...string) *DoormanDefinition
func QuickNewDoormanDefinition ¶
func QuickNewDoormanDefinition(name string, probs ...string) *DoormanDefinition
a way to quickly create doormen in tests. do not use in real code. will panic if a doorman is wrongly specify
func (*DoormanDefinition) AsDoormanUpdatePayload ¶
func (dmd *DoormanDefinition) AsDoormanUpdatePayload() ([]byte, error)
func (*DoormanDefinition) AsWriteAccess ¶
func (dmd *DoormanDefinition) AsWriteAccess(email string) bool
func (*DoormanDefinition) CanBeUpdatedBy ¶
func (dmd *DoormanDefinition) CanBeUpdatedBy(dmd2 *DoormanDefinition) error
func (*DoormanDefinition) MarshalJSON ¶
func (dm *DoormanDefinition) MarshalJSON() ([]byte, error)
func (*DoormanDefinition) UnmarshalJSON ¶
func (dm *DoormanDefinition) UnmarshalJSON(data []byte) error
func (*DoormanDefinition) Validate ¶
func (dmd *DoormanDefinition) Validate(author string) (err error)
func (*DoormanDefinition) ValidateDoormanValueNames ¶
func (dmd *DoormanDefinition) ValidateDoormanValueNames() error
func (*DoormanDefinition) ValidateDoormanValueProbabilities ¶
func (dmd *DoormanDefinition) ValidateDoormanValueProbabilities() error
type DoormanId ¶
type DoormanId struct { Id bson.ObjectId `json:"id,omitempty" bson:"_id"` Name string `json:"name" bson:"name"` }
func (*DoormanId) MarshalJSON ¶
func (*DoormanId) UnmarshalJSON ¶
type DoormanValue ¶
func (*DoormanValue) GetBSON ¶
func (val *DoormanValue) GetBSON() (interface{}, error)
Click to show internal directories.
Click to hide internal directories.