Documentation ¶
Index ¶
- Variables
- type Store
- func (s *Store) CreateBuild(b *brigade.Build) error
- func (s *Store) CreateProject(p *brigade.Project) error
- func (s *Store) DeleteBuild(bid string, options storage.DeleteBuildOptions) error
- func (s *Store) DeleteProject(id string) 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) GetJobLogStreamFollow(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) GetStorageClassNames() ([]string, error)
- func (s *Store) GetWorker(bid string) (*brigade.Worker, error)
- func (s *Store) GetWorkerInitLog(w *brigade.Worker) (string, error)
- func (s *Store) GetWorkerLog(w *brigade.Worker) (string, error)
- func (s *Store) GetWorkerLogStream(w *brigade.Worker) (io.ReadCloser, error)
- func (s *Store) GetWorkerLogStreamFollow(w *brigade.Worker) (io.ReadCloser, error)
- func (s *Store) ReplaceProject(p *brigade.Project) error
Constants ¶
This section is empty.
Variables ¶
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]interface{}{"key": "value"}, } // StubWorker1 is a stub Worker. It is used in StubBuild1, too. StubWorker1 = &brigade.Worker{ ID: "worker-id1", BuildID: "build-id1", ProjectID: "project-id", StartTime: Now, EndTime: Now, ExitCode: 0, Status: brigade.JobSucceeded, } // StubWorker2 is a stub Worker. It is used in StubBuild2, too. StubWorker2 = &brigade.Worker{ ID: "worker-id2", BuildID: "build-id2", ProjectID: "project-id", StartTime: Now.AddDate(0, 0, -1), EndTime: Now, ExitCode: 0, Status: brigade.JobSucceeded, } // StubBuild1 is a stub Build. StubBuild1 = &brigade.Build{ ID: "build-id1", ProjectID: "project-id", Revision: &brigade.Revision{ Commit: "commit1", }, Type: "type", Provider: "provider", Payload: []byte("payload"), Script: []byte("script"), Worker: StubWorker1, } // StubBuild2 is another stub Build. StubBuild2 = &brigade.Build{ ID: "build-id2", ProjectID: "project-id", Revision: &brigade.Revision{ Commit: "commit2", }, Type: "type", Provider: "provider", Payload: []byte("payload"), Script: []byte("script"), Worker: StubWorker2, } // 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 { // Builds is a slice of Builds. Builds []*brigade.Build // Job is the job you want returned. Job *brigade.Job // Workers is a slice of workers. Workers []*brigade.Worker // LogData is the log data you want returned. LogData string // ProjectList on this mock ProjectList []*brigade.Project }
Store implements the storage.Storage interface, but returns mock data.
func (*Store) CreateBuild ¶
CreateBuild fakes a new build.
func (*Store) CreateProject ¶ added in v0.15.0
CreateProject adds a project to the internal mock
func (*Store) DeleteBuild ¶ added in v0.19.0
func (s *Store) DeleteBuild(bid string, options storage.DeleteBuildOptions) error
DeleteBuild fakes a build deletion.
func (*Store) DeleteProject ¶ added in v0.15.0
DeleteProject deletes a project from the internal mock
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) GetJobLogStreamFollow ¶ added in v0.15.0
GetJobLogStreamFollow 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) GetStorageClassNames ¶ added in v0.20.0
GetStorageClassNames returns the names of the StorageClass instances in the cluster
func (*Store) GetWorkerInitLog ¶ added in v1.3.0
GetWorkerInitLog gets the mock log data.
func (*Store) GetWorkerLog ¶
GetWorkerLog gets the mock log data.
func (*Store) GetWorkerLogStream ¶
GetWorkerLogStream gets a readcloser of the mock log data.
func (*Store) GetWorkerLogStreamFollow ¶ added in v0.15.0
GetWorkerLogStreamFollow gets a readcloser of the mock log data.