codeup

package
v0.0.0-...-a83e0f5 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package codeup implements source.Driver for codeup.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithInstance

func WithInstance(client *devops.Client, option Option) (source.Driver, error)

WithInstance returns a new CodeUp driver instance configured with parameters

Types

type CodeUp

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

CodeUp implements source.Driver for CodeUp.

func (CodeUp) Close

func (s CodeUp) Close() error

Close closes the underlying source instance managed by the driver.

func (CodeUp) First

func (s CodeUp) First() (version uint, err error)

First returns the very first migration version available to the driver.

func (CodeUp) Next

func (s CodeUp) Next(version uint) (nextVersion uint, err error)

Next returns the next version for a given version available to the driver.

func (CodeUp) Open

func (s CodeUp) Open(url string) (source.Driver, error)

Open returns a new driver instance configured with parameters coming from the URL string. Migrate will call this function only once per instance.

func (CodeUp) Prev

func (s CodeUp) Prev(version uint) (prevVersion uint, err error)

Prev returns the previous version for a given version available to the driver.

func (CodeUp) ReadDown

func (s CodeUp) ReadDown(version uint) (r io.ReadCloser, identifier string, err error)

ReadDown returns the DOWN migration body and an identifier that helps finding this migration in the source for a given version.

func (CodeUp) ReadUp

func (s CodeUp) ReadUp(version uint) (r io.ReadCloser, identifier string, err error)

ReadUp returns the UP migration body and an identifier that helps finding this migration in the source for a given version.

type Config

type Config struct {
	ProjectId      string
	OrganizationId string
	AccessToken    string
	Path           string // repo path
	Ref            string // repo ref, default is "master".
}

Config is the configuration setting for the CodeUp driver.

type Option

type Option struct {
	Config  Config
	Headers map[string]*string
	Runtime *service.RuntimeOptions
}

Option is the configuration setting for the CodeUp driver.

func NewOption

func NewOption(c Config) Option

NewOption creates a new Option.

Jump to

Keyboard shortcuts

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