patch

package
v0.8.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyIOStreamPatch added in v0.6.1

func ApplyIOStreamPatch(oldBin io.Reader, patchf io.Reader, newBin io.Writer) error

writes in place the result to the newBin io.Writer

func ApplyPatch

func ApplyPatch(outdatedBytes, patch []byte) ([]byte, error)

func GenerateIOStreamPatch added in v0.6.1

func GenerateIOStreamPatch(oldBin io.Reader, newBin io.Reader, patchf io.Writer) error

writes in place the result to the patchf io.Writer

func GeneratePatch

func GeneratePatch(outdatedBytes, newestBytes []byte) ([]byte, error)

func PatchWith

func PatchWith(
	ctx context.Context,
	config v1beta1.PluginsSpec,
	receivedManifests *controlv1.ManifestList,
	lg *zap.SugaredLogger,
	gatewaySyncClient controlv1.PluginManifestClient,
) (chan struct{}, error)

digests must match after the patchops are processed, not after the patch is calculated

Types

type FilesystemPluginSyncServer

type FilesystemPluginSyncServer struct {
	controlv1.UnsafePluginManifestServer
	Logger *zap.SugaredLogger
	Config v1beta1.PluginsSpec
	// contains filtered or unexported fields
}

func (*FilesystemPluginSyncServer) GetPluginManifests

func (*FilesystemPluginSyncServer) SendManifestsOrKnownPatch

func (f *FilesystemPluginSyncServer) SendManifestsOrKnownPatch(
	ctx context.Context,
	theirManifestMetadata *controlv1.ManifestMetadataList,
) (*controlv1.ManifestList, error)

func (*FilesystemPluginSyncServer) StreamServerInterceptor

func (f *FilesystemPluginSyncServer) StreamServerInterceptor() grpc.StreamServerInterceptor

func (*FilesystemPluginSyncServer) UploadPatch

type InMemoryCache

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

func (*InMemoryCache) Get

func (c *InMemoryCache) Get(pluginName, oldRevision, newRevision string) ([]byte, error)

func (*InMemoryCache) Key

func (c *InMemoryCache) Key(pluginName, oldRevision, newRevision string) string

func (*InMemoryCache) Put

func (c *InMemoryCache) Put(pluginName, oldRevision, newRevision string, patch []byte) error

type PatchCache

type PatchCache interface {
	Get(pluginName, oldRevision, newRevision string) ([]byte, error)
	Put(pluginName, oldRevision, newRevision string, patch []byte) error
	Key(pluginName, oldRevision, newRevision string) string
}

func NewInMemoryCache

func NewInMemoryCache() PatchCache

type ZstdCompressor

type ZstdCompressor struct{}

func (ZstdCompressor) Compress

func (c ZstdCompressor) Compress(w io.Writer) (io.WriteCloser, error)

func (ZstdCompressor) Decompress

func (c ZstdCompressor) Decompress(r io.Reader) (io.Reader, error)

func (ZstdCompressor) Name

func (c ZstdCompressor) Name() string

Jump to

Keyboard shortcuts

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