storage

package module
v0.0.0-...-197930a Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 1 Imported by: 2

README

tfmigrate-storage

This repository maintained the storage implementation of tfmigrate for a while. Initially, this repository was distributed under the MPL2 license with the intention of reusing code fragments from terraform's backend implementation, but this actually did not happen, so we finally reverted to MIT and merged this repository into the tfmigrate repository. For details, see https://github.com/minamijoyo/tfmigrate/issues/146.

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