metadata

package
v0.0.0-...-d88ec87 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BucketIndexRestService

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

BucketIndexRestService is an implementation of BucketMetaDataFetcher that talks to a rest service assuming it's supporint the requried protocol, meaning `/bucket/{bucketName}` returns the bucket metadta

func (*BucketIndexRestService) Fetch

func (service *BucketIndexRestService) Fetch(bucketLocation *BucketLocation) (*BucketMetaData, error)

Fetch fetches the bucket metadata via rest API

type BucketIndexRestServiceFactory

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

BucketIndexRestServiceFactory creates instances of BucketIndexRestService

func (*BucketIndexRestServiceFactory) Create

Create creates an instance of FakeBucketMetaDataFetcher

type BucketLocation

type BucketLocation struct {
	//Name is the name of the bucket
	Name string
}

BucketLocation describes where to find the bucket

type BucketMetaData

type BucketMetaData struct {
	//Name is the name of the bucket
	Name string
	//IsInternal tells if bucket should be accessed from internal network only
	IsInternal bool
	//Pattern is the pattern that the name of the bucket was matched to
	Pattern string
}

BucketMetaData is akubra-specific metadata about the bucket

type BucketMetaDataCache

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

BucketMetaDataCache is a wrapper that caches the answers given by the wrapped BucketMetaDataFetcher

func (*BucketMetaDataCache) Fetch

func (bucketCache *BucketMetaDataCache) Fetch(bucketLocation *BucketLocation) (*BucketMetaData, error)

Fetch first consults the cache for BucketMetaData and only fetches it when it's not in the cache

type BucketMetaDataCacheConfig

type BucketMetaDataCacheConfig struct {
	//LifeWindow is time after which entry will be invalidated
	LifeWindow time.Duration `yaml:"LifeWindow"`
	//MaxCacheSizeInMB is the hard max that the cache will not exceed
	MaxCacheSizeInMB int `yaml:"MaxCacheSizeInMB"`
	//ShardsCount is the number of shards
	ShardsCount int `yaml:"ShardsCount"`
	//FetcherType is the fetcher that should be used by the cache
	FetcherType string `yaml:"FetcherType"`
	//FetcherProps is the configuration for the fetcher
	FetcherProps map[string]string `yaml:"FetcherProps"`
	//Hasher is the hash function that will be used to hash the keys
	Hasher bigcache.Hasher
}

BucketMetaDataCacheConfig holds the configuration for bucket's cache

type BucketMetaDataFetcher

type BucketMetaDataFetcher interface {
	Fetch(bucketLocation *BucketLocation) (*BucketMetaData, error)
}

BucketMetaDataFetcher fetches metadata by BucketLocation

func NewBucketIndexRestService

func NewBucketIndexRestService(httpClient akubraHttp.Client, endpoint string) BucketMetaDataFetcher

NewBucketIndexRestService creates an instance of BucketIndexRestService

func NewBucketMetaDataCache

func NewBucketMetaDataCache(conf *BucketMetaDataCacheConfig, fetcher BucketMetaDataFetcher) (BucketMetaDataFetcher, error)

NewBucketMetaDataCache wraps the supplies fetcher with a cache layer

func NewBucketMetaDataCacheWithFactory

func NewBucketMetaDataCacheWithFactory(conf *BucketMetaDataCacheConfig) (BucketMetaDataFetcher, error)

NewBucketMetaDataCacheWithFactory uses the factory to create a fetcher

type BucketMetaDataFetcherFactory

type BucketMetaDataFetcherFactory interface {
	Create(config map[string]string) (BucketMetaDataFetcher, error)
}

BucketMetaDataFetcherFactory creates an instance of fecher given using the given config

func NewBucketIndexRestServiceFactory

func NewBucketIndexRestServiceFactory(discoveryClient discovery.Client) BucketMetaDataFetcherFactory

NewBucketIndexRestServiceFactory creates an instance of BucketIndexRestServiceFactory

type FakeBucketMetaDataFetcher

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

FakeBucketMetaDataFetcher always reports bucket as non-internal

func (*FakeBucketMetaDataFetcher) Fetch

func (fetcher *FakeBucketMetaDataFetcher) Fetch(BucketLocation *BucketLocation) (*BucketMetaData, error)

Fetch just returns the BucketMetaData

type FakeBucketMetaDataFetcherFactory

type FakeBucketMetaDataFetcherFactory struct{}

FakeBucketMetaDataFetcherFactory is a fake implementation of BucketMetaDataFetcher that always returns the privacy specified in config

func (*FakeBucketMetaDataFetcherFactory) Create

Create creates an instance of FakeBucketMetaDataFetcher

type Fnv64Hasher

type Fnv64Hasher struct{}

Fnv64Hasher wraps the stdlib hasher to bigcache's Hasher type

func (*Fnv64Hasher) Sum64

func (h *Fnv64Hasher) Sum64(key string) uint64

Sum64 returns a hash for the key

Jump to

Keyboard shortcuts

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