dao

package
v0.0.0-...-0f1a4ea Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound error when record not found
	ErrNotFound = fmt.Errorf("record Not Found")

	// ErrUnableToMarshalJSON error when json payload corrupt
	ErrUnableToMarshalJSON = fmt.Errorf("json payload corrupt")

	// ErrUpdateFailed error when update fails
	ErrUpdateFailed = fmt.Errorf("db update error")

	// ErrInsertFailed error when insert fails
	ErrInsertFailed = fmt.Errorf("db insert error")

	// ErrDeleteFailed error when delete fails
	ErrDeleteFailed = fmt.Errorf("db delete error")

	// ErrBadParams error when bad params passed in
	ErrBadParams = fmt.Errorf("bad params error")

	// DB reference to database
	DB *gorm.DB

	Cacher *explru.ExpirableLRU

	// AppBuildInfo reference to build info
	AppBuildInfo *BuildInfo

	// Logger function that will be invoked before executing sql
	Logger LogSql
)
View Source
var ViewRefreshes = make(map[string]bool)

Functions

func AddContentDealLogs

func AddContentDealLogs(ctx context.Context, record *model.ContentDealLogs) (result *model.ContentDealLogs, RowsAffected int64, err error)

AddContentDealLogs is a function to add a single record to content_deal_logs table in the estuary database error - ErrInsertFailed, db save call failed

func AddContentDealProposalLogs

func AddContentDealProposalLogs(ctx context.Context, record *model.ContentDealProposalLogs) (result *model.ContentDealProposalLogs, RowsAffected int64, err error)

AddContentDealProposalLogs is a function to add a single record to content_deal_proposal_logs table in the estuary database error - ErrInsertFailed, db save call failed

func AddContentDealProposalParametersLogs

func AddContentDealProposalParametersLogs(ctx context.Context, record *model.ContentDealProposalParametersLogs) (result *model.ContentDealProposalParametersLogs, RowsAffected int64, err error)

AddContentDealProposalParametersLogs is a function to add a single record to content_deal_proposal_parameters_logs table in the estuary database error - ErrInsertFailed, db save call failed

func AddContentLogs

func AddContentLogs(ctx context.Context, record *model.ContentLogs) (result *model.ContentLogs, RowsAffected int64, err error)

AddContentLogs is a function to add a single record to content_logs table in the estuary database error - ErrInsertFailed, db save call failed

func AddContentMinerLogs

func AddContentMinerLogs(ctx context.Context, record *model.ContentMinerLogs) (result *model.ContentMinerLogs, RowsAffected int64, err error)

AddContentMinerLogs is a function to add a single record to content_miner_logs table in the estuary database error - ErrInsertFailed, db save call failed

func AddContentWalletLogs

func AddContentWalletLogs(ctx context.Context, record *model.ContentWalletLogs) (result *model.ContentWalletLogs, RowsAffected int64, err error)

AddContentWalletLogs is a function to add a single record to content_wallet_logs table in the estuary database error - ErrInsertFailed, db save call failed

func AddDeltaNodeGeoLocations

func AddDeltaNodeGeoLocations(ctx context.Context, record *model.DeltaNodeGeoLocations) (result *model.DeltaNodeGeoLocations, RowsAffected int64, err error)

AddDeltaNodeGeoLocations is a function to add a single record to delta_node_geo_locations table in the estuary database error - ErrInsertFailed, db save call failed

func AddDeltaStartupLogs

func AddDeltaStartupLogs(ctx context.Context, record *model.DeltaStartupLogs) (result *model.DeltaStartupLogs, RowsAffected int64, err error)

AddDeltaStartupLogs is a function to add a single record to delta_startup_logs table in the estuary database error - ErrInsertFailed, db save call failed

func AddInstanceMetaLogs

func AddInstanceMetaLogs(ctx context.Context, record *model.InstanceMetaLogs) (result *model.InstanceMetaLogs, RowsAffected int64, err error)

AddInstanceMetaLogs is a function to add a single record to instance_meta_logs table in the estuary database error - ErrInsertFailed, db save call failed

func AddLogEvents

func AddLogEvents(ctx context.Context, record *model.LogEvents) (result *model.LogEvents, RowsAffected int64, err error)

AddLogEvents is a function to add a single record to log_events table in the estuary database error - ErrInsertFailed, db save call failed

func AddPieceCommitmentLogs

func AddPieceCommitmentLogs(ctx context.Context, record *model.PieceCommitmentLogs) (result *model.PieceCommitmentLogs, RowsAffected int64, err error)

AddPieceCommitmentLogs is a function to add a single record to piece_commitment_logs table in the estuary database error - ErrInsertFailed, db save call failed

func AddWalletLogs

func AddWalletLogs(ctx context.Context, record *model.WalletLogs) (result *model.WalletLogs, RowsAffected int64, err error)

AddWalletLogs is a function to add a single record to wallet_logs table in the estuary database error - ErrInsertFailed, db save call failed

func Copy

func Copy(dst interface{}, src interface{}) error

Copy a src struct into a destination struct

func DeleteContentDealLogs

func DeleteContentDealLogs(ctx context.Context, argID int64) (rowsAffected int64, err error)

DeleteContentDealLogs is a function to delete a single record from content_deal_logs table in the estuary database error - ErrNotFound, db Find error error - ErrDeleteFailed, db Delete failed error

func DeleteContentDealProposalLogs

func DeleteContentDealProposalLogs(ctx context.Context, argID int64) (rowsAffected int64, err error)

DeleteContentDealProposalLogs is a function to delete a single record from content_deal_proposal_logs table in the estuary database error - ErrNotFound, db Find error error - ErrDeleteFailed, db Delete failed error

func DeleteContentDealProposalParametersLogs

func DeleteContentDealProposalParametersLogs(ctx context.Context, argID int64) (rowsAffected int64, err error)

DeleteContentDealProposalParametersLogs is a function to delete a single record from content_deal_proposal_parameters_logs table in the estuary database error - ErrNotFound, db Find error error - ErrDeleteFailed, db Delete failed error

func DeleteContentLogs

func DeleteContentLogs(ctx context.Context, argID int64) (rowsAffected int64, err error)

DeleteContentLogs is a function to delete a single record from content_logs table in the estuary database error - ErrNotFound, db Find error error - ErrDeleteFailed, db Delete failed error

func DeleteContentMinerLogs

func DeleteContentMinerLogs(ctx context.Context, argID int64) (rowsAffected int64, err error)

DeleteContentMinerLogs is a function to delete a single record from content_miner_logs table in the estuary database error - ErrNotFound, db Find error error - ErrDeleteFailed, db Delete failed error

func DeleteContentWalletLogs

func DeleteContentWalletLogs(ctx context.Context, argID int64) (rowsAffected int64, err error)

DeleteContentWalletLogs is a function to delete a single record from content_wallet_logs table in the estuary database error - ErrNotFound, db Find error error - ErrDeleteFailed, db Delete failed error

func DeleteDeltaNodeGeoLocations

func DeleteDeltaNodeGeoLocations(ctx context.Context, argID int64) (rowsAffected int64, err error)

DeleteDeltaNodeGeoLocations is a function to delete a single record from delta_node_geo_locations table in the estuary database error - ErrNotFound, db Find error error - ErrDeleteFailed, db Delete failed error

func DeleteDeltaStartupLogs

func DeleteDeltaStartupLogs(ctx context.Context, argID int64) (rowsAffected int64, err error)

DeleteDeltaStartupLogs is a function to delete a single record from delta_startup_logs table in the estuary database error - ErrNotFound, db Find error error - ErrDeleteFailed, db Delete failed error

func DeleteInstanceMetaLogs

func DeleteInstanceMetaLogs(ctx context.Context, argID int64) (rowsAffected int64, err error)

DeleteInstanceMetaLogs is a function to delete a single record from instance_meta_logs table in the estuary database error - ErrNotFound, db Find error error - ErrDeleteFailed, db Delete failed error

func DeleteLogEvents

func DeleteLogEvents(ctx context.Context, argID int64) (rowsAffected int64, err error)

DeleteLogEvents is a function to delete a single record from log_events table in the estuary database error - ErrNotFound, db Find error error - ErrDeleteFailed, db Delete failed error

func DeletePieceCommitmentLogs

func DeletePieceCommitmentLogs(ctx context.Context, argID int64) (rowsAffected int64, err error)

DeletePieceCommitmentLogs is a function to delete a single record from piece_commitment_logs table in the estuary database error - ErrNotFound, db Find error error - ErrDeleteFailed, db Delete failed error

func DeleteWalletLogs

func DeleteWalletLogs(ctx context.Context, argID int64) (rowsAffected int64, err error)

DeleteWalletLogs is a function to delete a single record from wallet_logs table in the estuary database error - ErrNotFound, db Find error error - ErrDeleteFailed, db Delete failed error

func GetAllContentDealLogs

func GetAllContentDealLogs(ctx context.Context, page, pagesize int64, order string) (results []*model.ContentDealLogs, totalRows int, err error)

GetAllContentDealLogs is a function to get a slice of record(s) from content_deal_logs table in the estuary database params - page - page requested (defaults to 0) params - pagesize - number of records in a page (defaults to 20) params - order - db sort order column error - ErrNotFound, db Find error

func GetAllContentDealProposalLogs

func GetAllContentDealProposalLogs(ctx context.Context, page, pagesize int64, order string) (results []*model.ContentDealProposalLogs, totalRows int, err error)

GetAllContentDealProposalLogs is a function to get a slice of record(s) from content_deal_proposal_logs table in the estuary database params - page - page requested (defaults to 0) params - pagesize - number of records in a page (defaults to 20) params - order - db sort order column error - ErrNotFound, db Find error

func GetAllContentDealProposalParametersLogs

func GetAllContentDealProposalParametersLogs(ctx context.Context, page, pagesize int64, order string) (results []*model.ContentDealProposalParametersLogs, totalRows int, err error)

GetAllContentDealProposalParametersLogs is a function to get a slice of record(s) from content_deal_proposal_parameters_logs table in the estuary database params - page - page requested (defaults to 0) params - pagesize - number of records in a page (defaults to 20) params - order - db sort order column error - ErrNotFound, db Find error

func GetAllContentLogs

func GetAllContentLogs(ctx context.Context, page, pagesize int64, order string) (results []*model.ContentLogs, totalRows int, err error)

GetAllContentLogs is a function to get a slice of record(s) from content_logs table in the estuary database params - page - page requested (defaults to 0) params - pagesize - number of records in a page (defaults to 20) params - order - db sort order column error - ErrNotFound, db Find error

func GetAllContentMinerLogs

func GetAllContentMinerLogs(ctx context.Context, page, pagesize int64, order string) (results []*model.ContentMinerLogs, totalRows int, err error)

GetAllContentMinerLogs is a function to get a slice of record(s) from content_miner_logs table in the estuary database params - page - page requested (defaults to 0) params - pagesize - number of records in a page (defaults to 20) params - order - db sort order column error - ErrNotFound, db Find error

func GetAllContentWalletLogs

func GetAllContentWalletLogs(ctx context.Context, page, pagesize int64, order string) (results []*model.ContentWalletLogs, totalRows int, err error)

GetAllContentWalletLogs is a function to get a slice of record(s) from content_wallet_logs table in the estuary database params - page - page requested (defaults to 0) params - pagesize - number of records in a page (defaults to 20) params - order - db sort order column error - ErrNotFound, db Find error

func GetAllDeltaIps

func GetAllDeltaIps() (interface{}, error)

func GetAllDeltaNodeGeoLocations

func GetAllDeltaNodeGeoLocations(ctx context.Context, page, pagesize int64, order string) (results []*model.DeltaNodeGeoLocations, totalRows int, err error)

GetAllDeltaNodeGeoLocations is a function to get a slice of record(s) from delta_node_geo_locations table in the estuary database params - page - page requested (defaults to 0) params - pagesize - number of records in a page (defaults to 20) params - order - db sort order column error - ErrNotFound, db Find error

func GetAllDeltaStartupLogs

func GetAllDeltaStartupLogs(ctx context.Context, page, pagesize int64, order string) (results []*model.DeltaStartupLogs, totalRows int, err error)

GetAllDeltaStartupLogs is a function to get a slice of record(s) from delta_startup_logs table in the estuary database params - page - page requested (defaults to 0) params - pagesize - number of records in a page (defaults to 20) params - order - db sort order column error - ErrNotFound, db Find error

func GetAllInstanceMetaLogs

func GetAllInstanceMetaLogs(ctx context.Context, page, pagesize int64, order string) (results []*model.InstanceMetaLogs, totalRows int, err error)

GetAllInstanceMetaLogs is a function to get a slice of record(s) from instance_meta_logs table in the estuary database params - page - page requested (defaults to 0) params - pagesize - number of records in a page (defaults to 20) params - order - db sort order column error - ErrNotFound, db Find error

func GetAllLogEvents

func GetAllLogEvents(ctx context.Context, page, pagesize int64, order string) (results []*model.LogEvents, totalRows int, err error)

GetAllLogEvents is a function to get a slice of record(s) from log_events table in the estuary database params - page - page requested (defaults to 0) params - pagesize - number of records in a page (defaults to 20) params - order - db sort order column error - ErrNotFound, db Find error

func GetAllPieceCommitmentLogs

func GetAllPieceCommitmentLogs(ctx context.Context, page, pagesize int64, order string) (results []*model.PieceCommitmentLogs, totalRows int, err error)

GetAllPieceCommitmentLogs is a function to get a slice of record(s) from piece_commitment_logs table in the estuary database params - page - page requested (defaults to 0) params - pagesize - number of records in a page (defaults to 20) params - order - db sort order column error - ErrNotFound, db Find error

func GetAllSPs

func GetAllSPs() (interface{}, error)

func GetAllWalletAddrs

func GetAllWalletAddrs() (interface{}, error)

func GetAllWalletLogs

func GetAllWalletLogs(ctx context.Context, page, pagesize int64, order string) (results []*model.WalletLogs, totalRows int, err error)

GetAllWalletLogs is a function to get a slice of record(s) from wallet_logs table in the estuary database params - page - page requested (defaults to 0) params - pagesize - number of records in a page (defaults to 20) params - order - db sort order column error - ErrNotFound, db Find error

func GetContentDealLogs

func GetContentDealLogs(ctx context.Context, argID int64) (record *model.ContentDealLogs, err error)

GetContentDealLogs is a function to get a single record from the content_deal_logs table in the estuary database error - ErrNotFound, db Find error

func GetContentDealProposalLogs

func GetContentDealProposalLogs(ctx context.Context, argID int64) (record *model.ContentDealProposalLogs, err error)

GetContentDealProposalLogs is a function to get a single record from the content_deal_proposal_logs table in the estuary database error - ErrNotFound, db Find error

func GetContentDealProposalParametersLogs

func GetContentDealProposalParametersLogs(ctx context.Context, argID int64) (record *model.ContentDealProposalParametersLogs, err error)

GetContentDealProposalParametersLogs is a function to get a single record from the content_deal_proposal_parameters_logs table in the estuary database error - ErrNotFound, db Find error

func GetContentLogs

func GetContentLogs(ctx context.Context, argID int64) (record *model.ContentLogs, err error)

GetContentLogs is a function to get a single record from the content_logs table in the estuary database error - ErrNotFound, db Find error

func GetContentMinerLogs

func GetContentMinerLogs(ctx context.Context, argID int64) (record *model.ContentMinerLogs, err error)

GetContentMinerLogs is a function to get a single record from the content_miner_logs table in the estuary database error - ErrNotFound, db Find error

func GetContentWalletLogs

func GetContentWalletLogs(ctx context.Context, argID int64) (record *model.ContentWalletLogs, err error)

GetContentWalletLogs is a function to get a single record from the content_wallet_logs table in the estuary database error - ErrNotFound, db Find error

func GetDealsAttemptedInRange

func GetDealsAttemptedInRange(from string, to string) (interface{}, error)

function to get all totals info

func GetDeltaNodeGeoLocations

func GetDeltaNodeGeoLocations(ctx context.Context, argID int64) (record *model.DeltaNodeGeoLocations, err error)

GetDeltaNodeGeoLocations is a function to get a single record from the delta_node_geo_locations table in the estuary database error - ErrNotFound, db Find error

func GetDeltaStartupLogs

func GetDeltaStartupLogs(ctx context.Context, argID int64) (record *model.DeltaStartupLogs, err error)

GetDeltaStartupLogs is a function to get a single record from the delta_startup_logs table in the estuary database error - ErrNotFound, db Find error

func GetInstanceMetaLogs

func GetInstanceMetaLogs(ctx context.Context, argID int64) (record *model.InstanceMetaLogs, err error)

GetInstanceMetaLogs is a function to get a single record from the instance_meta_logs table in the estuary database error - ErrNotFound, db Find error

func GetLogEvents

func GetLogEvents(ctx context.Context, argID int64) (record *model.LogEvents, err error)

GetLogEvents is a function to get a single record from the log_events table in the estuary database error - ErrNotFound, db Find error

func GetOpenTotalInfoStats

func GetOpenTotalInfoStats() (interface{}, error)

function to get all totals info

func GetPieceCommitmentLogs

func GetPieceCommitmentLogs(ctx context.Context, argID int64) (record *model.PieceCommitmentLogs, err error)

GetPieceCommitmentLogs is a function to get a single record from the piece_commitment_logs table in the estuary database error - ErrNotFound, db Find error

func GetWalletLogs

func GetWalletLogs(ctx context.Context, argID int64) (record *model.WalletLogs, err error)

GetWalletLogs is a function to get a single record from the wallet_logs table in the estuary database error - ErrNotFound, db Find error

func RefreshGlobalAllTableView

func RefreshGlobalAllTableView(viewName string) (interface{}, error)

func RefreshGlobalStatsView

func RefreshGlobalStatsView(viewName string) (interface{}, error)

func UpdateContentDealLogs

func UpdateContentDealLogs(ctx context.Context, argID int64, updated *model.ContentDealLogs) (result *model.ContentDealLogs, RowsAffected int64, err error)

UpdateContentDealLogs is a function to update a single record from content_deal_logs table in the estuary database error - ErrNotFound, db record for id not found error - ErrUpdateFailed, db meta data copy failed or db.Save call failed

func UpdateContentDealProposalLogs

func UpdateContentDealProposalLogs(ctx context.Context, argID int64, updated *model.ContentDealProposalLogs) (result *model.ContentDealProposalLogs, RowsAffected int64, err error)

UpdateContentDealProposalLogs is a function to update a single record from content_deal_proposal_logs table in the estuary database error - ErrNotFound, db record for id not found error - ErrUpdateFailed, db meta data copy failed or db.Save call failed

func UpdateContentDealProposalParametersLogs

func UpdateContentDealProposalParametersLogs(ctx context.Context, argID int64, updated *model.ContentDealProposalParametersLogs) (result *model.ContentDealProposalParametersLogs, RowsAffected int64, err error)

UpdateContentDealProposalParametersLogs is a function to update a single record from content_deal_proposal_parameters_logs table in the estuary database error - ErrNotFound, db record for id not found error - ErrUpdateFailed, db meta data copy failed or db.Save call failed

func UpdateContentLogs

func UpdateContentLogs(ctx context.Context, argID int64, updated *model.ContentLogs) (result *model.ContentLogs, RowsAffected int64, err error)

UpdateContentLogs is a function to update a single record from content_logs table in the estuary database error - ErrNotFound, db record for id not found error - ErrUpdateFailed, db meta data copy failed or db.Save call failed

func UpdateContentMinerLogs

func UpdateContentMinerLogs(ctx context.Context, argID int64, updated *model.ContentMinerLogs) (result *model.ContentMinerLogs, RowsAffected int64, err error)

UpdateContentMinerLogs is a function to update a single record from content_miner_logs table in the estuary database error - ErrNotFound, db record for id not found error - ErrUpdateFailed, db meta data copy failed or db.Save call failed

func UpdateContentWalletLogs

func UpdateContentWalletLogs(ctx context.Context, argID int64, updated *model.ContentWalletLogs) (result *model.ContentWalletLogs, RowsAffected int64, err error)

UpdateContentWalletLogs is a function to update a single record from content_wallet_logs table in the estuary database error - ErrNotFound, db record for id not found error - ErrUpdateFailed, db meta data copy failed or db.Save call failed

func UpdateDeltaNodeGeoLocations

func UpdateDeltaNodeGeoLocations(ctx context.Context, argID int64, updated *model.DeltaNodeGeoLocations) (result *model.DeltaNodeGeoLocations, RowsAffected int64, err error)

UpdateDeltaNodeGeoLocations is a function to update a single record from delta_node_geo_locations table in the estuary database error - ErrNotFound, db record for id not found error - ErrUpdateFailed, db meta data copy failed or db.Save call failed

func UpdateDeltaStartupLogs

func UpdateDeltaStartupLogs(ctx context.Context, argID int64, updated *model.DeltaStartupLogs) (result *model.DeltaStartupLogs, RowsAffected int64, err error)

UpdateDeltaStartupLogs is a function to update a single record from delta_startup_logs table in the estuary database error - ErrNotFound, db record for id not found error - ErrUpdateFailed, db meta data copy failed or db.Save call failed

func UpdateInstanceMetaLogs

func UpdateInstanceMetaLogs(ctx context.Context, argID int64, updated *model.InstanceMetaLogs) (result *model.InstanceMetaLogs, RowsAffected int64, err error)

UpdateInstanceMetaLogs is a function to update a single record from instance_meta_logs table in the estuary database error - ErrNotFound, db record for id not found error - ErrUpdateFailed, db meta data copy failed or db.Save call failed

func UpdateLogEvents

func UpdateLogEvents(ctx context.Context, argID int64, updated *model.LogEvents) (result *model.LogEvents, RowsAffected int64, err error)

UpdateLogEvents is a function to update a single record from log_events table in the estuary database error - ErrNotFound, db record for id not found error - ErrUpdateFailed, db meta data copy failed or db.Save call failed

func UpdatePieceCommitmentLogs

func UpdatePieceCommitmentLogs(ctx context.Context, argID int64, updated *model.PieceCommitmentLogs) (result *model.PieceCommitmentLogs, RowsAffected int64, err error)

UpdatePieceCommitmentLogs is a function to update a single record from piece_commitment_logs table in the estuary database error - ErrNotFound, db record for id not found error - ErrUpdateFailed, db meta data copy failed or db.Save call failed

func UpdateWalletLogs

func UpdateWalletLogs(ctx context.Context, argID int64, updated *model.WalletLogs) (result *model.WalletLogs, RowsAffected int64, err error)

UpdateWalletLogs is a function to update a single record from wallet_logs table in the estuary database error - ErrNotFound, db record for id not found error - ErrUpdateFailed, db meta data copy failed or db.Save call failed

Types

type BuildInfo

type BuildInfo struct {

	// BuildDate date string of when build was performed filled in by -X compile flag
	BuildDate string

	// LatestCommit date string of when build was performed filled in by -X compile flag
	LatestCommit string

	// BuildNumber date string of when build was performed filled in by -X compile flag
	BuildNumber string

	// BuiltOnIP date string of when build was performed filled in by -X compile flag
	BuiltOnIP string

	// BuiltOnOs date string of when build was performed filled in by -X compile flag
	BuiltOnOs string

	// RuntimeVer date string of when build was performed filled in by -X compile flag
	RuntimeVer string
}

BuildInfo is used to define the application build info, and inject values into via the build process.

type LogSql

type LogSql func(ctx context.Context, sql string)

type RefreshGlobalStatsViewResponse

type RefreshGlobalStatsViewResponse struct {
	Message     string `json:"message"`
	Description string `json:"description"`
}

Jump to

Keyboard shortcuts

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