Documentation
¶
Overview ¶
cache package saves information of client status to enhance performance.
Index ¶
- Constants
- type Cache
- func (c *Cache) ClearBases()
- func (c *Cache) ClearCommands()
- func (c *Cache) CompareNonce(n uint64) bool
- func (c *Cache) GetBases() []*typdefs.BaseRow
- func (c *Cache) GetCommands() uint64
- func (c *Cache) GetIKeyCert() *x509.Certificate
- func (c *Cache) GetIsAutoUpdate() bool
- func (c *Cache) GetNonce() uint64
- func (c *Cache) GetOnline() bool
- func (c *Cache) GetRegTime() string
- func (c *Cache) GetTaTrusted(uuid string) string
- func (c *Cache) GetTrustExpiration() time.Time
- func (c *Cache) GetTrusted() string
- func (c *Cache) HasCommands() bool
- func (c *Cache) IsHeartBeatExpired() bool
- func (c *Cache) SetBases(baserow *typdefs.BaseRow)
- func (c *Cache) SetCommands(cmds uint64)
- func (c *Cache) SetIKeyCert(pemCert string)
- func (c *Cache) SetIsAutoUpdate(v bool)
- func (c *Cache) SetRegTime(v string)
- func (c *Cache) SetTaTrusted(uuid string, v string)
- func (c *Cache) SetTrusted(v string)
- func (c *Cache) UpdateHeartBeat(hb time.Duration)
- func (c *Cache) UpdateOnline(t time.Duration)
- func (c *Cache) UpdateTrustReport(trust time.Duration)
Constants ¶
const ( // StrUnknown means the string of unknown. StrUnknown = "unknown" // StrTrusted means the string of trusted. StrTrusted = "trusted" // StrUntrusted means the string of untrusted. StrUntrusted = "untrusted" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { // for verify process Bases []*typdefs.BaseRow TaBases map[string]*typdefs.TaBaseRow // contains filtered or unexported fields }
Cache stores the latest status of one RAC client and commands.
func (*Cache) ClearCommands ¶
func (c *Cache) ClearCommands()
ClearCommands clears the client commands.
func (*Cache) CompareNonce ¶
CompareNonce checks the returned nonce match or not.
func (*Cache) GetCommands ¶
GetCommands gets the pending commands of client.
func (*Cache) GetIKeyCert ¶
func (c *Cache) GetIKeyCert() *x509.Certificate
GetIKeyCert returns the client IK certificate for validate the trust report.
func (*Cache) GetIsAutoUpdate ¶
GetIsAutoUpdate returns the client autoupdate strategy.
func (*Cache) GetRegTime ¶
GetRegTime returns the client register time.
func (*Cache) GetTaTrusted ¶
GetTaTrusted checks weather the TA trust report is valid or not.
func (*Cache) GetTrustExpiration ¶
func (*Cache) GetTrusted ¶
GetTrusted checks weather the RAC trust report is valid or not.
func (*Cache) HasCommands ¶
HasCommands checks if the client has some commands.
func (*Cache) IsHeartBeatExpired ¶
IsHeartBeatExpired checks if the client is expired.
func (*Cache) SetCommands ¶
SetCommands saves the new commands for waiting.
func (*Cache) SetIKeyCert ¶
SetIKeyCert saves the client IK certificate in cache to enhance performance.
func (*Cache) SetIsAutoUpdate ¶
SetIsAutoUpdate saves the client autoppdate strategy.
func (*Cache) SetRegTime ¶
SetRegTime saves the client register time.
func (*Cache) SetTaTrusted ¶
SetTaTrusted sets the ta trusted field by uuid.
func (*Cache) SetTrusted ¶
SetTrusted sets the host trusted field.
func (*Cache) UpdateHeartBeat ¶
UpdateHeartBeat is called when receives heart beat message from RAC.
func (*Cache) UpdateOnline ¶
UpdateOnline updates online expiration.
func (*Cache) UpdateTrustReport ¶
UpdateTrustReport is called when receives trust report message from RAC.