Documentation
¶
Index ¶
- Constants
- func CanAdd[T TAuthable](a auth.OpAuth, u T) error
- func CanDelete[T TAuthable](a auth.OpAuth, u T) error
- func CanUpdate[T TAuthable](a auth.OpAuth, u T, field string, value any) error
- func CanView[T TAuthable](a auth.OpAuth, u T, field string, value any) error
- type Card
- func (c Card) AsAclCard() (lib.Card, bool)
- func (c *Card) AsObjects(a *auth.Authorizator) []schema.Object
- func (c Card) AsRuleEntity() (string, interface{})
- func (c Card) CacheKey() string
- func (c Card) From() lib.Date
- func (c Card) Groups() []schema.OID
- func (c Card) IsDeleted() bool
- func (c Card) IsValid() bool
- func (c Card) PIN() uint32
- func (c *Card) Status() types.Status
- func (c Card) String() string
- func (c Card) To() lib.Date
- type Cards
- func (cc *Cards) AsObjects(a *auth.Authorizator, start, count int) []schema.Object
- func (cc *Cards) Clone() Cards
- func (cc *Cards) Create(a *auth.Authorizator, oid schema.OID, value string, dbc db.DBC) ([]schema.Object, error)
- func (cc *Cards) Delete(a *auth.Authorizator, oid schema.OID, dbc db.DBC) ([]schema.Object, error)
- func (cc *Cards) Found(found []uint32)
- func (cc *Cards) List() []Card
- func (cc *Cards) Load(blob json.RawMessage) error
- func (cc Cards) Lookup(card uint32) (*Card, bool)
- func (cc *Cards) MarkIncorrect(list []uint32)
- func (cc *Cards) Print()
- func (cc *Cards) Save() (json.RawMessage, error)
- func (cc *Cards) Sweep(retention time.Duration)
- func (cc *Cards) Update(a *auth.Authorizator, oid schema.OID, value string, dbc db.DBC) ([]schema.Object, error)
- func (cc Cards) Validate() error
- type TAuthable
Constants ¶
const CardCreated = schema.Created
const CardDeleted = schema.Deleted
const CardFrom = schema.CardFrom
const CardGroups = schema.CardGroups
const CardModified = schema.Modified
const CardName = schema.CardName
const CardNumber = schema.CardNumber
const CardPIN = schema.CardPIN
const CardStatus = schema.Status
const CardTo = schema.CardTo
const GroupName = schema.GroupName
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Card ¶
type Card struct { catalog.CatalogCard // contains filtered or unexported fields }
func (Card) AsRuleEntity ¶
type Cards ¶
type Cards struct {
// contains filtered or unexported fields
}
func (*Cards) Clone ¶
NTS: 'added' is specifically not cloned - it has a lifetime for the duration of
the 'shadow' copy only
func (*Cards) Found ¶
Some of this is a bit obscure, so: * * 1. FOUND cards are cards present on any one of the controllers that are not * in the cards list * 2. A FOUND card is marked 'unconfigured' until manually edited which adds it * to the known list * 3. A FOUND card that is deleted externally (e.g. by uhppote-cli) is automatically * removed * 4. A FOUND card that is deleted is marked as deleted but left unconfigured. It is * removed from the controllers but not from the internal cards list until the next * scan. * 5. The deleted flag is removed from a FOUND card that is deleted and subsequently * reinstated externally * 6. A card that is 'known' but deleted and then reinstated externally is marked 'found' * and marked not deleted * 7. This is insanely more complicated than it should be and there has to be a better * way :-(