local

package
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: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Path to a migration history file. Relative to the current working directory.
	Path string `hcl:"path"`
}

Config is a config for local storage.

func (*Config) NewStorage

func (c *Config) NewStorage() (storage.Storage, error)

NewStorage returns a new instance of storage.Storage.

type Storage

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

Storage is a storage.Storage implementation for local file. This was originally intended for debugging purposes, but it can also be used as a workaround if Storage doesn't support your cloud provider. That is, you can manually synchronize local output files to the remote.

func NewStorage

func NewStorage(config *Config) (*Storage, error)

NewStorage returns a new instance of Storage.

func (*Storage) Read

func (s *Storage) Read(ctx context.Context) ([]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.

func (*Storage) Write

func (s *Storage) Write(ctx context.Context, b []byte) error

Write writes migration history data to storage.

Jump to

Keyboard shortcuts

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