ifaces

package
v0.4.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code interface {
	// Path returns the absolute path of this coder
	Path() string

	// Projects returns the projects in this coder
	Projects() []Project

	// GetProjectByRelativePath returns a project identified by it's relative path to the repositories directory.
	GetProjectByRelativePath(string) (Project, error)

	// Clone clones url as the new project. Will automatically compute the import
	// path from the given URL.
	Clone(url string) error

	// GetProjectByAbsolutePath returns the project corresponding to the absolute
	// path.
	GetProjectByAbsolutePath(absolutePath string) (Project, error)

	// Scan scans the code path.
	Scan() error

	// RepositoriesDir returns the absolute path to the repositories directory.
	RepositoriesDir() string

	// StoriesDir returns the path to the stories directory.
	StoriesDir() string

	// HookPath returns the absolute path to the hooks directory.
	HookPath() string
}

Code defines the code interface code/ |-- repositories | | |-- go.import.path |-- stories | |-- STORY-123 | | |-- go.import.path

type Project

type Project interface {
	// CreateStory creates the story path for this project.
	CreateStory(s Story) error

	// Path returns the absolute path to the repository or the story for this project.
	Path(s Story) string

	// String returns the name of the project as found in the filesystem
	String() string

	// ListPullRequests returns the list of pull requests
	ListPullRequests(*github.Client) ([]*github.PullRequest, error)

	// Code returns the code this project is attached to
	Code() Code
}

Project defines the project interface

type Story

type Story interface {
	// SetName sets the name of the story.
	SetName(string)

	// SetBranchName sets the name of the branch that will be used to create
	// stories for projects.
	SetBranchName(string)

	// GetName returns the name of the story
	GetName() string

	// GetBranchName returns the name of the branch of this story
	GetBranchName() string

	// GetCreatedAt returns the timestamp when this story was created
	GetCreatedAt() time.Time

	// Save saves the story in the data directory.
	Save() error

	// Remove saves the story in the data directory.
	Remove() error
}

Story defines the story interface

Jump to

Keyboard shortcuts

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