firehose-to-syslog: github.com/cloudfoundry-community/firehose-to-syslog/caching Index | Files | Directories

package caching

import "github.com/cloudfoundry-community/firehose-to-syslog/caching"

Index

Package Files

caching.go caching_boltdb.go caching_cfclientadapter.go caching_easyjson.go caching_lazyfill.go caching_memory.go

Variables

var (
    APP_BUCKET = []byte("AppBucketV2")
)
var (
    // ErrKeyNotFound is returned if value is not found
    ErrKeyNotFound = errors.New("key not found")
)

func IsNeeded Uses

func IsNeeded(wantedEvents string) bool

type App Uses

type App struct {
    Name       string
    Guid       string
    SpaceName  string
    SpaceGuid  string
    OrgName    string
    OrgGuid    string
    IgnoredApp bool
}

func (App) MarshalEasyJSON Uses

func (v App) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (App) MarshalJSON Uses

func (v App) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*App) UnmarshalEasyJSON Uses

func (v *App) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*App) UnmarshalJSON Uses

func (v *App) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type BoltCacheStore Uses

type BoltCacheStore struct {
    Path string
    // contains filtered or unexported fields
}

func (*BoltCacheStore) Close Uses

func (bcs *BoltCacheStore) Close() error

func (*BoltCacheStore) Get Uses

func (bcs *BoltCacheStore) Get(key string, rv interface{}) error

func (*BoltCacheStore) Open Uses

func (bcs *BoltCacheStore) Open() error

func (*BoltCacheStore) Set Uses

func (bcs *BoltCacheStore) Set(key string, val interface{}) error

type CFClientAdapter Uses

type CFClientAdapter struct {
    CF *cfclient.Client
}

func (*CFClientAdapter) DoGet Uses

func (c *CFClientAdapter) DoGet(url string) (io.ReadCloser, error)

type CFSimpleClient Uses

type CFSimpleClient interface {
    DoGet(url string) (io.ReadCloser, error)
}

go:generate counterfeiter . CFSimpleClient

type CacheLazyFill Uses

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

func NewCacheLazyFill Uses

func NewCacheLazyFill(client CFSimpleClient, store CacheStore, config *CacheLazyFillConfig) *CacheLazyFill

func (*CacheLazyFill) FillCache Uses

func (c *CacheLazyFill) FillCache() error

FillCache communicates with the server to enumerate *all* applications and fills the cache

func (*CacheLazyFill) GetApp Uses

func (c *CacheLazyFill) GetApp(appGuid string) (*App, error)

type CacheLazyFillConfig Uses

type CacheLazyFillConfig struct {
    // IgnoreMissingApps no error if an app can't be found
    IgnoreMissingApps bool

    // CacheInvalidateTTL is the approx TTL for cached data. Code will randomly pick between 0.75x and 1.2
    CacheInvalidateTTL time.Duration
    StripAppSuffixes   []string
}

type CacheStore Uses

type CacheStore interface {
    // Open initializes the store
    Open() error

    // Close closes the store
    Close() error

    // Get looks up key, and decodes it into rv.
    // Returns ErrKeyNotFound if not found
    Get(key string, rv interface{}) error

    // Set encodes the value and stores it
    Set(key string, value interface{}) error
}

CacheStore provides a mechanism to persist data After it has been opened, Get / Set are threadsafe

type Caching Uses

type Caching interface {
    FillCache() error
    GetApp(string) (*App, error)
}

go:generate counterfeiter . Caching

type MemoryCacheStore Uses

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

func (*MemoryCacheStore) Close Uses

func (mcs *MemoryCacheStore) Close() error

func (*MemoryCacheStore) Get Uses

func (mcs *MemoryCacheStore) Get(key string, rv interface{}) error

func (*MemoryCacheStore) Open Uses

func (mcs *MemoryCacheStore) Open() error

func (*MemoryCacheStore) Set Uses

func (mcs *MemoryCacheStore) Set(key string, val interface{}) error

Directories

PathSynopsis
cachingfakesCode generated by counterfeiter.

Package caching imports 18 packages (graph) and is imported by 31 packages. Updated 2019-05-26. Refresh now. Tools for package owners.