mono

package
v0.0.0-...-2e18fc9 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MODIFIED is an enum describing that a service has been modified
	MODIFIED = comment("modified")
	// UNMODIFIED is an enum describing that a service is unmodified
	UNMODIFIED = comment("unmodified")
	// REMOVED is an enum describing that a service has been removed
	REMOVED = comment("removed")
	// NEW is an enum describing that a service is new
	NEW = comment("new")
)
View Source
const (
	// Binary is the default name out an outputted binary
	Binary = "app"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ServicePath string `json:"services,omitempty"`
	BuildCMD    string `json:"cmd,omitempty"`
}

Config is the monorepo service configuration

func (Config) BuildArgs

func (c Config) BuildArgs() (string, []string)

BuildArgs returns the command and arguments required to build a service

func (Config) Validate

func (c Config) Validate() error

Validate validates the config

type Meta

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

Meta represents the metadata of a monorepo

func NewMeta

func NewMeta(repo Repository, c Config) *Meta

NewMeta returns a new Meta instance

func (Meta) Diff

func (m Meta) Diff(base, compare string) ([]*ServiceDiff, error)

Diff returns a slice of services compared across two git references

func (Meta) Services

func (m Meta) Services(reference string) ([]*Service, error)

Services returns all services for a given reference in the monorepo

type Repository

type Repository interface {
	Checkout(ref string) (string, error)
	LocalPath() string
	Close() error
}

Repository is an interface

func NewLocal

func NewLocal(path string) (Repository, error)

NewLocal uses a local git repository

func NewRemote

func NewRemote(url string) (Repository, error)

NewRemote clones a remote git repository

type Service

type Service struct {
	Name      string `json:"name"`
	Path      string `json:"path"`
	Checksum  string `json:"checksum"`
	Reference string `json:"reference"`
}

Service is a description of a service

type ServiceDiff

type ServiceDiff struct {
	Name    string   `json:"name"`
	Changed bool     `json:"changed"`
	Comment comment  `json:"comment"`
	Base    *Service `json:"base"`
	Compare *Service `json:"compare"`
}

ServiceDiff is a description of a service compared between two references

Jump to

Keyboard shortcuts

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