database

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitEntry

type CommitEntry struct {
	gorm.Model
	RepoName    string
	UserName    string
	AuthorName  string
	AuthorEmail string
	Message     string
	SHA         string
}

type Database

type Database interface {
	Insert(CommitEntry)
	Connect() error
}

type DatabaseHandler

type DatabaseHandler struct {
	Db Database
}

func NewDatabaseHandler

func NewDatabaseHandler(db Database) *DatabaseHandler

func (*DatabaseHandler) Callback

func (dh *DatabaseHandler) Callback(commits []commit.CommitEvent)

type Mysql

type Mysql struct {
	Dsn string
	// contains filtered or unexported fields
}

implements interface database

func (*Mysql) Connect

func (d *Mysql) Connect() error

func (*Mysql) Insert

func (d *Mysql) Insert(c CommitEntry)

type Postgres

type Postgres struct {
	Dsn string
	// contains filtered or unexported fields
}

implements interface database

func (*Postgres) Connect

func (d *Postgres) Connect() error

func (*Postgres) Insert

func (d *Postgres) Insert(c CommitEntry)

type Sqlite

type Sqlite struct {
	SqLiteDB string
	// contains filtered or unexported fields
}

func (*Sqlite) BatchInsert

func (d *Sqlite) BatchInsert(c CommitEntry)

func (*Sqlite) Connect

func (d *Sqlite) Connect() error

func (*Sqlite) Insert

func (d *Sqlite) Insert(c CommitEntry)

Jump to

Keyboard shortcuts

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