filemgr

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Overview

Package filemgr defines a Manager for managing files for the controlplane.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFileNameWithBytesHash added in v0.24.0

func GetFileNameWithBytesHash(base string, data []byte) string

GetFileNameWithBytesHash constructs a filename using a base filename and a hash of the data. For example: GetFileNameWithBytesHash("example.txt", []byte{...}) ==> "example-abcd1234.txt"

Types

type Manager

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

A Manager manages files for envoy.

func NewManager

func NewManager(options ...Option) *Manager

NewManager creates a new Manager.

func (*Manager) BytesDataSource

func (mgr *Manager) BytesDataSource(fileName string, data []byte) *envoy_config_core_v3.DataSource

BytesDataSource returns an envoy config data source based on bytes.

func (*Manager) ClearCache

func (mgr *Manager) ClearCache()

ClearCache clears the file cache.

func (*Manager) FileDataSource

func (mgr *Manager) FileDataSource(filePath string) *envoy_config_core_v3.DataSource

FileDataSource returns an envoy config data source based on a file.

type Option

type Option = func(*config)

An Option updates the config.

func WithCacheDir

func WithCacheDir(cacheDir string) Option

WithCacheDir returns an Option that sets the cache dir.

Jump to

Keyboard shortcuts

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