storage

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2018 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Overview

This implementation of the OcelotStorage system creates a directory structure and stores the data via json files. The build id is a generated random number that is unique to the storage system. The directory tree ends up being as follows: save-direc/ ├── 1238ejs7 <---------------- hash │   └── 5577006791947779410 <- build id │   ├── out.json <-------- build output │   └── sum.json <-------- build summary │   └── fail.json <------ build failure reasons (if any) *NOT IMPLEMENTED YET* ├── 123cc34 │   └── 6129484611666145821 │   ├── out.json │   └── sum.json └── alsdkurnv

└── 8674665223082153551
    ├── out.json
    └── sum.json

Package storage is a generated GoMock package.

Index

Constants

View Source
const TimeFormat = "2006-01-02 15:04:05"

Variables

View Source
var (
	BUILD_SUM_404    = "no build summary found for %s"
	STAGE_REASON_404 = "no stages found for %s"
	BUILD_OUT_404    = "no build output found for %s"
	CRED_404         = "no credential found for %s %s"
)

Functions

func CreateTestPgDatabase

func CreateTestPgDatabase(t *testing.T, port int) (cleanup func(t *testing.T), password string)

todo: add some auditing to this, have a file that says what test started it up and what test called cleanup, i know something's missing create the postgres database using docker image, create tables using sql file in test-fixtures returns a cleanup function for closing database, the password, and the port it runs on.

func PostgresTeardown

func PostgresTeardown(t *testing.T, db *sql.DB)

Types

type BuildOut

type BuildOut interface {
	AddOut(output *models.BuildOutput) error
	RetrieveOut(buildId int64) (models.BuildOutput, error)
	RetrieveLastOutByHash(gitHash string) (models.BuildOutput, error)
}

type BuildStage

type BuildStage interface {
	AddStageDetail(stageResult *models.StageResult) error
	RetrieveStageDetail(buildId int64) ([]models.StageResult, error)
}

type BuildSum

type BuildSum interface {
	// AddSumStart will
	AddSumStart(hash string, account string, repo string, branch string) (int64, error)
	UpdateSum(failed bool, duration float64, id int64) error
	RetrieveSumByBuildId(buildId int64) (*pb.BuildSummary, error)
	RetrieveSum(gitHash string) ([]*pb.BuildSummary, error)
	RetrieveLatestSum(gitHash string) (*pb.BuildSummary, error)
	RetrieveHashStartsWith(partialGitHash string) ([]*pb.BuildSummary, error)
	RetrieveLastFewSums(repo string, account string, limit int32) ([]*pb.BuildSummary, error)
	RetrieveAcctRepo(partialRepo string) ([]*pb.BuildSummary, error)
	StartBuild(id int64) error
	StoreFailedValidation(id int64) error
	SetQueueTime(id int64) error
	GetTrackedRepos() (*pb.AcctRepos, error)
	GetLastSuccessfulBuildHash(account, repo, branch string) (string, error)
}

func CreateTestFileSystemStorage

func CreateTestFileSystemStorage(t *testing.T) BuildSum

type Cabinet

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

func NewCabinet

func NewCabinet(name string) *Cabinet

type CredTable

type CredTable interface {
	InsertCred(credder pb.OcyCredder, overWriteOk bool) error
	// retrieve ordered by cred type
	RetrieveAllCreds() ([]pb.OcyCredder, error)
	// todo: take out all this pb.CredType stuff, can just call Parent() on subcredType. realized too late :"(
	RetrieveCreds(credType pb.CredType) ([]pb.OcyCredder, error)
	RetrieveCred(subCredType pb.SubCredType, identifier, accountName string) (pb.OcyCredder, error)
	RetrieveCredBySubTypeAndAcct(scredType pb.SubCredType, acctName string) ([]pb.OcyCredder, error)
	CredExists(credder pb.OcyCredder) (bool, error)
	UpdateCred(credder pb.OcyCredder) error
	DeleteCred(credder pb.OcyCredder) error
	GetVCSTypeFromAccount(account string) (pb.SubCredType, error)
}

type Dest

type Dest int
const (
	FileSystem Dest = iota
	Postgres
)

type Drawer

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

type ErrMultipleVCSTypes added in v0.8.0

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

func MultipleVCSTypes added in v0.8.0

func MultipleVCSTypes(account string, types []pb.SubCredType) *ErrMultipleVCSTypes

func (*ErrMultipleVCSTypes) Error added in v0.8.0

func (e *ErrMultipleVCSTypes) Error() string

type ErrNotFound

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

func BuildOutNotFound

func BuildOutNotFound(id string) *ErrNotFound

func BuildSumNotFound

func BuildSumNotFound(id string) *ErrNotFound

func CredNotFound

func CredNotFound(account string, repoType string) *ErrNotFound

func StagesNotFound

func StagesNotFound(id string) *ErrNotFound

func (*ErrNotFound) Error

func (e *ErrNotFound) Error() string

type FileBuildStorage

type FileBuildStorage struct {
	*PostgresStorage
	// contains filtered or unexported fields
}

FileBuildStorage is an implementation of BuildOutput that is for filesystem.

func NewFileBuildStorage

func NewFileBuildStorage(saveDir string) (f *FileBuildStorage)

NewFileBuildStorage will return an initialized FileBuildStorage with the saveDirec added to the filesystem if it isn't already. will fatally exit if cannot create directory. if saveDir == "", will create path at `~/.ocelot/build-output`

func (*FileBuildStorage) AddOut

func (f *FileBuildStorage) AddOut(output *models.BuildOutput) error

func (*FileBuildStorage) AddStageDetail

func (f *FileBuildStorage) AddStageDetail(stageResult *models.StageResult) error

todo; implement stages

func (*FileBuildStorage) AddSumStart

func (f *FileBuildStorage) AddSumStart(hash string, account string, repo string, branch string) (int64, error)

AddSumStart will create an entry in the filesystem storage by generating a random number that has not been used yet. that will be the buildId. Then it will dump the *pb.BuildSummary struct to JSON.

func (*FileBuildStorage) Clean

func (f *FileBuildStorage) Clean()

func (*FileBuildStorage) Healthy

func (f *FileBuildStorage) Healthy() bool

func (*FileBuildStorage) Retrieve

func (f *FileBuildStorage) Retrieve(gitHash string) (data []byte, err error)

retrieve build data from filesystem

func (*FileBuildStorage) RetrieveAcctRepo

func (f *FileBuildStorage) RetrieveAcctRepo(partialRepo string) ([]*pb.BuildSummary, error)

TODO: implement

func (*FileBuildStorage) RetrieveHashStartsWith

func (f *FileBuildStorage) RetrieveHashStartsWith(partialGitHash string) ([]*pb.BuildSummary, error)

todo: implement sometime in the future?

func (*FileBuildStorage) RetrieveLastFewSums

func (f *FileBuildStorage) RetrieveLastFewSums(repo string, account string, limit int32) ([]*pb.BuildSummary, error)

stub

func (*FileBuildStorage) RetrieveLastOutByHash

func (f *FileBuildStorage) RetrieveLastOutByHash(gitHash string) (models.BuildOutput, error)

func (*FileBuildStorage) RetrieveLatestSum

func (f *FileBuildStorage) RetrieveLatestSum(gitHash string) (*pb.BuildSummary, error)

func (*FileBuildStorage) RetrieveOut

func (f *FileBuildStorage) RetrieveOut(buildId int64) (models.BuildOutput, error)

func (*FileBuildStorage) RetrieveStageDetail

func (f *FileBuildStorage) RetrieveStageDetail(buildId int64) ([]models.StageResult, error)

func (*FileBuildStorage) RetrieveSum

func (f *FileBuildStorage) RetrieveSum(gitHash string) ([]*pb.BuildSummary, error)

func (*FileBuildStorage) RetrieveSumByBuildId

func (f *FileBuildStorage) RetrieveSumByBuildId(buildId int64) (*pb.BuildSummary, error)

TODO: implement

func (*FileBuildStorage) StorageType

func (f *FileBuildStorage) StorageType() string

func (*FileBuildStorage) UpdateSum

func (f *FileBuildStorage) UpdateSum(failed bool, duration float64, id int64) error

type HealthyChkr

type HealthyChkr interface {
	Healthy() bool
}

GetCredAt(path string, hideSecret bool, rcc RemoteConfigCred) (map[string]RemoteConfigCred, error)

type HealthyStorage

type HealthyStorage struct {
	IsHealthy bool
}

func NewHealthyStorage

func NewHealthyStorage() *HealthyStorage

func (*HealthyStorage) Healthy

func (h *HealthyStorage) Healthy() bool

type MockBuildOut

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

MockBuildOut is a mock of BuildOut interface

func NewMockBuildOut

func NewMockBuildOut(ctrl *gomock.Controller) *MockBuildOut

NewMockBuildOut creates a new mock instance

func (*MockBuildOut) AddOut

func (m *MockBuildOut) AddOut(output *models.BuildOutput) error

AddOut mocks base method

func (*MockBuildOut) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockBuildOut) RetrieveLastOutByHash

func (m *MockBuildOut) RetrieveLastOutByHash(gitHash string) (models.BuildOutput, error)

RetrieveLastOutByHash mocks base method

func (*MockBuildOut) RetrieveOut

func (m *MockBuildOut) RetrieveOut(buildId int64) (models.BuildOutput, error)

RetrieveOut mocks base method

type MockBuildOutMockRecorder

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

MockBuildOutMockRecorder is the mock recorder for MockBuildOut

func (*MockBuildOutMockRecorder) AddOut

func (mr *MockBuildOutMockRecorder) AddOut(output interface{}) *gomock.Call

AddOut indicates an expected call of AddOut

func (*MockBuildOutMockRecorder) RetrieveLastOutByHash

func (mr *MockBuildOutMockRecorder) RetrieveLastOutByHash(gitHash interface{}) *gomock.Call

RetrieveLastOutByHash indicates an expected call of RetrieveLastOutByHash

func (*MockBuildOutMockRecorder) RetrieveOut

func (mr *MockBuildOutMockRecorder) RetrieveOut(buildId interface{}) *gomock.Call

RetrieveOut indicates an expected call of RetrieveOut

type MockBuildStage

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

MockBuildStage is a mock of BuildStage interface

func NewMockBuildStage

func NewMockBuildStage(ctrl *gomock.Controller) *MockBuildStage

NewMockBuildStage creates a new mock instance

func (*MockBuildStage) AddStageDetail

func (m *MockBuildStage) AddStageDetail(stageResult *models.StageResult) error

AddStageDetail mocks base method

func (*MockBuildStage) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockBuildStage) RetrieveStageDetail

func (m *MockBuildStage) RetrieveStageDetail(buildId int64) ([]models.StageResult, error)

RetrieveStageDetail mocks base method

type MockBuildStageMockRecorder

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

MockBuildStageMockRecorder is the mock recorder for MockBuildStage

func (*MockBuildStageMockRecorder) AddStageDetail

func (mr *MockBuildStageMockRecorder) AddStageDetail(stageResult interface{}) *gomock.Call

AddStageDetail indicates an expected call of AddStageDetail

func (*MockBuildStageMockRecorder) RetrieveStageDetail

func (mr *MockBuildStageMockRecorder) RetrieveStageDetail(buildId interface{}) *gomock.Call

RetrieveStageDetail indicates an expected call of RetrieveStageDetail

type MockBuildSum

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

MockBuildSum is a mock of BuildSum interface

func NewMockBuildSum

func NewMockBuildSum(ctrl *gomock.Controller) *MockBuildSum

NewMockBuildSum creates a new mock instance

func (*MockBuildSum) AddSumStart

func (m *MockBuildSum) AddSumStart(hash, account, repo, branch string) (int64, error)

AddSumStart mocks base method

func (*MockBuildSum) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockBuildSum) GetLastSuccessfulBuildHash added in v0.7.3

func (m *MockBuildSum) GetLastSuccessfulBuildHash(account, repo, branch string) (string, error)

GetLastSuccessfulBuildHash mocks base method

func (*MockBuildSum) GetTrackedRepos

func (m *MockBuildSum) GetTrackedRepos() (*pb.AcctRepos, error)

GetTrackedRepos mocks base method

func (*MockBuildSum) RetrieveAcctRepo

func (m *MockBuildSum) RetrieveAcctRepo(partialRepo string) ([]*pb.BuildSummary, error)

RetrieveAcctRepo mocks base method

func (*MockBuildSum) RetrieveHashStartsWith

func (m *MockBuildSum) RetrieveHashStartsWith(partialGitHash string) ([]*pb.BuildSummary, error)

RetrieveHashStartsWith mocks base method

func (*MockBuildSum) RetrieveLastFewSums

func (m *MockBuildSum) RetrieveLastFewSums(repo, account string, limit int32) ([]*pb.BuildSummary, error)

RetrieveLastFewSums mocks base method

func (*MockBuildSum) RetrieveLatestSum

func (m *MockBuildSum) RetrieveLatestSum(gitHash string) (*pb.BuildSummary, error)

RetrieveLatestSum mocks base method

func (*MockBuildSum) RetrieveSum

func (m *MockBuildSum) RetrieveSum(gitHash string) ([]*pb.BuildSummary, error)

RetrieveSum mocks base method

func (*MockBuildSum) RetrieveSumByBuildId

func (m *MockBuildSum) RetrieveSumByBuildId(buildId int64) (*pb.BuildSummary, error)

RetrieveSumByBuildId mocks base method

func (*MockBuildSum) SetQueueTime

func (m *MockBuildSum) SetQueueTime(id int64) error

SetQueueTime mocks base method

func (*MockBuildSum) StartBuild

func (m *MockBuildSum) StartBuild(id int64) error

StartBuild mocks base method

func (*MockBuildSum) StoreFailedValidation

func (m *MockBuildSum) StoreFailedValidation(id int64) error

StoreFailedValidation mocks base method

func (*MockBuildSum) UpdateSum

func (m *MockBuildSum) UpdateSum(failed bool, duration float64, id int64) error

UpdateSum mocks base method

type MockBuildSumMockRecorder

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

MockBuildSumMockRecorder is the mock recorder for MockBuildSum

func (*MockBuildSumMockRecorder) AddSumStart

func (mr *MockBuildSumMockRecorder) AddSumStart(hash, account, repo, branch interface{}) *gomock.Call

AddSumStart indicates an expected call of AddSumStart

func (*MockBuildSumMockRecorder) GetLastSuccessfulBuildHash added in v0.7.3

func (mr *MockBuildSumMockRecorder) GetLastSuccessfulBuildHash(account, repo, branch interface{}) *gomock.Call

GetLastSuccessfulBuildHash indicates an expected call of GetLastSuccessfulBuildHash

func (*MockBuildSumMockRecorder) GetTrackedRepos

func (mr *MockBuildSumMockRecorder) GetTrackedRepos() *gomock.Call

GetTrackedRepos indicates an expected call of GetTrackedRepos

func (*MockBuildSumMockRecorder) RetrieveAcctRepo

func (mr *MockBuildSumMockRecorder) RetrieveAcctRepo(partialRepo interface{}) *gomock.Call

RetrieveAcctRepo indicates an expected call of RetrieveAcctRepo

func (*MockBuildSumMockRecorder) RetrieveHashStartsWith

func (mr *MockBuildSumMockRecorder) RetrieveHashStartsWith(partialGitHash interface{}) *gomock.Call

RetrieveHashStartsWith indicates an expected call of RetrieveHashStartsWith

func (*MockBuildSumMockRecorder) RetrieveLastFewSums

func (mr *MockBuildSumMockRecorder) RetrieveLastFewSums(repo, account, limit interface{}) *gomock.Call

RetrieveLastFewSums indicates an expected call of RetrieveLastFewSums

func (*MockBuildSumMockRecorder) RetrieveLatestSum

func (mr *MockBuildSumMockRecorder) RetrieveLatestSum(gitHash interface{}) *gomock.Call

RetrieveLatestSum indicates an expected call of RetrieveLatestSum

func (*MockBuildSumMockRecorder) RetrieveSum

func (mr *MockBuildSumMockRecorder) RetrieveSum(gitHash interface{}) *gomock.Call

RetrieveSum indicates an expected call of RetrieveSum

func (*MockBuildSumMockRecorder) RetrieveSumByBuildId

func (mr *MockBuildSumMockRecorder) RetrieveSumByBuildId(buildId interface{}) *gomock.Call

RetrieveSumByBuildId indicates an expected call of RetrieveSumByBuildId

func (*MockBuildSumMockRecorder) SetQueueTime

func (mr *MockBuildSumMockRecorder) SetQueueTime(id interface{}) *gomock.Call

SetQueueTime indicates an expected call of SetQueueTime

func (*MockBuildSumMockRecorder) StartBuild

func (mr *MockBuildSumMockRecorder) StartBuild(id interface{}) *gomock.Call

StartBuild indicates an expected call of StartBuild

func (*MockBuildSumMockRecorder) StoreFailedValidation

func (mr *MockBuildSumMockRecorder) StoreFailedValidation(id interface{}) *gomock.Call

StoreFailedValidation indicates an expected call of StoreFailedValidation

func (*MockBuildSumMockRecorder) UpdateSum

func (mr *MockBuildSumMockRecorder) UpdateSum(failed, duration, id interface{}) *gomock.Call

UpdateSum indicates an expected call of UpdateSum

type MockCredTable

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

MockCredTable is a mock of CredTable interface

func NewMockCredTable

func NewMockCredTable(ctrl *gomock.Controller) *MockCredTable

NewMockCredTable creates a new mock instance

func (*MockCredTable) CredExists

func (m *MockCredTable) CredExists(credder pb.OcyCredder) (bool, error)

CredExists mocks base method

func (*MockCredTable) DeleteCred

func (m *MockCredTable) DeleteCred(credder pb.OcyCredder) error

DeleteCred mocks base method

func (*MockCredTable) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockCredTable) GetVCSTypeFromAccount added in v0.8.0

func (m *MockCredTable) GetVCSTypeFromAccount(account string) (pb.SubCredType, error)

GetVCSTypeFromAccount mocks base method

func (*MockCredTable) InsertCred

func (m *MockCredTable) InsertCred(credder pb.OcyCredder, overWriteOk bool) error

InsertCred mocks base method

func (*MockCredTable) RetrieveAllCreds

func (m *MockCredTable) RetrieveAllCreds() ([]pb.OcyCredder, error)

RetrieveAllCreds mocks base method

func (*MockCredTable) RetrieveCred

func (m *MockCredTable) RetrieveCred(subCredType pb.SubCredType, identifier, accountName string) (pb.OcyCredder, error)

RetrieveCred mocks base method

func (*MockCredTable) RetrieveCredBySubTypeAndAcct

func (m *MockCredTable) RetrieveCredBySubTypeAndAcct(scredType pb.SubCredType, acctName string) ([]pb.OcyCredder, error)

RetrieveCredBySubTypeAndAcct mocks base method

func (*MockCredTable) RetrieveCreds

func (m *MockCredTable) RetrieveCreds(credType pb.CredType) ([]pb.OcyCredder, error)

RetrieveCreds mocks base method

func (*MockCredTable) UpdateCred

func (m *MockCredTable) UpdateCred(credder pb.OcyCredder) error

UpdateCred mocks base method

type MockCredTableMockRecorder

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

MockCredTableMockRecorder is the mock recorder for MockCredTable

func (*MockCredTableMockRecorder) CredExists

func (mr *MockCredTableMockRecorder) CredExists(credder interface{}) *gomock.Call

CredExists indicates an expected call of CredExists

func (*MockCredTableMockRecorder) DeleteCred

func (mr *MockCredTableMockRecorder) DeleteCred(credder interface{}) *gomock.Call

DeleteCred indicates an expected call of DeleteCred

func (*MockCredTableMockRecorder) GetVCSTypeFromAccount added in v0.8.0

func (mr *MockCredTableMockRecorder) GetVCSTypeFromAccount(account interface{}) *gomock.Call

GetVCSTypeFromAccount indicates an expected call of GetVCSTypeFromAccount

func (*MockCredTableMockRecorder) InsertCred

func (mr *MockCredTableMockRecorder) InsertCred(credder, overWriteOk interface{}) *gomock.Call

InsertCred indicates an expected call of InsertCred

func (*MockCredTableMockRecorder) RetrieveAllCreds

func (mr *MockCredTableMockRecorder) RetrieveAllCreds() *gomock.Call

RetrieveAllCreds indicates an expected call of RetrieveAllCreds

func (*MockCredTableMockRecorder) RetrieveCred

func (mr *MockCredTableMockRecorder) RetrieveCred(subCredType, identifier, accountName interface{}) *gomock.Call

RetrieveCred indicates an expected call of RetrieveCred

func (*MockCredTableMockRecorder) RetrieveCredBySubTypeAndAcct

func (mr *MockCredTableMockRecorder) RetrieveCredBySubTypeAndAcct(scredType, acctName interface{}) *gomock.Call

RetrieveCredBySubTypeAndAcct indicates an expected call of RetrieveCredBySubTypeAndAcct

func (*MockCredTableMockRecorder) RetrieveCreds

func (mr *MockCredTableMockRecorder) RetrieveCreds(credType interface{}) *gomock.Call

RetrieveCreds indicates an expected call of RetrieveCreds

func (*MockCredTableMockRecorder) UpdateCred

func (mr *MockCredTableMockRecorder) UpdateCred(credder interface{}) *gomock.Call

UpdateCred indicates an expected call of UpdateCred

type MockHealthyChkr

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

MockHealthyChkr is a mock of HealthyChkr interface

func NewMockHealthyChkr

func NewMockHealthyChkr(ctrl *gomock.Controller) *MockHealthyChkr

NewMockHealthyChkr creates a new mock instance

func (*MockHealthyChkr) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockHealthyChkr) Healthy

func (m *MockHealthyChkr) Healthy() bool

Healthy mocks base method

type MockHealthyChkrMockRecorder

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

MockHealthyChkrMockRecorder is the mock recorder for MockHealthyChkr

func (*MockHealthyChkrMockRecorder) Healthy

func (mr *MockHealthyChkrMockRecorder) Healthy() *gomock.Call

Healthy indicates an expected call of Healthy

type MockOcelotStorage

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

MockOcelotStorage is a mock of OcelotStorage interface

func NewMockOcelotStorage

func NewMockOcelotStorage(ctrl *gomock.Controller) *MockOcelotStorage

NewMockOcelotStorage creates a new mock instance

func (*MockOcelotStorage) AddOut

func (m *MockOcelotStorage) AddOut(output *models.BuildOutput) error

AddOut mocks base method

func (*MockOcelotStorage) AddStageDetail

func (m *MockOcelotStorage) AddStageDetail(stageResult *models.StageResult) error

AddStageDetail mocks base method

func (*MockOcelotStorage) AddSumStart

func (m *MockOcelotStorage) AddSumStart(hash, account, repo, branch string) (int64, error)

AddSumStart mocks base method

func (*MockOcelotStorage) Close

func (m *MockOcelotStorage) Close()

Close mocks base method

func (*MockOcelotStorage) CredExists

func (m *MockOcelotStorage) CredExists(credder pb.OcyCredder) (bool, error)

CredExists mocks base method

func (*MockOcelotStorage) DeleteCred

func (m *MockOcelotStorage) DeleteCred(credder pb.OcyCredder) error

DeleteCred mocks base method

func (*MockOcelotStorage) DeletePoll

func (m *MockOcelotStorage) DeletePoll(account, repo string) error

DeletePoll mocks base method

func (*MockOcelotStorage) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockOcelotStorage) GetAllPolls

func (m *MockOcelotStorage) GetAllPolls() ([]*pb.PollRequest, error)

GetAllPolls mocks base method

func (*MockOcelotStorage) GetLastData

func (m *MockOcelotStorage) GetLastData(accountRepo string) (time.Time, map[string]string, error)

GetLastData mocks base method

func (*MockOcelotStorage) GetLastSuccessfulBuildHash added in v0.7.3

func (m *MockOcelotStorage) GetLastSuccessfulBuildHash(account, repo, branch string) (string, error)

GetLastSuccessfulBuildHash mocks base method

func (*MockOcelotStorage) GetTrackedRepos

func (m *MockOcelotStorage) GetTrackedRepos() (*pb.AcctRepos, error)

GetTrackedRepos mocks base method

func (*MockOcelotStorage) GetVCSTypeFromAccount added in v0.8.0

func (m *MockOcelotStorage) GetVCSTypeFromAccount(account string) (pb.SubCredType, error)

GetVCSTypeFromAccount mocks base method

func (*MockOcelotStorage) Healthy

func (m *MockOcelotStorage) Healthy() bool

Healthy mocks base method

func (*MockOcelotStorage) InsertCred

func (m *MockOcelotStorage) InsertCred(credder pb.OcyCredder, overWriteOk bool) error

InsertCred mocks base method

func (*MockOcelotStorage) InsertPoll

func (m *MockOcelotStorage) InsertPoll(account, repo, cronString, branches string, credsId int64) error

InsertPoll mocks base method

func (*MockOcelotStorage) PollExists

func (m *MockOcelotStorage) PollExists(account, repo string) (bool, error)

PollExists mocks base method

func (*MockOcelotStorage) RetrieveAcctRepo

func (m *MockOcelotStorage) RetrieveAcctRepo(partialRepo string) ([]*pb.BuildSummary, error)

RetrieveAcctRepo mocks base method

func (*MockOcelotStorage) RetrieveAllCreds

func (m *MockOcelotStorage) RetrieveAllCreds() ([]pb.OcyCredder, error)

RetrieveAllCreds mocks base method

func (*MockOcelotStorage) RetrieveCred

func (m *MockOcelotStorage) RetrieveCred(subCredType pb.SubCredType, identifier, accountName string) (pb.OcyCredder, error)

RetrieveCred mocks base method

func (*MockOcelotStorage) RetrieveCredBySubTypeAndAcct

func (m *MockOcelotStorage) RetrieveCredBySubTypeAndAcct(scredType pb.SubCredType, acctName string) ([]pb.OcyCredder, error)

RetrieveCredBySubTypeAndAcct mocks base method

func (*MockOcelotStorage) RetrieveCreds

func (m *MockOcelotStorage) RetrieveCreds(credType pb.CredType) ([]pb.OcyCredder, error)

RetrieveCreds mocks base method

func (*MockOcelotStorage) RetrieveHashStartsWith

func (m *MockOcelotStorage) RetrieveHashStartsWith(partialGitHash string) ([]*pb.BuildSummary, error)

RetrieveHashStartsWith mocks base method

func (*MockOcelotStorage) RetrieveLastFewSums

func (m *MockOcelotStorage) RetrieveLastFewSums(repo, account string, limit int32) ([]*pb.BuildSummary, error)

RetrieveLastFewSums mocks base method

func (*MockOcelotStorage) RetrieveLastOutByHash

func (m *MockOcelotStorage) RetrieveLastOutByHash(gitHash string) (models.BuildOutput, error)

RetrieveLastOutByHash mocks base method

func (*MockOcelotStorage) RetrieveLatestSum

func (m *MockOcelotStorage) RetrieveLatestSum(gitHash string) (*pb.BuildSummary, error)

RetrieveLatestSum mocks base method

func (*MockOcelotStorage) RetrieveOut

func (m *MockOcelotStorage) RetrieveOut(buildId int64) (models.BuildOutput, error)

RetrieveOut mocks base method

func (*MockOcelotStorage) RetrieveStageDetail

func (m *MockOcelotStorage) RetrieveStageDetail(buildId int64) ([]models.StageResult, error)

RetrieveStageDetail mocks base method

func (*MockOcelotStorage) RetrieveSum

func (m *MockOcelotStorage) RetrieveSum(gitHash string) ([]*pb.BuildSummary, error)

RetrieveSum mocks base method

func (*MockOcelotStorage) RetrieveSumByBuildId

func (m *MockOcelotStorage) RetrieveSumByBuildId(buildId int64) (*pb.BuildSummary, error)

RetrieveSumByBuildId mocks base method

func (*MockOcelotStorage) SetLastData

func (m *MockOcelotStorage) SetLastData(account, repo string, lasthashes map[string]string) error

SetLastData mocks base method

func (*MockOcelotStorage) SetQueueTime

func (m *MockOcelotStorage) SetQueueTime(id int64) error

SetQueueTime mocks base method

func (*MockOcelotStorage) StartBuild

func (m *MockOcelotStorage) StartBuild(id int64) error

StartBuild mocks base method

func (*MockOcelotStorage) StorageType

func (m *MockOcelotStorage) StorageType() string

StorageType mocks base method

func (*MockOcelotStorage) StoreFailedValidation

func (m *MockOcelotStorage) StoreFailedValidation(id int64) error

StoreFailedValidation mocks base method

func (*MockOcelotStorage) UpdateCred

func (m *MockOcelotStorage) UpdateCred(credder pb.OcyCredder) error

UpdateCred mocks base method

func (*MockOcelotStorage) UpdatePoll

func (m *MockOcelotStorage) UpdatePoll(account, repo, cronString, branches string) error

UpdatePoll mocks base method

func (*MockOcelotStorage) UpdateSum

func (m *MockOcelotStorage) UpdateSum(failed bool, duration float64, id int64) error

UpdateSum mocks base method

type MockOcelotStorageMockRecorder

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

MockOcelotStorageMockRecorder is the mock recorder for MockOcelotStorage

func (*MockOcelotStorageMockRecorder) AddOut

func (mr *MockOcelotStorageMockRecorder) AddOut(output interface{}) *gomock.Call

AddOut indicates an expected call of AddOut

func (*MockOcelotStorageMockRecorder) AddStageDetail

func (mr *MockOcelotStorageMockRecorder) AddStageDetail(stageResult interface{}) *gomock.Call

AddStageDetail indicates an expected call of AddStageDetail

func (*MockOcelotStorageMockRecorder) AddSumStart

func (mr *MockOcelotStorageMockRecorder) AddSumStart(hash, account, repo, branch interface{}) *gomock.Call

AddSumStart indicates an expected call of AddSumStart

func (*MockOcelotStorageMockRecorder) Close

Close indicates an expected call of Close

func (*MockOcelotStorageMockRecorder) CredExists

func (mr *MockOcelotStorageMockRecorder) CredExists(credder interface{}) *gomock.Call

CredExists indicates an expected call of CredExists

func (*MockOcelotStorageMockRecorder) DeleteCred

func (mr *MockOcelotStorageMockRecorder) DeleteCred(credder interface{}) *gomock.Call

DeleteCred indicates an expected call of DeleteCred

func (*MockOcelotStorageMockRecorder) DeletePoll

func (mr *MockOcelotStorageMockRecorder) DeletePoll(account, repo interface{}) *gomock.Call

DeletePoll indicates an expected call of DeletePoll

func (*MockOcelotStorageMockRecorder) GetAllPolls

func (mr *MockOcelotStorageMockRecorder) GetAllPolls() *gomock.Call

GetAllPolls indicates an expected call of GetAllPolls

func (*MockOcelotStorageMockRecorder) GetLastData

func (mr *MockOcelotStorageMockRecorder) GetLastData(accountRepo interface{}) *gomock.Call

GetLastData indicates an expected call of GetLastData

func (*MockOcelotStorageMockRecorder) GetLastSuccessfulBuildHash added in v0.7.3

func (mr *MockOcelotStorageMockRecorder) GetLastSuccessfulBuildHash(account, repo, branch interface{}) *gomock.Call

GetLastSuccessfulBuildHash indicates an expected call of GetLastSuccessfulBuildHash

func (*MockOcelotStorageMockRecorder) GetTrackedRepos

func (mr *MockOcelotStorageMockRecorder) GetTrackedRepos() *gomock.Call

GetTrackedRepos indicates an expected call of GetTrackedRepos

func (*MockOcelotStorageMockRecorder) GetVCSTypeFromAccount added in v0.8.0

func (mr *MockOcelotStorageMockRecorder) GetVCSTypeFromAccount(account interface{}) *gomock.Call

GetVCSTypeFromAccount indicates an expected call of GetVCSTypeFromAccount

func (*MockOcelotStorageMockRecorder) Healthy

func (mr *MockOcelotStorageMockRecorder) Healthy() *gomock.Call

Healthy indicates an expected call of Healthy

func (*MockOcelotStorageMockRecorder) InsertCred

func (mr *MockOcelotStorageMockRecorder) InsertCred(credder, overWriteOk interface{}) *gomock.Call

InsertCred indicates an expected call of InsertCred

func (*MockOcelotStorageMockRecorder) InsertPoll

func (mr *MockOcelotStorageMockRecorder) InsertPoll(account, repo, cronString, branches, credsId interface{}) *gomock.Call

InsertPoll indicates an expected call of InsertPoll

func (*MockOcelotStorageMockRecorder) PollExists

func (mr *MockOcelotStorageMockRecorder) PollExists(account, repo interface{}) *gomock.Call

PollExists indicates an expected call of PollExists

func (*MockOcelotStorageMockRecorder) RetrieveAcctRepo

func (mr *MockOcelotStorageMockRecorder) RetrieveAcctRepo(partialRepo interface{}) *gomock.Call

RetrieveAcctRepo indicates an expected call of RetrieveAcctRepo

func (*MockOcelotStorageMockRecorder) RetrieveAllCreds

func (mr *MockOcelotStorageMockRecorder) RetrieveAllCreds() *gomock.Call

RetrieveAllCreds indicates an expected call of RetrieveAllCreds

func (*MockOcelotStorageMockRecorder) RetrieveCred

func (mr *MockOcelotStorageMockRecorder) RetrieveCred(subCredType, identifier, accountName interface{}) *gomock.Call

RetrieveCred indicates an expected call of RetrieveCred

func (*MockOcelotStorageMockRecorder) RetrieveCredBySubTypeAndAcct

func (mr *MockOcelotStorageMockRecorder) RetrieveCredBySubTypeAndAcct(scredType, acctName interface{}) *gomock.Call

RetrieveCredBySubTypeAndAcct indicates an expected call of RetrieveCredBySubTypeAndAcct

func (*MockOcelotStorageMockRecorder) RetrieveCreds

func (mr *MockOcelotStorageMockRecorder) RetrieveCreds(credType interface{}) *gomock.Call

RetrieveCreds indicates an expected call of RetrieveCreds

func (*MockOcelotStorageMockRecorder) RetrieveHashStartsWith

func (mr *MockOcelotStorageMockRecorder) RetrieveHashStartsWith(partialGitHash interface{}) *gomock.Call

RetrieveHashStartsWith indicates an expected call of RetrieveHashStartsWith

func (*MockOcelotStorageMockRecorder) RetrieveLastFewSums

func (mr *MockOcelotStorageMockRecorder) RetrieveLastFewSums(repo, account, limit interface{}) *gomock.Call

RetrieveLastFewSums indicates an expected call of RetrieveLastFewSums

func (*MockOcelotStorageMockRecorder) RetrieveLastOutByHash

func (mr *MockOcelotStorageMockRecorder) RetrieveLastOutByHash(gitHash interface{}) *gomock.Call

RetrieveLastOutByHash indicates an expected call of RetrieveLastOutByHash

func (*MockOcelotStorageMockRecorder) RetrieveLatestSum

func (mr *MockOcelotStorageMockRecorder) RetrieveLatestSum(gitHash interface{}) *gomock.Call

RetrieveLatestSum indicates an expected call of RetrieveLatestSum

func (*MockOcelotStorageMockRecorder) RetrieveOut

func (mr *MockOcelotStorageMockRecorder) RetrieveOut(buildId interface{}) *gomock.Call

RetrieveOut indicates an expected call of RetrieveOut

func (*MockOcelotStorageMockRecorder) RetrieveStageDetail

func (mr *MockOcelotStorageMockRecorder) RetrieveStageDetail(buildId interface{}) *gomock.Call

RetrieveStageDetail indicates an expected call of RetrieveStageDetail

func (*MockOcelotStorageMockRecorder) RetrieveSum

func (mr *MockOcelotStorageMockRecorder) RetrieveSum(gitHash interface{}) *gomock.Call

RetrieveSum indicates an expected call of RetrieveSum

func (*MockOcelotStorageMockRecorder) RetrieveSumByBuildId

func (mr *MockOcelotStorageMockRecorder) RetrieveSumByBuildId(buildId interface{}) *gomock.Call

RetrieveSumByBuildId indicates an expected call of RetrieveSumByBuildId

func (*MockOcelotStorageMockRecorder) SetLastData

func (mr *MockOcelotStorageMockRecorder) SetLastData(account, repo, lasthashes interface{}) *gomock.Call

SetLastData indicates an expected call of SetLastData

func (*MockOcelotStorageMockRecorder) SetQueueTime

func (mr *MockOcelotStorageMockRecorder) SetQueueTime(id interface{}) *gomock.Call

SetQueueTime indicates an expected call of SetQueueTime

func (*MockOcelotStorageMockRecorder) StartBuild

func (mr *MockOcelotStorageMockRecorder) StartBuild(id interface{}) *gomock.Call

StartBuild indicates an expected call of StartBuild

func (*MockOcelotStorageMockRecorder) StorageType

func (mr *MockOcelotStorageMockRecorder) StorageType() *gomock.Call

StorageType indicates an expected call of StorageType

func (*MockOcelotStorageMockRecorder) StoreFailedValidation

func (mr *MockOcelotStorageMockRecorder) StoreFailedValidation(id interface{}) *gomock.Call

StoreFailedValidation indicates an expected call of StoreFailedValidation

func (*MockOcelotStorageMockRecorder) UpdateCred

func (mr *MockOcelotStorageMockRecorder) UpdateCred(credder interface{}) *gomock.Call

UpdateCred indicates an expected call of UpdateCred

func (*MockOcelotStorageMockRecorder) UpdatePoll

func (mr *MockOcelotStorageMockRecorder) UpdatePoll(account, repo, cronString, branches interface{}) *gomock.Call

UpdatePoll indicates an expected call of UpdatePoll

func (*MockOcelotStorageMockRecorder) UpdateSum

func (mr *MockOcelotStorageMockRecorder) UpdateSum(failed, duration, id interface{}) *gomock.Call

UpdateSum indicates an expected call of UpdateSum

type MockPollTable

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

MockPollTable is a mock of PollTable interface

func NewMockPollTable

func NewMockPollTable(ctrl *gomock.Controller) *MockPollTable

NewMockPollTable creates a new mock instance

func (*MockPollTable) DeletePoll

func (m *MockPollTable) DeletePoll(account, repo string) error

DeletePoll mocks base method

func (*MockPollTable) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockPollTable) GetAllPolls

func (m *MockPollTable) GetAllPolls() ([]*pb.PollRequest, error)

GetAllPolls mocks base method

func (*MockPollTable) GetLastData

func (m *MockPollTable) GetLastData(accountRepo string) (time.Time, map[string]string, error)

GetLastData mocks base method

func (*MockPollTable) InsertPoll

func (m *MockPollTable) InsertPoll(account, repo, cronString, branches string, credsId int64) error

InsertPoll mocks base method

func (*MockPollTable) PollExists

func (m *MockPollTable) PollExists(account, repo string) (bool, error)

PollExists mocks base method

func (*MockPollTable) SetLastData

func (m *MockPollTable) SetLastData(account, repo string, lasthashes map[string]string) error

SetLastData mocks base method

func (*MockPollTable) UpdatePoll

func (m *MockPollTable) UpdatePoll(account, repo, cronString, branches string) error

UpdatePoll mocks base method

type MockPollTableMockRecorder

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

MockPollTableMockRecorder is the mock recorder for MockPollTable

func (*MockPollTableMockRecorder) DeletePoll

func (mr *MockPollTableMockRecorder) DeletePoll(account, repo interface{}) *gomock.Call

DeletePoll indicates an expected call of DeletePoll

func (*MockPollTableMockRecorder) GetAllPolls

func (mr *MockPollTableMockRecorder) GetAllPolls() *gomock.Call

GetAllPolls indicates an expected call of GetAllPolls

func (*MockPollTableMockRecorder) GetLastData

func (mr *MockPollTableMockRecorder) GetLastData(accountRepo interface{}) *gomock.Call

GetLastData indicates an expected call of GetLastData

func (*MockPollTableMockRecorder) InsertPoll

func (mr *MockPollTableMockRecorder) InsertPoll(account, repo, cronString, branches, credsId interface{}) *gomock.Call

InsertPoll indicates an expected call of InsertPoll

func (*MockPollTableMockRecorder) PollExists

func (mr *MockPollTableMockRecorder) PollExists(account, repo interface{}) *gomock.Call

PollExists indicates an expected call of PollExists

func (*MockPollTableMockRecorder) SetLastData

func (mr *MockPollTableMockRecorder) SetLastData(account, repo, lasthashes interface{}) *gomock.Call

SetLastData indicates an expected call of SetLastData

func (*MockPollTableMockRecorder) UpdatePoll

func (mr *MockPollTableMockRecorder) UpdatePoll(account, repo, cronString, branches interface{}) *gomock.Call

UpdatePoll indicates an expected call of UpdatePoll

type MockStringy

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

MockStringy is a mock of Stringy interface

func NewMockStringy

func NewMockStringy(ctrl *gomock.Controller) *MockStringy

NewMockStringy creates a new mock instance

func (*MockStringy) EXPECT

func (m *MockStringy) EXPECT() *MockStringyMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockStringy) StorageType

func (m *MockStringy) StorageType() string

StorageType mocks base method

type MockStringyMockRecorder

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

MockStringyMockRecorder is the mock recorder for MockStringy

func (*MockStringyMockRecorder) StorageType

func (mr *MockStringyMockRecorder) StorageType() *gomock.Call

StorageType indicates an expected call of StorageType

type OcelotStorage

type OcelotStorage interface {
	BuildOut
	BuildSum
	BuildStage
	Stringy
	PollTable
	CredTable
	HealthyChkr
	Close()
}

type PollTable

type PollTable interface {
	InsertPoll(account string, repo string, cronString string, branches string, credsId int64) error
	UpdatePoll(account string, repo string, cronString string, branches string) error
	SetLastData(account string, repo string, lasthashes map[string]string) error
	GetLastData(accountRepo string) (timestamp time.Time, hashes map[string]string, err error)
	PollExists(account string, repo string) (bool, error)
	GetAllPolls() ([]*pb.PollRequest, error)
	DeletePoll(account string, repo string) error
}

type PostgresStorage

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

func NewPostgresStorage

func NewPostgresStorage(user string, pw string, loc string, port int, dbLoc string) *PostgresStorage

func (*PostgresStorage) AddOut

func (p *PostgresStorage) AddOut(output *models.BuildOutput) error

AddOut adds build output text to build_output table

func (*PostgresStorage) AddStageDetail

func (p *PostgresStorage) AddStageDetail(stageResult *models.StageResult) error

AddStageDetail will store the stage data along with a starttime and duration to db

 The fields required on stageResult to insert into stage detail table are:
		stageResult.BuildId, stageResult.Stage, stageResult.Error, stageResult.StartTime, stageResult.StageDuration, stageResult.Status, stageResult.Messages

func (*PostgresStorage) AddSumStart

func (p *PostgresStorage) AddSumStart(hash string, account string, repo string, branch string) (int64, error)

AddSumStart updates the build_summary table with the initial information that you get from a webhook returning the build id that postgres generates

func (*PostgresStorage) Close

func (p *PostgresStorage) Close()

func (*PostgresStorage) Connect

func (p *PostgresStorage) Connect() error

func (*PostgresStorage) CredExists

func (p *PostgresStorage) CredExists(credder pb.OcyCredder) (bool, error)

func (*PostgresStorage) DeleteCred

func (p *PostgresStorage) DeleteCred(credder pb.OcyCredder) error

func (*PostgresStorage) DeletePoll

func (p *PostgresStorage) DeletePoll(account string, repo string) error

func (*PostgresStorage) GetAllPolls

func (p *PostgresStorage) GetAllPolls() ([]*pb.PollRequest, error)

func (*PostgresStorage) GetLastData

func (p *PostgresStorage) GetLastData(accountRepo string) (timestamp time.Time, hashes map[string]string, err error)

func (*PostgresStorage) GetLastSuccessfulBuildHash added in v0.7.2

func (p *PostgresStorage) GetLastSuccessfulBuildHash(account, repo, branch string) (string, error)

GetLastSuccessfulBuildHash will retrieve the last hash of a successful build on the given branch. If there are no builds for that branch, a BuildSumNotFound error will be returned. If there are no successful builds, a BuildSumNotFound will also be returned.

func (*PostgresStorage) GetTrackedRepos

func (p *PostgresStorage) GetTrackedRepos() (*pb.AcctRepos, error)

func (*PostgresStorage) GetVCSTypeFromAccount added in v0.8.0

func (p *PostgresStorage) GetVCSTypeFromAccount(account string) (pb.SubCredType, error)

func (*PostgresStorage) Healthy

func (p *PostgresStorage) Healthy() bool

todo: need to write a test for this

func (*PostgresStorage) InsertCred

func (p *PostgresStorage) InsertCred(credder pb.OcyCredder, overwriteOk bool) error

InsertCred will insert an ocyCredder object into the credentials table after calling its ValidateForInsert method. if the OcyCredder fails validation, it will return a *models.ValidationErr

func (*PostgresStorage) InsertPoll

func (p *PostgresStorage) InsertPoll(account string, repo string, cronString string, branches string, credsId int64) (err error)

func (*PostgresStorage) PollExists

func (p *PostgresStorage) PollExists(account string, repo string) (bool, error)

func (*PostgresStorage) RetrieveAcctRepo

func (p *PostgresStorage) RetrieveAcctRepo(partialRepo string) ([]*pb.BuildSummary, error)

RetrieveAcctRepo will return to you a list of accountname + repositories that matches starting with partialRepo

func (*PostgresStorage) RetrieveAllCreds

func (p *PostgresStorage) RetrieveAllCreds() ([]pb.OcyCredder, error)

func (*PostgresStorage) RetrieveCred

func (p *PostgresStorage) RetrieveCred(subCredType pb.SubCredType, identifier, accountName string) (pb.OcyCredder, error)

func (*PostgresStorage) RetrieveCredBySubTypeAndAcct

func (p *PostgresStorage) RetrieveCredBySubTypeAndAcct(scredType pb.SubCredType, acctName string) ([]pb.OcyCredder, error)

func (*PostgresStorage) RetrieveCreds

func (p *PostgresStorage) RetrieveCreds(credType pb.CredType) ([]pb.OcyCredder, error)

func (*PostgresStorage) RetrieveHashStartsWith

func (p *PostgresStorage) RetrieveHashStartsWith(partialGitHash string) (hashes []*pb.BuildSummary, err error)

RetrieveHashStartsWith will return a list of all hashes starting with the partial string in db ** THIS WILL ONLY RETURN HASH, ACCOUNT, AND REPO **

func (*PostgresStorage) RetrieveLastFewSums

func (p *PostgresStorage) RetrieveLastFewSums(repo string, account string, limit int32) (sums []*pb.BuildSummary, err error)

RetrieveLastFewSums will return < limit> number of summaries that correlate with a repo and account.

func (*PostgresStorage) RetrieveLastOutByHash

func (p *PostgresStorage) RetrieveLastOutByHash(gitHash string) (models.BuildOutput, error)

RetrieveLastOutByHash will return the last output text that correlates with the gitHash

func (*PostgresStorage) RetrieveLatestSum

func (p *PostgresStorage) RetrieveLatestSum(partialGitHash string) (*pb.BuildSummary, error)

RetrieveLatestSum will return the latest entry of build_summary where hash starts with `gitHash`

func (*PostgresStorage) RetrieveOut

func (p *PostgresStorage) RetrieveOut(buildId int64) (models.BuildOutput, error)

func (*PostgresStorage) RetrieveStageDetail

func (p *PostgresStorage) RetrieveStageDetail(buildId int64) ([]models.StageResult, error)

Retrieve StageDetail will return all stages matching build id

func (*PostgresStorage) RetrieveSum

func (p *PostgresStorage) RetrieveSum(gitHash string) (sums []*pb.BuildSummary, err error)

func (*PostgresStorage) RetrieveSumByBuildId

func (p *PostgresStorage) RetrieveSumByBuildId(buildId int64) (*pb.BuildSummary, error)

RetrieveSumByBuildId will return a build summary based on build id

func (*PostgresStorage) SetLastData

func (p *PostgresStorage) SetLastData(account string, repo string, lasthashes map[string]string) (err error)

func (*PostgresStorage) SetQueueTime

func (p *PostgresStorage) SetQueueTime(id int64) error

SetQueueTime will update the QueueTime in the database to the current time

func (*PostgresStorage) StartBuild

func (p *PostgresStorage) StartBuild(id int64) error

func (*PostgresStorage) StorageType

func (p *PostgresStorage) StorageType() string

func (*PostgresStorage) StoreFailedValidation

func (p *PostgresStorage) StoreFailedValidation(id int64) error

StoreFailedValidation will update the rest of the summary fields (failed:true, duration:0)

func (*PostgresStorage) UpdateCred

func (p *PostgresStorage) UpdateCred(credder pb.OcyCredder) error

func (*PostgresStorage) UpdatePoll

func (p *PostgresStorage) UpdatePoll(account string, repo string, cronString string, branches string) (err error)

func (*PostgresStorage) UpdateSum

func (p *PostgresStorage) UpdateSum(failed bool, duration float64, id int64) error

UpdateSum updates the remaining fields in the build_summary table

type Stringy

type Stringy interface {
	StorageType() string
}

Jump to

Keyboard shortcuts

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