persistence

package
v0.0.0-...-b340e51 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePostgresDBConnection

func CreatePostgresDBConnection(url string, port string, username string, password string, databaseName string) *gorm.DB

func CreateTables

func CreateTables(db *gorm.DB)

func NewPostgresqlConnectionLocalhost

func NewPostgresqlConnectionLocalhost() *gorm.DB

func NewPostgresqlConnectionWithEnv

func NewPostgresqlConnectionWithEnv() *gorm.DB

func NewSQLiteConnection

func NewSQLiteConnection(dbId string) (*gorm.DB, string)

Types

type CommitStoreDB

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

func NewCommitStoreDB

func NewCommitStoreDB(db *gorm.DB) *CommitStoreDB

func (*CommitStoreDB) CreateCommit

func (s *CommitStoreDB) CreateCommit(commit entities.Commit) (*entities.Commit, error)

func (*CommitStoreDB) GetCommitByPipelineIdAndCommitId

func (s *CommitStoreDB) GetCommitByPipelineIdAndCommitId(pipelineId string, commitId string) (*entities.Commit, error)

func (*CommitStoreDB) GetCommitByPipelineIdAndPullRequestId

func (s *CommitStoreDB) GetCommitByPipelineIdAndPullRequestId(pipelineId string, pullRequestId int64) (*entities.Commit, error)

func (*CommitStoreDB) GetCommits

func (s *CommitStoreDB) GetCommits() ([]entities.Commit, error)

func (*CommitStoreDB) UpdateCommit

func (s *CommitStoreDB) UpdateCommit(commit entities.Commit) (*entities.Commit, error)

type CommitStoreFake

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

func NewCommitStoreFake

func NewCommitStoreFake() *CommitStoreFake

func (*CommitStoreFake) CreateCommit

func (s *CommitStoreFake) CreateCommit(commit entities.Commit) (*entities.Commit, error)

func (*CommitStoreFake) GetCommitByPipelineIdAndCommitId

func (s *CommitStoreFake) GetCommitByPipelineIdAndCommitId(pipelineId string, commitId string) (*entities.Commit, error)

func (*CommitStoreFake) GetCommitByPipelineIdAndPullRequestId

func (s *CommitStoreFake) GetCommitByPipelineIdAndPullRequestId(pipelineId string, pullRequestId int64) (*entities.Commit, error)

func (*CommitStoreFake) GetCommits

func (s *CommitStoreFake) GetCommits() ([]entities.Commit, error)

func (*CommitStoreFake) UpdateCommit

func (s *CommitStoreFake) UpdateCommit(commit entities.Commit) (*entities.Commit, error)

type CommitStoreInterface

type CommitStoreInterface interface {
	GetCommits() ([]entities.Commit, error)
	GetCommitByPipelineIdAndCommitId(pipelineId string, commitId string) (*entities.Commit, error)
	GetCommitByPipelineIdAndPullRequestId(pipelineId string, pullRequestId int64) (*entities.Commit, error)
	CreateCommit(event entities.Commit) (*entities.Commit, error)
	UpdateCommit(event entities.Commit) (*entities.Commit, error)
}

type DeploymentStoreDB

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

func NewDeploymentStoreDB

func NewDeploymentStoreDB(db *gorm.DB) *DeploymentStoreDB

func (*DeploymentStoreDB) CreateDeployment

func (s *DeploymentStoreDB) CreateDeployment(deployment entities.Deployment) (*entities.Deployment, error)

func (*DeploymentStoreDB) GetDeploymentByCommitIdAndEnvironment

func (s *DeploymentStoreDB) GetDeploymentByCommitIdAndEnvironment(commitId string, environment string) (*entities.Deployment, error)

func (*DeploymentStoreDB) UpdateDeployment

func (s *DeploymentStoreDB) UpdateDeployment(deployment entities.Deployment) (*entities.Deployment, error)

type DeploymentStoreFake

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

func NewDeploymentStoreFake

func NewDeploymentStoreFake() *DeploymentStoreFake

func (*DeploymentStoreFake) CreateDeployment

func (s *DeploymentStoreFake) CreateDeployment(deployment entities.Deployment) (*entities.Deployment, error)

func (*DeploymentStoreFake) GetDeploymentByCommitIdAndEnvironment

func (s *DeploymentStoreFake) GetDeploymentByCommitIdAndEnvironment(commitId string, environment string) (*entities.Deployment, error)

func (*DeploymentStoreFake) GetDeployments

func (s *DeploymentStoreFake) GetDeployments() ([]entities.Deployment, error)

func (*DeploymentStoreFake) UpdateDeployment

func (s *DeploymentStoreFake) UpdateDeployment(deployment entities.Deployment) (*entities.Deployment, error)

type DeploymentStoreInterface

type DeploymentStoreInterface interface {
	GetDeploymentByCommitIdAndEnvironment(commitId string, environment string) (*entities.Deployment, error)
	CreateDeployment(deployment entities.Deployment) (*entities.Deployment, error)
	UpdateDeployment(deployment entities.Deployment) (*entities.Deployment, error)
}

type EventStoreDB

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

func NewEventStoreDB

func NewEventStoreDB(db *gorm.DB) *EventStoreDB

func (*EventStoreDB) CreateEvent

func (s *EventStoreDB) CreateEvent(event entities.Event) (*entities.Event, error)

func (*EventStoreDB) GetAllEvents

func (s *EventStoreDB) GetAllEvents() ([]entities.Event, error)

func (*EventStoreDB) GetEventsByCommitId

func (s *EventStoreDB) GetEventsByCommitId(pipelineId string, commitId string) ([]entities.Event, error)

type EventStoreFake

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

func NewEventStoreFake

func NewEventStoreFake() *EventStoreFake

func (*EventStoreFake) CreateEvent

func (s *EventStoreFake) CreateEvent(event entities.Event) (*entities.Event, error)

func (*EventStoreFake) GetAllEvents

func (s *EventStoreFake) GetAllEvents() ([]entities.Event, error)

func (*EventStoreFake) GetEventsByCommitId

func (s *EventStoreFake) GetEventsByCommitId(pipelineId string, commitId string) ([]entities.Event, error)

type EventStoreInterface

type EventStoreInterface interface {
	GetAllEvents() ([]entities.Event, error)
	GetEventsByCommitId(pipelineId string, commitId string) ([]entities.Event, error)
	CreateEvent(event entities.Event) (*entities.Event, error)
}

type IncidentStoreDB

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

func NewIncidentStoreDB

func NewIncidentStoreDB(db *gorm.DB) *IncidentStoreDB

func (*IncidentStoreDB) CreateIncident

func (s *IncidentStoreDB) CreateIncident(incident entities.Incident) (*entities.Incident, error)

func (*IncidentStoreDB) GetIncidents

func (s *IncidentStoreDB) GetIncidents() ([]entities.Incident, error)

func (*IncidentStoreDB) GetLatestFailureIncidentByPipelineIdAndEnvironment

func (s *IncidentStoreDB) GetLatestFailureIncidentByPipelineIdAndEnvironment(pipelineId string, environment string) (*entities.Incident, error)

func (*IncidentStoreDB) GetLatestIncidentBySourceId

func (s *IncidentStoreDB) GetLatestIncidentBySourceId(sourceId string, state string) (*entities.Incident, error)

func (*IncidentStoreDB) UpdateIncident

func (s *IncidentStoreDB) UpdateIncident(incident entities.Incident) (*entities.Incident, error)

type IncidentStoreFake

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

func NewIncidentStoreFake

func NewIncidentStoreFake() *IncidentStoreFake

func (*IncidentStoreFake) CreateIncident

func (s *IncidentStoreFake) CreateIncident(incident entities.Incident) (*entities.Incident, error)

func (*IncidentStoreFake) GetIncidents

func (s *IncidentStoreFake) GetIncidents() ([]entities.Incident, error)

func (*IncidentStoreFake) GetLatestFailureIncidentByPipelineIdAndEnvironment

func (s *IncidentStoreFake) GetLatestFailureIncidentByPipelineIdAndEnvironment(pipelineId string, environment string) (*entities.Incident, error)

func (*IncidentStoreFake) GetLatestIncidentBySourceId

func (s *IncidentStoreFake) GetLatestIncidentBySourceId(sourceId string, state string) (*entities.Incident, error)

func (*IncidentStoreFake) UpdateIncident

func (s *IncidentStoreFake) UpdateIncident(incident entities.Incident) (*entities.Incident, error)

type IncidentStoreInterface

type IncidentStoreInterface interface {
	GetIncidents() ([]entities.Incident, error)
	GetLatestIncidentBySourceId(sourceId string, state string) (*entities.Incident, error)
	GetLatestFailureIncidentByPipelineIdAndEnvironment(pipelineId string, environment string) (*entities.Incident, error)
	CreateIncident(event entities.Incident) (*entities.Incident, error)
	UpdateIncident(event entities.Incident) (*entities.Incident, error)
}

type UserDBStore

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

func NewUserDBStore

func NewUserDBStore(db *gorm.DB) *UserDBStore

func (*UserDBStore) CreateUser

func (s *UserDBStore) CreateUser(user entities.User) (*entities.User, error)

func (*UserDBStore) GetUserByUsername

func (s *UserDBStore) GetUserByUsername(username string) (*entities.User, error)

type UserStoreInterface

type UserStoreInterface interface {
	GetUserByUsername(username string) (*entities.User, error)
	CreateUser(user entities.User) (*entities.User, error)
}

Jump to

Keyboard shortcuts

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