cache

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACLCache

type ACLCache struct {
}

ACLCache type

func (ACLCache) Read

func (a ACLCache) Read(project, service, aclID string, client *aiven.Client) (acl aiven.KafkaACL, err error)

Read populates the cache if it doesn't exist, and reads the required acl. An aiven.Error with status 404 is returned upon cache miss

func (ACLCache) Refresh

func (a ACLCache) Refresh(project, service string, client *aiven.Client) error

Refresh refreshes the ACL cache

type TopicCache

type TopicCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

TopicCache represents Kafka Topics cache based on Service and Project identifiers

func GetTopicCache added in v1.2.1

func GetTopicCache() *TopicCache

GetTopicCache gets a global Kafka Topics Cache

func NewTopicCache added in v1.2.1

func NewTopicCache() *TopicCache

NewTopicCache creates new global instance of Kafka Topic Cache

func (*TopicCache) DeleteByProjectAndServiceName added in v1.2.1

func (t *TopicCache) DeleteByProjectAndServiceName(projectName, serviceName string)

DeleteByProjectAndServiceName deletes the cache value for a key which is a combination of Project and Service names.

func (*TopicCache) LoadByProjectAndServiceName added in v1.2.1

func (t *TopicCache) LoadByProjectAndServiceName(projectName, serviceName string) (map[string]aiven.KafkaTopic, bool)

LoadByProjectAndServiceName returns a list of Kafka Topics stored in the cache for a given Project and Service names, or nil if no value is present. The ok result indicates whether value was found in the map.

func (*TopicCache) LoadByTopicName added in v1.2.1

func (t *TopicCache) LoadByTopicName(projectName, serviceName, topicName string) (aiven.KafkaTopic, bool)

LoadByTopicName returns a list of Kafka Topics stored in the cache for a given Project and Service names, or nil if no value is present. The ok result indicates whether value was found in the map.

func (*TopicCache) StoreByProjectAndServiceName added in v1.2.1

func (t *TopicCache) StoreByProjectAndServiceName(projectName, serviceName string, list []*aiven.KafkaListTopic)

StoreByProjectAndServiceName sets the values for a Project name and Service name key.

Jump to

Keyboard shortcuts

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