Documentation ¶
Index ¶
- Variables
- type Store
- func (s *Store) CreateBuild(b *brigade.Build) error
- func (s *Store) GetBuild(id string) (*brigade.Build, error)
- func (s *Store) GetBuildJobs(b *brigade.Build) ([]*brigade.Job, error)
- func (s *Store) GetBuilds() ([]*brigade.Build, error)
- func (s *Store) GetJob(id string) (*brigade.Job, error)
- func (s *Store) GetJobLog(j *brigade.Job) (string, error)
- func (s *Store) GetJobLogStream(j *brigade.Job) (io.ReadCloser, error)
- func (s *Store) GetProject(id string) (*brigade.Project, error)
- func (s *Store) GetProjectBuilds(p *brigade.Project) ([]*brigade.Build, error)
- func (s *Store) GetProjects() ([]*brigade.Project, error)
- func (s *Store) GetWorker(bid string) (*brigade.Worker, error)
- func (s *Store) GetWorkerLog(w *brigade.Worker) (string, error)
- func (s *Store) GetWorkerLogStream(w *brigade.Worker) (io.ReadCloser, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Now is the date used in all stub date fields. Now = time.Now() // StubProject is a Project stub. StubProject = &brigade.Project{ ID: "project-id", Name: "project-name", SharedSecret: "shared-secre3t", Secrets: map[string]string{"key": "value"}, } // StubWorker is a stub Worker. It is used in StubBuild, too. StubWorker = &brigade.Worker{ ID: "worker-id", BuildID: "build-id", ProjectID: "project-id", StartTime: Now, EndTime: Now, ExitCode: 0, Status: brigade.JobSucceeded, } // StubBuild is a stub Build. StubBuild = &brigade.Build{ ID: "build-id", ProjectID: "project-id", Revision: &brigade.Revision{ Commit: "commit", }, Type: "type", Provider: "provider", Payload: []byte("payload"), Script: []byte("script"), Worker: StubWorker, } // StubJob is a stub Job. StubJob = &brigade.Job{ ID: "job-id", Name: "job-name", Image: "image", CreationTime: Now, StartTime: Now, EndTime: Now, ExitCode: 0, Status: brigade.JobSucceeded, } // StubLogData is string data representing a log StubLogData = "Hello World" )
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct { // Project is the project you want returned. Project *brigade.Project // Build is the build you want returned. Build *brigade.Build // Job is the job you want returned. Job *brigade.Job // Worker is the worker you want returned. Worker *brigade.Worker // LogData is the log data you want returned. LogData string }
Store implements the storage.Storage interface, but returns mock data.
func (*Store) CreateBuild ¶
CreateBuild fakes a new build.
func (*Store) GetBuildJobs ¶
GetBuildJobs gets the mock job wrapped in a slice.
func (*Store) GetJobLogStream ¶
GetJobLogStream gets the mock log data as a readcloser
func (*Store) GetProject ¶
GetProject returns the Project
func (*Store) GetProjectBuilds ¶
GetProjectBuilds returns the mock Build wrapped in a slice.
func (*Store) GetProjects ¶
GetProjects gets the mock project wrapped as a slice of projects.
func (*Store) GetWorkerLog ¶
GetWorkerLog gets the mock log data.
func (*Store) GetWorkerLogStream ¶
GetWorkerLogStream gets a readcloser of the mock log data.
Click to show internal directories.
Click to hide internal directories.