Documentation ¶
Index ¶
- Variables
- func KubeWatchResult_KeyPredicateFns(keyFn ...func(string) bool) func(string) bool
- func KubeWatchResult_ValPredicateFns(valFn ...func(*KubeWatchResult) bool) func(*KubeWatchResult) bool
- func ResourceEventCounts_KeyPredicateFns(keyFn ...func(string) bool) func(string) bool
- func ResourceEventCounts_ValPredicateFns(valFn ...func(*ResourceEventCounts) bool) func(*ResourceEventCounts) bool
- func ResourceSummary_KeyPredicateFns(keyFn ...func(string) bool) func(string) bool
- func ResourceSummary_ValPredicateFns(valFn ...func(*ResourceSummary) bool) func(*ResourceSummary) bool
- func StringToProtobufTimestamp(ts string) (*timestamp.Timestamp, error)
- func ValueType_KeyPredicateFns(keyFn ...func(string) bool) func(string) bool
- func ValueType_ValPredicateFns(valFn ...func(*ValueType) bool) func(*ValueType) bool
- func WatchActivity_KeyPredicateFns(keyFn ...func(string) bool) func(string) bool
- func WatchActivity_ValPredicateFns(valFn ...func(*WatchActivity) bool) func(*WatchActivity) bool
- type EventCountKey
- type EventCounts
- func (*EventCounts) Descriptor() ([]byte, []int)
- func (m *EventCounts) GetMapReasonToCount() map[string]int32
- func (*EventCounts) ProtoMessage()
- func (m *EventCounts) Reset()
- func (m *EventCounts) String() string
- func (m *EventCounts) XXX_DiscardUnknown()
- func (m *EventCounts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EventCounts) XXX_Merge(src proto.Message)
- func (m *EventCounts) XXX_Size() int
- func (m *EventCounts) XXX_Unmarshal(b []byte) error
- type KeyType
- func (*KeyType) GetTestKey() string
- func (*KeyType) GetTestValue() *ValueType
- func (*KeyType) Parse(key string) error
- func (*KeyType) SetPartitionId(newPartitionId string)
- func (*KeyType) SetTestKeys() []string
- func (p *KeyType) SetTestValue() *ValueType
- func (*KeyType) String() string
- func (*KeyType) TableName() string
- func (*KeyType) ValidateKey(key string) error
- type KubeWatchResult
- func (*KubeWatchResult) Descriptor() ([]byte, []int)
- func (m *KubeWatchResult) GetKind() string
- func (m *KubeWatchResult) GetPayload() string
- func (m *KubeWatchResult) GetTimestamp() *timestamp.Timestamp
- func (m *KubeWatchResult) GetWatchType() KubeWatchResult_WatchType
- func (*KubeWatchResult) ProtoMessage()
- func (m *KubeWatchResult) Reset()
- func (m *KubeWatchResult) String() string
- func (m *KubeWatchResult) XXX_DiscardUnknown()
- func (m *KubeWatchResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *KubeWatchResult) XXX_Merge(src proto.Message)
- func (m *KubeWatchResult) XXX_Size() int
- func (m *KubeWatchResult) XXX_Unmarshal(b []byte) error
- type KubeWatchResultTable
- func (t *KubeWatchResultTable) Get(txn badgerwrap.Txn, key string) (*KubeWatchResult, error)
- func (t *KubeWatchResultTable) GetAllKeysForGivenPartitions(db badgerwrap.DB, key *WatchTableKey, maxNumberOfKeys int, lookBack int, ...) []string
- func (t *KubeWatchResultTable) GetMaxKey(txn badgerwrap.Txn) (bool, string)
- func (t *KubeWatchResultTable) GetMaxPartition(txn badgerwrap.Txn) (bool, string)
- func (t *KubeWatchResultTable) GetMinKey(txn badgerwrap.Txn) (bool, string)
- func (t *KubeWatchResultTable) GetMinMaxPartitions(txn badgerwrap.Txn) (bool, string, string)
- func (t *KubeWatchResultTable) GetMinPartition(txn badgerwrap.Txn) (bool, string)
- func (t *KubeWatchResultTable) GetPartitionsFromTimeRange(txn badgerwrap.Txn, startTime time.Time, endTime time.Time) ([]string, error)
- func (t *KubeWatchResultTable) GetPreviousKey(txn badgerwrap.Txn, key *WatchTableKey, keyComparator *WatchTableKey) (*WatchTableKey, error)
- func (t *KubeWatchResultTable) GetUniquePartitionList(txn badgerwrap.Txn) ([]string, error)
- func (t *KubeWatchResultTable) RangeRead(txn badgerwrap.Txn, keyPrefix *WatchTableKey, keyPredicateFn func(string) bool, ...) (map[WatchTableKey]*KubeWatchResult, RangeReadStats, error)
- func (t *KubeWatchResultTable) Set(txn badgerwrap.Txn, key string, value *KubeWatchResult) error
- type KubeWatchResult_WatchType
- type MinMaxPartitionsGetter
- type RangeReadStats
- type ResourceEventCounts
- func (*ResourceEventCounts) Descriptor() ([]byte, []int)
- func (m *ResourceEventCounts) GetMapMinToEvents() map[int64]*EventCounts
- func (*ResourceEventCounts) ProtoMessage()
- func (m *ResourceEventCounts) Reset()
- func (m *ResourceEventCounts) String() string
- func (m *ResourceEventCounts) XXX_DiscardUnknown()
- func (m *ResourceEventCounts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ResourceEventCounts) XXX_Merge(src proto.Message)
- func (m *ResourceEventCounts) XXX_Size() int
- func (m *ResourceEventCounts) XXX_Unmarshal(b []byte) error
- type ResourceEventCountsTable
- func (t *ResourceEventCountsTable) Get(txn badgerwrap.Txn, key string) (*ResourceEventCounts, error)
- func (t *ResourceEventCountsTable) GetAllKeysForGivenPartitions(db badgerwrap.DB, key *EventCountKey, maxNumberOfKeys int, lookBack int, ...) []string
- func (t *ResourceEventCountsTable) GetMaxKey(txn badgerwrap.Txn) (bool, string)
- func (t *ResourceEventCountsTable) GetMaxPartition(txn badgerwrap.Txn) (bool, string)
- func (t *ResourceEventCountsTable) GetMinKey(txn badgerwrap.Txn) (bool, string)
- func (t *ResourceEventCountsTable) GetMinMaxPartitions(txn badgerwrap.Txn) (bool, string, string)
- func (t *ResourceEventCountsTable) GetMinPartition(txn badgerwrap.Txn) (bool, string)
- func (t *ResourceEventCountsTable) GetOrDefault(txn badgerwrap.Txn, key string) (*ResourceEventCounts, error)
- func (t *ResourceEventCountsTable) GetPartitionsFromTimeRange(txn badgerwrap.Txn, startTime time.Time, endTime time.Time) ([]string, error)
- func (t *ResourceEventCountsTable) GetPreviousKey(txn badgerwrap.Txn, key *EventCountKey, keyComparator *EventCountKey) (*EventCountKey, error)
- func (t *ResourceEventCountsTable) GetUniquePartitionList(txn badgerwrap.Txn) ([]string, error)
- func (t *ResourceEventCountsTable) RangeRead(txn badgerwrap.Txn, keyPrefix *EventCountKey, keyPredicateFn func(string) bool, ...) (map[EventCountKey]*ResourceEventCounts, RangeReadStats, error)
- func (t *ResourceEventCountsTable) Set(txn badgerwrap.Txn, key string, value *ResourceEventCounts) error
- type ResourceSummary
- func (*ResourceSummary) Descriptor() ([]byte, []int)
- func (m *ResourceSummary) GetCreateTime() *timestamp.Timestamp
- func (m *ResourceSummary) GetDeletedAtEnd() bool
- func (m *ResourceSummary) GetFirstSeen() *timestamp.Timestamp
- func (m *ResourceSummary) GetLastSeen() *timestamp.Timestamp
- func (m *ResourceSummary) GetRelationships() []string
- func (*ResourceSummary) ProtoMessage()
- func (m *ResourceSummary) Reset()
- func (m *ResourceSummary) String() string
- func (m *ResourceSummary) XXX_DiscardUnknown()
- func (m *ResourceSummary) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ResourceSummary) XXX_Merge(src proto.Message)
- func (m *ResourceSummary) XXX_Size() int
- func (m *ResourceSummary) XXX_Unmarshal(b []byte) error
- type ResourceSummaryKey
- type ResourceSummaryTable
- func (t *ResourceSummaryTable) Get(txn badgerwrap.Txn, key string) (*ResourceSummary, error)
- func (t *ResourceSummaryTable) GetAllKeysForGivenPartitions(db badgerwrap.DB, key *ResourceSummaryKey, maxNumberOfKeys int, lookBack int, ...) []string
- func (t *ResourceSummaryTable) GetMaxKey(txn badgerwrap.Txn) (bool, string)
- func (t *ResourceSummaryTable) GetMaxPartition(txn badgerwrap.Txn) (bool, string)
- func (t *ResourceSummaryTable) GetMinKey(txn badgerwrap.Txn) (bool, string)
- func (t *ResourceSummaryTable) GetMinMaxPartitions(txn badgerwrap.Txn) (bool, string, string)
- func (t *ResourceSummaryTable) GetMinPartition(txn badgerwrap.Txn) (bool, string)
- func (t *ResourceSummaryTable) GetPartitionsFromTimeRange(txn badgerwrap.Txn, startTime time.Time, endTime time.Time) ([]string, error)
- func (t *ResourceSummaryTable) GetPreviousKey(txn badgerwrap.Txn, key *ResourceSummaryKey, keyComparator *ResourceSummaryKey) (*ResourceSummaryKey, error)
- func (t *ResourceSummaryTable) GetUniquePartitionList(txn badgerwrap.Txn) ([]string, error)
- func (t *ResourceSummaryTable) RangeRead(txn badgerwrap.Txn, keyPrefix *ResourceSummaryKey, ...) (map[ResourceSummaryKey]*ResourceSummary, RangeReadStats, error)
- func (t *ResourceSummaryTable) Set(txn badgerwrap.Txn, key string, value *ResourceSummary) error
- type Tables
- type ValueType
- type ValueTypeTable
- func (t *ValueTypeTable) Get(txn badgerwrap.Txn, key string) (*ValueType, error)
- func (t *ValueTypeTable) GetMaxKey(txn badgerwrap.Txn) (bool, string)
- func (t *ValueTypeTable) GetMinKey(txn badgerwrap.Txn) (bool, string)
- func (t *ValueTypeTable) GetMinMaxPartitions(txn badgerwrap.Txn) (bool, string, string)
- func (t *ValueTypeTable) GetPartitionsFromTimeRange(txn badgerwrap.Txn, startTime time.Time, endTime time.Time) ([]string, error)
- func (t *ValueTypeTable) GetPreviousKey(txn badgerwrap.Txn, key *KeyType, keyComparator *KeyType) (*KeyType, error)
- func (t *ValueTypeTable) GetUniquePartitionList(txn badgerwrap.Txn) ([]string, error)
- func (t *ValueTypeTable) RangeRead(txn badgerwrap.Txn, keyPrefix *KeyType, keyPredicateFn func(string) bool, ...) (map[KeyType]*ValueType, RangeReadStats, error)
- func (t *ValueTypeTable) Set(txn badgerwrap.Txn, key string, value *ValueType) error
- type WatchActivity
- func (*WatchActivity) Descriptor() ([]byte, []int)
- func (m *WatchActivity) GetChangedAt() []int64
- func (m *WatchActivity) GetNoChangeAt() []int64
- func (*WatchActivity) ProtoMessage()
- func (m *WatchActivity) Reset()
- func (m *WatchActivity) String() string
- func (m *WatchActivity) XXX_DiscardUnknown()
- func (m *WatchActivity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *WatchActivity) XXX_Merge(src proto.Message)
- func (m *WatchActivity) XXX_Size() int
- func (m *WatchActivity) XXX_Unmarshal(b []byte) error
- type WatchActivityKey
- type WatchActivityTable
- func (t *WatchActivityTable) Get(txn badgerwrap.Txn, key string) (*WatchActivity, error)
- func (t *WatchActivityTable) GetAllKeysForGivenPartitions(db badgerwrap.DB, key *WatchActivityKey, maxNumberOfKeys int, lookBack int, ...) []string
- func (t *WatchActivityTable) GetMaxKey(txn badgerwrap.Txn) (bool, string)
- func (t *WatchActivityTable) GetMaxPartition(txn badgerwrap.Txn) (bool, string)
- func (t *WatchActivityTable) GetMinKey(txn badgerwrap.Txn) (bool, string)
- func (t *WatchActivityTable) GetMinMaxPartitions(txn badgerwrap.Txn) (bool, string, string)
- func (t *WatchActivityTable) GetMinPartition(txn badgerwrap.Txn) (bool, string)
- func (t *WatchActivityTable) GetOrDefault(txn badgerwrap.Txn, key string) (*WatchActivity, error)
- func (t *WatchActivityTable) GetPartitionsFromTimeRange(txn badgerwrap.Txn, startTime time.Time, endTime time.Time) ([]string, error)
- func (t *WatchActivityTable) GetPreviousKey(txn badgerwrap.Txn, key *WatchActivityKey, keyComparator *WatchActivityKey) (*WatchActivityKey, error)
- func (t *WatchActivityTable) GetUniquePartitionList(txn badgerwrap.Txn) ([]string, error)
- func (t *WatchActivityTable) RangeRead(txn badgerwrap.Txn, keyPrefix *WatchActivityKey, ...) (map[WatchActivityKey]*WatchActivity, RangeReadStats, error)
- func (t *WatchActivityTable) Set(txn badgerwrap.Txn, key string, value *WatchActivity) error
- type WatchTableKey
Constants ¶
This section is empty.
Variables ¶
var KubeWatchResult_WatchType_name = map[int32]string{
0: "ADD",
1: "UPDATE",
2: "DELETE",
}
var KubeWatchResult_WatchType_value = map[string]int32{
"ADD": 0,
"UPDATE": 1,
"DELETE": 2,
}
Functions ¶
func KubeWatchResult_ValPredicateFns ¶
func KubeWatchResult_ValPredicateFns(valFn ...func(*KubeWatchResult) bool) func(*KubeWatchResult) bool
func ResourceEventCounts_ValPredicateFns ¶
func ResourceEventCounts_ValPredicateFns(valFn ...func(*ResourceEventCounts) bool) func(*ResourceEventCounts) bool
func ResourceSummary_ValPredicateFns ¶
func ResourceSummary_ValPredicateFns(valFn ...func(*ResourceSummary) bool) func(*ResourceSummary) bool
func WatchActivity_ValPredicateFns ¶
func WatchActivity_ValPredicateFns(valFn ...func(*WatchActivity) bool) func(*WatchActivity) bool
Types ¶
type EventCountKey ¶
type EventCountKey struct { PartitionId string Kind string Namespace string Name string Uid string }
func NewEventCountKey ¶
func NewEventCountKeyComparator ¶
func NewEventCountKeyComparator(kind string, namespace string, name string, uid string) *EventCountKey
func (*EventCountKey) Parse ¶
func (k *EventCountKey) Parse(key string) error
func (*EventCountKey) SetPartitionId ¶
func (k *EventCountKey) SetPartitionId(newPartitionId string)
func (*EventCountKey) String ¶
func (k *EventCountKey) String() string
todo: need to make sure it can work as keyPrefix when some fields are empty
func (*EventCountKey) TableName ¶
func (*EventCountKey) TableName() string
func (*EventCountKey) ValidateKey ¶
func (*EventCountKey) ValidateKey(key string) error
type EventCounts ¶
type EventCounts struct { MapReasonToCount map[string]int32 `` /* 174-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*EventCounts) Descriptor ¶
func (*EventCounts) Descriptor() ([]byte, []int)
func (*EventCounts) GetMapReasonToCount ¶
func (m *EventCounts) GetMapReasonToCount() map[string]int32
func (*EventCounts) ProtoMessage ¶
func (*EventCounts) ProtoMessage()
func (*EventCounts) Reset ¶
func (m *EventCounts) Reset()
func (*EventCounts) String ¶
func (m *EventCounts) String() string
func (*EventCounts) XXX_DiscardUnknown ¶
func (m *EventCounts) XXX_DiscardUnknown()
func (*EventCounts) XXX_Marshal ¶
func (m *EventCounts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EventCounts) XXX_Merge ¶
func (m *EventCounts) XXX_Merge(src proto.Message)
func (*EventCounts) XXX_Size ¶
func (m *EventCounts) XXX_Size() int
func (*EventCounts) XXX_Unmarshal ¶
func (m *EventCounts) XXX_Unmarshal(b []byte) error
type KeyType ¶
type KeyType struct {
PartitionId string
}
func (*KeyType) GetTestKey ¶
func (*KeyType) GetTestValue ¶
func (*KeyType) SetPartitionId ¶
func (*KeyType) SetTestKeys ¶
func (*KeyType) SetTestValue ¶
func (*KeyType) ValidateKey ¶
type KubeWatchResult ¶
type KubeWatchResult struct { Timestamp *timestamp.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` WatchType KubeWatchResult_WatchType `protobuf:"varint,3,opt,name=watchType,proto3,enum=typed.KubeWatchResult_WatchType" json:"watchType,omitempty"` Payload string `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*KubeWatchResult) Descriptor ¶
func (*KubeWatchResult) Descriptor() ([]byte, []int)
func (*KubeWatchResult) GetKind ¶
func (m *KubeWatchResult) GetKind() string
func (*KubeWatchResult) GetPayload ¶
func (m *KubeWatchResult) GetPayload() string
func (*KubeWatchResult) GetTimestamp ¶
func (m *KubeWatchResult) GetTimestamp() *timestamp.Timestamp
func (*KubeWatchResult) GetWatchType ¶
func (m *KubeWatchResult) GetWatchType() KubeWatchResult_WatchType
func (*KubeWatchResult) ProtoMessage ¶
func (*KubeWatchResult) ProtoMessage()
func (*KubeWatchResult) Reset ¶
func (m *KubeWatchResult) Reset()
func (*KubeWatchResult) String ¶
func (m *KubeWatchResult) String() string
func (*KubeWatchResult) XXX_DiscardUnknown ¶
func (m *KubeWatchResult) XXX_DiscardUnknown()
func (*KubeWatchResult) XXX_Marshal ¶
func (m *KubeWatchResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*KubeWatchResult) XXX_Merge ¶
func (m *KubeWatchResult) XXX_Merge(src proto.Message)
func (*KubeWatchResult) XXX_Size ¶
func (m *KubeWatchResult) XXX_Size() int
func (*KubeWatchResult) XXX_Unmarshal ¶
func (m *KubeWatchResult) XXX_Unmarshal(b []byte) error
type KubeWatchResultTable ¶
type KubeWatchResultTable struct {
// contains filtered or unexported fields
}
func OpenKubeWatchResultTable ¶
func OpenKubeWatchResultTable() *KubeWatchResultTable
func (*KubeWatchResultTable) Get ¶
func (t *KubeWatchResultTable) Get(txn badgerwrap.Txn, key string) (*KubeWatchResult, error)
func (*KubeWatchResultTable) GetAllKeysForGivenPartitions ¶
func (t *KubeWatchResultTable) GetAllKeysForGivenPartitions(db badgerwrap.DB, key *WatchTableKey, maxNumberOfKeys int, lookBack int, keyPrefix string) []string
Return all keys in all partitions in the given a lookback period
func (*KubeWatchResultTable) GetMaxKey ¶
func (t *KubeWatchResultTable) GetMaxKey(txn badgerwrap.Txn) (bool, string)
func (*KubeWatchResultTable) GetMaxPartition ¶
func (t *KubeWatchResultTable) GetMaxPartition(txn badgerwrap.Txn) (bool, string)
func (*KubeWatchResultTable) GetMinKey ¶
func (t *KubeWatchResultTable) GetMinKey(txn badgerwrap.Txn) (bool, string)
func (*KubeWatchResultTable) GetMinMaxPartitions ¶
func (t *KubeWatchResultTable) GetMinMaxPartitions(txn badgerwrap.Txn) (bool, string, string)
func (*KubeWatchResultTable) GetMinPartition ¶
func (t *KubeWatchResultTable) GetMinPartition(txn badgerwrap.Txn) (bool, string)
func (*KubeWatchResultTable) GetPartitionsFromTimeRange ¶
func (t *KubeWatchResultTable) GetPartitionsFromTimeRange(txn badgerwrap.Txn, startTime time.Time, endTime time.Time) ([]string, error)
todo: need to add unit test
func (*KubeWatchResultTable) GetPreviousKey ¶
func (t *KubeWatchResultTable) GetPreviousKey(txn badgerwrap.Txn, key *WatchTableKey, keyComparator *WatchTableKey) (*WatchTableKey, error)
func (*KubeWatchResultTable) GetUniquePartitionList ¶
func (t *KubeWatchResultTable) GetUniquePartitionList(txn badgerwrap.Txn) ([]string, error)
func (*KubeWatchResultTable) RangeRead ¶
func (t *KubeWatchResultTable) RangeRead(txn badgerwrap.Txn, keyPrefix *WatchTableKey, keyPredicateFn func(string) bool, valPredicateFn func(*KubeWatchResult) bool, startTime time.Time, endTime time.Time) (map[WatchTableKey]*KubeWatchResult, RangeReadStats, error)
func (*KubeWatchResultTable) Set ¶
func (t *KubeWatchResultTable) Set(txn badgerwrap.Txn, key string, value *KubeWatchResult) error
type KubeWatchResult_WatchType ¶
type KubeWatchResult_WatchType int32
const ( KubeWatchResult_ADD KubeWatchResult_WatchType = 0 KubeWatchResult_UPDATE KubeWatchResult_WatchType = 1 KubeWatchResult_DELETE KubeWatchResult_WatchType = 2 )
func (KubeWatchResult_WatchType) EnumDescriptor ¶
func (KubeWatchResult_WatchType) EnumDescriptor() ([]byte, []int)
func (KubeWatchResult_WatchType) String ¶
func (x KubeWatchResult_WatchType) String() string
type MinMaxPartitionsGetter ¶
type MinMaxPartitionsGetter interface {
GetMinMaxPartitions(badgerwrap.Txn) (bool, string, string)
}
type RangeReadStats ¶
type RangeReadStats struct { TableName string PartitionCount int RowsVisitedCount int RowsPassedKeyPredicateCount int RowsPassedValuePredicateCount int Elapsed time.Duration }
func (RangeReadStats) Log ¶
func (stats RangeReadStats) Log(requestId string)
type ResourceEventCounts ¶
type ResourceEventCounts struct { MapMinToEvents map[int64]*EventCounts `` /* 170-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ResourceEventCounts) Descriptor ¶
func (*ResourceEventCounts) Descriptor() ([]byte, []int)
func (*ResourceEventCounts) GetMapMinToEvents ¶
func (m *ResourceEventCounts) GetMapMinToEvents() map[int64]*EventCounts
func (*ResourceEventCounts) ProtoMessage ¶
func (*ResourceEventCounts) ProtoMessage()
func (*ResourceEventCounts) Reset ¶
func (m *ResourceEventCounts) Reset()
func (*ResourceEventCounts) String ¶
func (m *ResourceEventCounts) String() string
func (*ResourceEventCounts) XXX_DiscardUnknown ¶
func (m *ResourceEventCounts) XXX_DiscardUnknown()
func (*ResourceEventCounts) XXX_Marshal ¶
func (m *ResourceEventCounts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ResourceEventCounts) XXX_Merge ¶
func (m *ResourceEventCounts) XXX_Merge(src proto.Message)
func (*ResourceEventCounts) XXX_Size ¶
func (m *ResourceEventCounts) XXX_Size() int
func (*ResourceEventCounts) XXX_Unmarshal ¶
func (m *ResourceEventCounts) XXX_Unmarshal(b []byte) error
type ResourceEventCountsTable ¶
type ResourceEventCountsTable struct {
// contains filtered or unexported fields
}
func OpenResourceEventCountsTable ¶
func OpenResourceEventCountsTable() *ResourceEventCountsTable
func (*ResourceEventCountsTable) Get ¶
func (t *ResourceEventCountsTable) Get(txn badgerwrap.Txn, key string) (*ResourceEventCounts, error)
func (*ResourceEventCountsTable) GetAllKeysForGivenPartitions ¶
func (t *ResourceEventCountsTable) GetAllKeysForGivenPartitions(db badgerwrap.DB, key *EventCountKey, maxNumberOfKeys int, lookBack int, keyPrefix string) []string
Return all keys in all partitions in the given a lookback period
func (*ResourceEventCountsTable) GetMaxKey ¶
func (t *ResourceEventCountsTable) GetMaxKey(txn badgerwrap.Txn) (bool, string)
func (*ResourceEventCountsTable) GetMaxPartition ¶
func (t *ResourceEventCountsTable) GetMaxPartition(txn badgerwrap.Txn) (bool, string)
func (*ResourceEventCountsTable) GetMinKey ¶
func (t *ResourceEventCountsTable) GetMinKey(txn badgerwrap.Txn) (bool, string)
func (*ResourceEventCountsTable) GetMinMaxPartitions ¶
func (t *ResourceEventCountsTable) GetMinMaxPartitions(txn badgerwrap.Txn) (bool, string, string)
func (*ResourceEventCountsTable) GetMinPartition ¶
func (t *ResourceEventCountsTable) GetMinPartition(txn badgerwrap.Txn) (bool, string)
func (*ResourceEventCountsTable) GetOrDefault ¶
func (t *ResourceEventCountsTable) GetOrDefault(txn badgerwrap.Txn, key string) (*ResourceEventCounts, error)
func (*ResourceEventCountsTable) GetPartitionsFromTimeRange ¶
func (t *ResourceEventCountsTable) GetPartitionsFromTimeRange(txn badgerwrap.Txn, startTime time.Time, endTime time.Time) ([]string, error)
todo: need to add unit test
func (*ResourceEventCountsTable) GetPreviousKey ¶
func (t *ResourceEventCountsTable) GetPreviousKey(txn badgerwrap.Txn, key *EventCountKey, keyComparator *EventCountKey) (*EventCountKey, error)
func (*ResourceEventCountsTable) GetUniquePartitionList ¶
func (t *ResourceEventCountsTable) GetUniquePartitionList(txn badgerwrap.Txn) ([]string, error)
func (*ResourceEventCountsTable) RangeRead ¶
func (t *ResourceEventCountsTable) RangeRead(txn badgerwrap.Txn, keyPrefix *EventCountKey, keyPredicateFn func(string) bool, valPredicateFn func(*ResourceEventCounts) bool, startTime time.Time, endTime time.Time) (map[EventCountKey]*ResourceEventCounts, RangeReadStats, error)
func (*ResourceEventCountsTable) Set ¶
func (t *ResourceEventCountsTable) Set(txn badgerwrap.Txn, key string, value *ResourceEventCounts) error
type ResourceSummary ¶
type ResourceSummary struct { FirstSeen *timestamp.Timestamp `protobuf:"bytes,1,opt,name=firstSeen,proto3" json:"firstSeen,omitempty"` LastSeen *timestamp.Timestamp `protobuf:"bytes,2,opt,name=lastSeen,proto3" json:"lastSeen,omitempty"` CreateTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=createTime,proto3" json:"createTime,omitempty"` DeletedAtEnd bool `protobuf:"varint,4,opt,name=deletedAtEnd,proto3" json:"deletedAtEnd,omitempty"` // List of relationships. Direction does not matter. Examples: // A Pod has a relationship to its namespace, ReplicaSet or StatefulSet, node // A ReplicaSet has a relationship to deployment and namespace // A node might have a relationship to a rack (maybe latery, as this is virtual) // We dont need relationships in both directions. We can union them at query time // Uses same key format here as this overall table Relationships []string `protobuf:"bytes,5,rep,name=relationships,proto3" json:"relationships,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Enough information to draw a timeline and hierarchy Key: /<kind>/<namespace>/<name>/<uid>
func (*ResourceSummary) Descriptor ¶
func (*ResourceSummary) Descriptor() ([]byte, []int)
func (*ResourceSummary) GetCreateTime ¶
func (m *ResourceSummary) GetCreateTime() *timestamp.Timestamp
func (*ResourceSummary) GetDeletedAtEnd ¶
func (m *ResourceSummary) GetDeletedAtEnd() bool
func (*ResourceSummary) GetFirstSeen ¶
func (m *ResourceSummary) GetFirstSeen() *timestamp.Timestamp
func (*ResourceSummary) GetLastSeen ¶
func (m *ResourceSummary) GetLastSeen() *timestamp.Timestamp
func (*ResourceSummary) GetRelationships ¶
func (m *ResourceSummary) GetRelationships() []string
func (*ResourceSummary) ProtoMessage ¶
func (*ResourceSummary) ProtoMessage()
func (*ResourceSummary) Reset ¶
func (m *ResourceSummary) Reset()
func (*ResourceSummary) String ¶
func (m *ResourceSummary) String() string
func (*ResourceSummary) XXX_DiscardUnknown ¶
func (m *ResourceSummary) XXX_DiscardUnknown()
func (*ResourceSummary) XXX_Marshal ¶
func (m *ResourceSummary) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ResourceSummary) XXX_Merge ¶
func (m *ResourceSummary) XXX_Merge(src proto.Message)
func (*ResourceSummary) XXX_Size ¶
func (m *ResourceSummary) XXX_Size() int
func (*ResourceSummary) XXX_Unmarshal ¶
func (m *ResourceSummary) XXX_Unmarshal(b []byte) error
type ResourceSummaryKey ¶
type ResourceSummaryKey struct { PartitionId string Kind string Namespace string Name string Uid string }
func NewResourceSummaryKey ¶
func NewResourceSummaryKeyComparator ¶
func NewResourceSummaryKeyComparator(kind string, namespace string, name string, uid string) *ResourceSummaryKey
func (*ResourceSummaryKey) Parse ¶
func (k *ResourceSummaryKey) Parse(key string) error
func (*ResourceSummaryKey) SetPartitionId ¶
func (k *ResourceSummaryKey) SetPartitionId(newPartitionId string)
func (*ResourceSummaryKey) String ¶
func (k *ResourceSummaryKey) String() string
todo: need to make sure it can work as keyPrefix when some fields are empty
func (*ResourceSummaryKey) TableName ¶
func (*ResourceSummaryKey) TableName() string
func (*ResourceSummaryKey) ValidateKey ¶
func (*ResourceSummaryKey) ValidateKey(key string) error
type ResourceSummaryTable ¶
type ResourceSummaryTable struct {
// contains filtered or unexported fields
}
func OpenResourceSummaryTable ¶
func OpenResourceSummaryTable() *ResourceSummaryTable
func (*ResourceSummaryTable) Get ¶
func (t *ResourceSummaryTable) Get(txn badgerwrap.Txn, key string) (*ResourceSummary, error)
func (*ResourceSummaryTable) GetAllKeysForGivenPartitions ¶
func (t *ResourceSummaryTable) GetAllKeysForGivenPartitions(db badgerwrap.DB, key *ResourceSummaryKey, maxNumberOfKeys int, lookBack int, keyPrefix string) []string
Return all keys in all partitions in the given a lookback period
func (*ResourceSummaryTable) GetMaxKey ¶
func (t *ResourceSummaryTable) GetMaxKey(txn badgerwrap.Txn) (bool, string)
func (*ResourceSummaryTable) GetMaxPartition ¶
func (t *ResourceSummaryTable) GetMaxPartition(txn badgerwrap.Txn) (bool, string)
func (*ResourceSummaryTable) GetMinKey ¶
func (t *ResourceSummaryTable) GetMinKey(txn badgerwrap.Txn) (bool, string)
func (*ResourceSummaryTable) GetMinMaxPartitions ¶
func (t *ResourceSummaryTable) GetMinMaxPartitions(txn badgerwrap.Txn) (bool, string, string)
func (*ResourceSummaryTable) GetMinPartition ¶
func (t *ResourceSummaryTable) GetMinPartition(txn badgerwrap.Txn) (bool, string)
func (*ResourceSummaryTable) GetPartitionsFromTimeRange ¶
func (t *ResourceSummaryTable) GetPartitionsFromTimeRange(txn badgerwrap.Txn, startTime time.Time, endTime time.Time) ([]string, error)
todo: need to add unit test
func (*ResourceSummaryTable) GetPreviousKey ¶
func (t *ResourceSummaryTable) GetPreviousKey(txn badgerwrap.Txn, key *ResourceSummaryKey, keyComparator *ResourceSummaryKey) (*ResourceSummaryKey, error)
func (*ResourceSummaryTable) GetUniquePartitionList ¶
func (t *ResourceSummaryTable) GetUniquePartitionList(txn badgerwrap.Txn) ([]string, error)
func (*ResourceSummaryTable) RangeRead ¶
func (t *ResourceSummaryTable) RangeRead(txn badgerwrap.Txn, keyPrefix *ResourceSummaryKey, keyPredicateFn func(string) bool, valPredicateFn func(*ResourceSummary) bool, startTime time.Time, endTime time.Time) (map[ResourceSummaryKey]*ResourceSummary, RangeReadStats, error)
func (*ResourceSummaryTable) Set ¶
func (t *ResourceSummaryTable) Set(txn badgerwrap.Txn, key string, value *ResourceSummary) error
type Tables ¶
type Tables interface { ResourceSummaryTable() *ResourceSummaryTable EventCountTable() *ResourceEventCountsTable WatchTable() *KubeWatchResultTable WatchActivityTable() *WatchActivityTable Db() badgerwrap.DB GetMinAndMaxPartition() (bool, string, string, error) GetTableNames() []string GetTables() []interface{} GetMinAndMaxPartitionWithTxn(badgerwrap.Txn) (bool, string, string) }
func NewTableList ¶
func NewTableList(db badgerwrap.DB) Tables
type ValueType ¶
type ValueType struct { }
func (*ValueType) ProtoMessage ¶
func (p *ValueType) ProtoMessage()
type ValueTypeTable ¶
type ValueTypeTable struct {
// contains filtered or unexported fields
}
func OpenValueTypeTable ¶
func OpenValueTypeTable() *ValueTypeTable
func (*ValueTypeTable) Get ¶
func (t *ValueTypeTable) Get(txn badgerwrap.Txn, key string) (*ValueType, error)
func (*ValueTypeTable) GetMaxKey ¶
func (t *ValueTypeTable) GetMaxKey(txn badgerwrap.Txn) (bool, string)
func (*ValueTypeTable) GetMinKey ¶
func (t *ValueTypeTable) GetMinKey(txn badgerwrap.Txn) (bool, string)
func (*ValueTypeTable) GetMinMaxPartitions ¶
func (t *ValueTypeTable) GetMinMaxPartitions(txn badgerwrap.Txn) (bool, string, string)
func (*ValueTypeTable) GetPartitionsFromTimeRange ¶
func (t *ValueTypeTable) GetPartitionsFromTimeRange(txn badgerwrap.Txn, startTime time.Time, endTime time.Time) ([]string, error)
todo: need to add unit test
func (*ValueTypeTable) GetPreviousKey ¶
func (t *ValueTypeTable) GetPreviousKey(txn badgerwrap.Txn, key *KeyType, keyComparator *KeyType) (*KeyType, error)
func (*ValueTypeTable) GetUniquePartitionList ¶
func (t *ValueTypeTable) GetUniquePartitionList(txn badgerwrap.Txn) ([]string, error)
func (*ValueTypeTable) Set ¶
func (t *ValueTypeTable) Set(txn badgerwrap.Txn, key string, value *ValueType) error
type WatchActivity ¶
type WatchActivity struct { // List of timestamps where `watch` event did not contain changes from previous event NoChangeAt []int64 `protobuf:"varint,1,rep,packed,name=NoChangeAt,proto3" json:"NoChangeAt,omitempty"` // List of timestamps where 'watch' event contained a change from previous event ChangedAt []int64 `protobuf:"varint,2,rep,packed,name=ChangedAt,proto3" json:"ChangedAt,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Track when 'watch' occurred for a resource within partition
func (*WatchActivity) Descriptor ¶
func (*WatchActivity) Descriptor() ([]byte, []int)
func (*WatchActivity) GetChangedAt ¶
func (m *WatchActivity) GetChangedAt() []int64
func (*WatchActivity) GetNoChangeAt ¶
func (m *WatchActivity) GetNoChangeAt() []int64
func (*WatchActivity) ProtoMessage ¶
func (*WatchActivity) ProtoMessage()
func (*WatchActivity) Reset ¶
func (m *WatchActivity) Reset()
func (*WatchActivity) String ¶
func (m *WatchActivity) String() string
func (*WatchActivity) XXX_DiscardUnknown ¶
func (m *WatchActivity) XXX_DiscardUnknown()
func (*WatchActivity) XXX_Marshal ¶
func (m *WatchActivity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*WatchActivity) XXX_Merge ¶
func (m *WatchActivity) XXX_Merge(src proto.Message)
func (*WatchActivity) XXX_Size ¶
func (m *WatchActivity) XXX_Size() int
func (*WatchActivity) XXX_Unmarshal ¶
func (m *WatchActivity) XXX_Unmarshal(b []byte) error
type WatchActivityKey ¶
type WatchActivityKey struct { PartitionId string Kind string Namespace string Name string Uid string }
func NewWatchActivityKey ¶
func NewWatchActivityKeyComparator ¶
func NewWatchActivityKeyComparator(kind string, namespace string, name string, uid string) *WatchActivityKey
func (*WatchActivityKey) Parse ¶
func (k *WatchActivityKey) Parse(key string) error
func (*WatchActivityKey) SetPartitionId ¶
func (k *WatchActivityKey) SetPartitionId(newPartitionId string)
func (*WatchActivityKey) String ¶
func (k *WatchActivityKey) String() string
todo: need to make sure it can work as keyPrefix when some fields are empty
func (*WatchActivityKey) TableName ¶
func (*WatchActivityKey) TableName() string
func (*WatchActivityKey) ValidateKey ¶
func (*WatchActivityKey) ValidateKey(key string) error
type WatchActivityTable ¶
type WatchActivityTable struct {
// contains filtered or unexported fields
}
func OpenWatchActivityTable ¶
func OpenWatchActivityTable() *WatchActivityTable
func (*WatchActivityTable) Get ¶
func (t *WatchActivityTable) Get(txn badgerwrap.Txn, key string) (*WatchActivity, error)
func (*WatchActivityTable) GetAllKeysForGivenPartitions ¶
func (t *WatchActivityTable) GetAllKeysForGivenPartitions(db badgerwrap.DB, key *WatchActivityKey, maxNumberOfKeys int, lookBack int, keyPrefix string) []string
Return all keys in all partitions in the given a lookback period
func (*WatchActivityTable) GetMaxKey ¶
func (t *WatchActivityTable) GetMaxKey(txn badgerwrap.Txn) (bool, string)
func (*WatchActivityTable) GetMaxPartition ¶
func (t *WatchActivityTable) GetMaxPartition(txn badgerwrap.Txn) (bool, string)
func (*WatchActivityTable) GetMinKey ¶
func (t *WatchActivityTable) GetMinKey(txn badgerwrap.Txn) (bool, string)
func (*WatchActivityTable) GetMinMaxPartitions ¶
func (t *WatchActivityTable) GetMinMaxPartitions(txn badgerwrap.Txn) (bool, string, string)
func (*WatchActivityTable) GetMinPartition ¶
func (t *WatchActivityTable) GetMinPartition(txn badgerwrap.Txn) (bool, string)
func (*WatchActivityTable) GetOrDefault ¶
func (t *WatchActivityTable) GetOrDefault(txn badgerwrap.Txn, key string) (*WatchActivity, error)
func (*WatchActivityTable) GetPartitionsFromTimeRange ¶
func (t *WatchActivityTable) GetPartitionsFromTimeRange(txn badgerwrap.Txn, startTime time.Time, endTime time.Time) ([]string, error)
todo: need to add unit test
func (*WatchActivityTable) GetPreviousKey ¶
func (t *WatchActivityTable) GetPreviousKey(txn badgerwrap.Txn, key *WatchActivityKey, keyComparator *WatchActivityKey) (*WatchActivityKey, error)
func (*WatchActivityTable) GetUniquePartitionList ¶
func (t *WatchActivityTable) GetUniquePartitionList(txn badgerwrap.Txn) ([]string, error)
func (*WatchActivityTable) RangeRead ¶
func (t *WatchActivityTable) RangeRead(txn badgerwrap.Txn, keyPrefix *WatchActivityKey, keyPredicateFn func(string) bool, valPredicateFn func(*WatchActivity) bool, startTime time.Time, endTime time.Time) (map[WatchActivityKey]*WatchActivity, RangeReadStats, error)
func (*WatchActivityTable) Set ¶
func (t *WatchActivityTable) Set(txn badgerwrap.Txn, key string, value *WatchActivity) error
type WatchTableKey ¶
type WatchTableKey struct { PartitionId string Kind string Namespace string Name string Timestamp time.Time }
func NewWatchTableKey ¶
func (*WatchTableKey) IsNameAlreadyDelimited ¶
func (k *WatchTableKey) IsNameAlreadyDelimited() bool
func (*WatchTableKey) Parse ¶
func (k *WatchTableKey) Parse(key string) error
func (*WatchTableKey) SetPartitionId ¶
func (k *WatchTableKey) SetPartitionId(newPartitionId string)
func (*WatchTableKey) String ¶
func (k *WatchTableKey) String() string
todo: need to make sure it can work as keyPrefix when some fields are empty
func (*WatchTableKey) TableName ¶
func (*WatchTableKey) TableName() string
func (*WatchTableKey) ValidateKey ¶
func (*WatchTableKey) ValidateKey(key string) error