model

package
v0.0.0-...-0452748 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2017 License: MIT Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	Owner string `db:"owner" long:"owner" env:"GITHUB_OWNER" description:"owner of the repository" required:"yes"`

	Name string `db:"name" long:"repository" env:"GITHUB_REPOSITORY" description:"name of the repository" required:"yes"`
}

A Repository is the object being watched by Sauron

func (Repository) String

func (r Repository) String() string

type Update

type Update struct {
	// The timestamp of the commit or release
	Timestamp time.Time `db:"timestamp"`

	// The hash of the commit or release
	SHA string `db:"sha"`
}

Update represents an update to a repository

func (Update) IsNotAfter

func (u Update) IsNotAfter(v Update) bool

IsNotAfter returns true if an update happened before or at the same time as an other update

func (Update) IsZero

func (u Update) IsZero() bool

IsZero returns true when called on the zero-value for Update

type WatchOptions

type WatchOptions struct {
	Repository Repository

	// Restrict to a specific branch
	Branch string `long:"branch" env:"GITHUB_BRANCH" description:"branch to watch in the repository"`

	// Restrict to a specific path
	Path string `long:"path" env:"GITHUB_PATH" description:"path to watch in the repository"`
}

WatchOptions specifies where to look for updates

func (WatchOptions) Validate

func (opts WatchOptions) Validate() error

Validate returns an error when options are invalid, nil otherwise

Jump to

Keyboard shortcuts

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