storage

package
v0.3.23 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	// NewStorage returns a new instance of Storage.
	NewStorage() (Storage, error)
}

Config is an interface of factory method for Storage

type Storage

type Storage interface {
	// Write writes migration history data to storage.
	Write(ctx context.Context, b []byte) error
	// Read reads migration history data from storage.
	// If the key does not exist, it is assumed to be uninitialized and returns
	// an empty array instead of an error.
	Read(ctx context.Context) ([]byte, error)
}

Storage is an abstraction layer for migration history data store. As you know, this is the equivalent of Terraform's backend, but we have implemented it by ourselves not to depend on Terraform internals directly. To support multiple cloud storages, write and read operations are limited to simple byte operations and a domain specific logic should not be included.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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