Documentation
¶
Overview ¶
Package git implements a state backend that keeps encrypted state on a dedicated branch of a Git repository, for small projects that don't want to set up any cloud storage.
Index ¶
- func New(enc encryption.StateEncryption) backend.Backend
- type Backend
- type Client
- func (c *Client) Delete(ctx context.Context) error
- func (c *Client) Get(ctx context.Context) (*remote.Payload, error)
- func (c *Client) Lock(ctx context.Context, info *statemgr.LockInfo) (string, error)
- func (c *Client) Put(ctx context.Context, data []byte) error
- func (c *Client) Unlock(ctx context.Context, id string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(enc encryption.StateEncryption) backend.Backend
New creates a new backend that stores state in a Git repository.
Types ¶
type Backend ¶
Backend stores state on a branch of a Git repository.
func (*Backend) DeleteWorkspace ¶
DeleteWorkspace removes a workspace's state from the branch. Earlier versions stay in Git's history.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client reads and writes one workspace's state.
func (*Client) Lock ¶
Lock acquires the lock by creating a branch. Git only accepts the push if the branch doesn't exist yet, so exactly one of any number of concurrent runs succeeds.