cache

package
v1.2.41-rc2 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package cache is a generated GoMock package.

Package cache is a generated GoMock package.

Index

Constants

View Source
const (
	GobName = "ocm-cache.gob"
)
View Source
const (
	VersionCacheKey = "Versions"
)

Variables

View Source
var DefaultCacheExpiration = time.Now().Add(30 * time.Minute)

Functions

func ConvertToStringSlice

func ConvertToStringSlice(slice interface{}) ([]string, bool, error)

Types

type Item

type Item struct {
	Object     interface{}
	Expiration time.Time
}

func (Item) Expired

func (item Item) Expired() bool

type MockRosaCache

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

MockRosaCache is a mock of RosaCache interface.

func NewMockRosaCache

func NewMockRosaCache(ctrl *gomock.Controller) *MockRosaCache

NewMockRosaCache creates a new mock instance.

func (*MockRosaCache) Dir

func (m *MockRosaCache) Dir() (string, error)

Dir mocks base method.

func (*MockRosaCache) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRosaCache) Get

func (m *MockRosaCache) Get(k string) (any, bool)

Get mocks base method.

func (*MockRosaCache) Items

func (m *MockRosaCache) Items() map[string]Item

Items mocks base method.

func (*MockRosaCache) Set

func (m *MockRosaCache) Set(k string, x any, d time.Time)

Set mocks base method.

type MockRosaCacheMockRecorder

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

MockRosaCacheMockRecorder is the mock recorder for MockRosaCache.

func (*MockRosaCacheMockRecorder) Dir

Dir indicates an expected call of Dir.

func (*MockRosaCacheMockRecorder) Get

Get indicates an expected call of Get.

func (*MockRosaCacheMockRecorder) Items

func (mr *MockRosaCacheMockRecorder) Items() *gomock.Call

Items indicates an expected call of Items.

func (*MockRosaCacheMockRecorder) Set

func (mr *MockRosaCacheMockRecorder) Set(k, x, d any) *gomock.Call

Set indicates an expected call of Set.

type MockRosaCacheService

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

MockRosaCacheService is a mock of RosaCacheService interface.

func NewMockRosaCacheService

func NewMockRosaCacheService(ctrl *gomock.Controller) *MockRosaCacheService

NewMockRosaCacheService creates a new mock instance.

func (*MockRosaCacheService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRosaCacheService) Get

func (m *MockRosaCacheService) Get(key string) (any, bool)

Get mocks base method.

func (*MockRosaCacheService) LoadCache

func (m *MockRosaCacheService) LoadCache() (RosaCache, error)

LoadCache mocks base method.

func (*MockRosaCacheService) Set

func (m *MockRosaCacheService) Set(key string, value []string) error

Set mocks base method.

type MockRosaCacheServiceMockRecorder

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

MockRosaCacheServiceMockRecorder is the mock recorder for MockRosaCacheService.

func (*MockRosaCacheServiceMockRecorder) Get

Get indicates an expected call of Get.

func (*MockRosaCacheServiceMockRecorder) LoadCache

func (mr *MockRosaCacheServiceMockRecorder) LoadCache() *gomock.Call

LoadCache indicates an expected call of LoadCache.

func (*MockRosaCacheServiceMockRecorder) Set

func (mr *MockRosaCacheServiceMockRecorder) Set(key, value any) *gomock.Call

Set indicates an expected call of Set.

type RosaCache

type RosaCache interface {
	Set(k string, x interface{}, d time.Time)
	Get(k string) (interface{}, bool)
	Items() map[string]Item
	Dir() (string, error)
}

func NewRosaCache

func NewRosaCache(spec RosaCacheSpec) RosaCache

type RosaCacheData

type RosaCacheData struct {
	Data map[string]Item
}

type RosaCacheService

type RosaCacheService interface {
	LoadCache() (RosaCache, error)
	Get(key string) (interface{}, bool)
	Set(key string, value []string) error
}

func NewRosaCacheService

func NewRosaCacheService() (RosaCacheService, error)

type RosaCacheSpec

type RosaCacheSpec struct {
	DefaultExpiration time.Time
}

Jump to

Keyboard shortcuts

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