storage

package
v0.0.0-...-66acf6f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseTeamIDDBKey

func ParseTeamIDDBKey(s string) (teamID keybase1.TeamID, err error)

ParseTeamIDDBKey takes an tid:-style key (used by FTL and slow team loader) and returns a regular team id. We can safely strip away the |pub marker because the publicness of a team is encoded in its ID.

Types

type DiskStorageItem

type DiskStorageItem struct {
	Version int                `codec:"V"`
	State   *keybase1.TeamData `codec:"S"`
}

type FTLStorage

type FTLStorage struct {
	// contains filtered or unexported fields
}

FTLStorage stores FTL state to disk or memory.

func NewFTLStorage

func NewFTLStorage(g *libkb.GlobalContext, upgrader FTLStorageUpgrader) *FTLStorage

func (FTLStorage) ClearMem

func (s FTLStorage) ClearMem()

Clear the in-memory storage.

func (*FTLStorage) Get

func (s *FTLStorage) Get(mctx libkb.MetaContext, teamID keybase1.TeamID, public bool) (data *keybase1.FastTeamData, frozen bool, tombstoned bool)

Can return nil.

func (FTLStorage) MemSize

func (s FTLStorage) MemSize() int

func (*FTLStorage) Put

func (s *FTLStorage) Put(mctx libkb.MetaContext, state *keybase1.FastTeamData)

func (FTLStorage) Shutdown

func (s FTLStorage) Shutdown()

type FTLStorageUpgrader

type FTLStorageUpgrader func(mctx libkb.MetaContext, state *keybase1.FastTeamData) (changed bool, err error)

type HiddenChainSupportState

type HiddenChainSupportState struct {
	TeamID     keybase1.TeamID
	State      bool
	CacheUntil time.Time
}

HiddenChainSupportState describes whether a team supports the hidden chain or not. This information is fetched from the server and cached.

func (*HiddenChainSupportState) ID

func (*HiddenChainSupportState) IsPublic

func (ss *HiddenChainSupportState) IsPublic() bool

type HiddenStorage

type HiddenStorage struct {
	// contains filtered or unexported fields
}

HiddenStorage stores Hidden state to disk or memory.

func NewHiddenStorage

func NewHiddenStorage(g *libkb.GlobalContext) *HiddenStorage

func (HiddenStorage) ClearMem

func (s HiddenStorage) ClearMem()

Clear the in-memory storage.

func (*HiddenStorage) Get

func (s *HiddenStorage) Get(mctx libkb.MetaContext, teamID keybase1.TeamID, public bool) (state *keybase1.HiddenTeamChain, frozen bool, tombstoned bool)

Can return nil.

func (HiddenStorage) MemSize

func (s HiddenStorage) MemSize() int

func (*HiddenStorage) Put

func (HiddenStorage) Shutdown

func (s HiddenStorage) Shutdown()

type Merkle

type Merkle struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Merkle stores when a team last polled merkle. Threadsafe.

func NewMerkle

func NewMerkle() *Merkle

func (*Merkle) Get

func (s *Merkle) Get(mctx libkb.MetaContext, teamID keybase1.TeamID, public bool) (polledAt *keybase1.Time)

func (*Merkle) Put

func (s *Merkle) Put(mctx libkb.MetaContext, teamID keybase1.TeamID, public bool, time keybase1.Time)

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

Storage stores TeamData's on memory and disk. Threadsafe. For the standard loader, which does a complete but slower load. Compare to FTLStorage which stores the Fast-loaded team state.

func NewStorage

func NewStorage(g *libkb.GlobalContext) *Storage

func (Storage) ClearMem

func (s Storage) ClearMem()

Clear the in-memory storage.

func (*Storage) Get

func (s *Storage) Get(mctx libkb.MetaContext, teamID keybase1.TeamID, public bool) (data *keybase1.TeamData, frozen bool, tombstoned bool)

Get can return nil and no error.

func (Storage) MemSize

func (s Storage) MemSize() int

func (*Storage) Put

func (s *Storage) Put(mctx libkb.MetaContext, state *keybase1.TeamData)

func (Storage) Shutdown

func (s Storage) Shutdown()

type SupportsHiddenFlagStorage

type SupportsHiddenFlagStorage struct {
	// contains filtered or unexported fields
}

SupportsHiddenFlagStorage stores the supports_hidden_chain flag to disk and memory.

func NewSupportsHiddenFlagStorage

func NewSupportsHiddenFlagStorage(g *libkb.GlobalContext) *SupportsHiddenFlagStorage

func (*SupportsHiddenFlagStorage) ClearEntryIfFalse

func (s *SupportsHiddenFlagStorage) ClearEntryIfFalse(mctx libkb.MetaContext, teamID keybase1.TeamID)

func (SupportsHiddenFlagStorage) ClearMem

func (s SupportsHiddenFlagStorage) ClearMem()

Clear the in-memory storage.

func (*SupportsHiddenFlagStorage) Get

Can return nil.

func (SupportsHiddenFlagStorage) MemSize

func (s SupportsHiddenFlagStorage) MemSize() int

func (*SupportsHiddenFlagStorage) Put

func (SupportsHiddenFlagStorage) Shutdown

func (s SupportsHiddenFlagStorage) Shutdown()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL