Documentation
¶
Index ¶
- Constants
- Variables
- func GetTreeIDFromIDString(id string) (string, error)
- func GetUUIDFromIDString(id string) (string, error)
- func PadToTreeIDLen(t string) (string, error)
- func TreeID(entryID string) (int64, error)
- func ValidateEntryID(id string) error
- func ValidateTreeID(t string) error
- func ValidateUUID(u string) error
- func VirtualLogIndex(leafIndex int64, tid int64, ranges *LogRanges) int64
- type EntryID
- type LogRange
- type LogRanges
- func (l *LogRanges) AllShards() []int64
- func (l *LogRanges) CompleteInitialization(ctx context.Context, tcm *trillianclient.ClientManager) (map[int64]types.LogRootV1, error)
- func (l *LogRanges) GetActive() LogRange
- func (l *LogRanges) GetInactive() []LogRange
- func (l *LogRanges) GetLogRangeByTreeID(treeID int64) (LogRange, error)
- func (l *LogRanges) NoInactive() bool
- func (l *LogRanges) PublicKey(treeID string) (string, error)
- func (l *LogRanges) ResolveVirtualIndex(index int) (int64, int64)
- func (l *LogRanges) String() string
- func (l *LogRanges) TotalInactiveLength() int64
- type Ranges
Constants ¶
const EntryIDHexStringLen = TreeIDHexStringLen + UUIDHexStringLen
const TreeIDHexStringLen = 16
const UUIDHexStringLen = 64
Variables ¶
var ErrPlainUUID = errors.New("cannot get treeID from plain UUID")
Functions ¶
func GetTreeIDFromIDString ¶ added in v0.6.0
GetTreeIDFromIDString Returns TreeID (with no appended UUID) from a TreeID or EntryID string. Validates TreeID and also UUID if present.
func GetUUIDFromIDString ¶
GetUUIDFromIDString Returns UUID (with no prepended TreeID) from a UUID or EntryID string. Validates UUID and also TreeID if present.
func PadToTreeIDLen ¶
func ValidateEntryID ¶ added in v0.6.0
func ValidateTreeID ¶ added in v0.6.0
ValidateTreeID This is permissive in that if passed an EntryID, it will find the TreeID and validate it.
func ValidateUUID ¶ added in v0.6.0
ValidateUUID This is permissive in that if passed an EntryID, it will find the UUID and validate it.
Types ¶
type EntryID ¶
func CreateEntryIDFromParts ¶
CreateEntryIDFromParts This function can take a TreeID of equal or lesser length than TreeIDHexStringLen. In case the TreeID length is less than TreeIDHexStringLen, it will be padded to the correct length.
func (EntryID) ReturnEntryIDString ¶
type LogRange ¶
type LogRange struct {
TreeID int64 `json:"treeID" yaml:"treeID"`
TreeLength int64 `json:"treeLength" yaml:"treeLength"` // unused for active tree
SigningConfig signer.SigningConfig `json:"signingConfig" yaml:"signingConfig"` // if unset, assume same as active tree
GRPCConfig *trillianclient.GRPCConfig `json:"grpcEndpoint" yaml:"grpcEndpoint"` // if unset, assume same as active tree
Signer signature.Signer
PemPubKey string // PEM-encoded PKIX public key
LogID string // Hex-encoded SHA256 digest of PKIX-encoded public key
}
LogRange represents a log or tree shard
type LogRanges ¶
type LogRanges struct {
// contains filtered or unexported fields
}
Active and inactive shards
func NewLogRanges ¶ added in v0.6.0
func NewLogRanges(ctx context.Context, inactiveShardsPath string, activeTreeID int64, signingConfig signer.SigningConfig) (*LogRanges, error)
NewLogRanges initializes the active and any inactive log shards from a config file.
func (*LogRanges) AllShards ¶ added in v0.12.2
AllShards returns all shards, starting with the active shard and then the inactive shards
func (*LogRanges) CompleteInitialization ¶ added in v1.4.1
func (l *LogRanges) CompleteInitialization(ctx context.Context, tcm *trillianclient.ClientManager) (map[int64]types.LogRootV1, error)
CompleteInitialization populates the tree length for all inactive shards.
func (*LogRanges) GetInactive ¶ added in v0.6.0
GetInactive returns all inactive shards
func (*LogRanges) GetLogRangeByTreeID ¶ added in v1.3.9
GetLogRangeByTreeID returns the active or inactive shard with the given tree ID
func (*LogRanges) NoInactive ¶ added in v0.6.0
func (*LogRanges) PublicKey ¶ added in v0.6.0
PublicKey returns the associated public key for the given Tree ID and returns the active public key by default
func (*LogRanges) ResolveVirtualIndex ¶
func (*LogRanges) TotalInactiveLength ¶ added in v0.6.0
TotalInactiveLength returns the total length across all inactive shards; we don't know the length of the active shard.