Documentation
¶
Index ¶
- Constants
- Variables
- func DbCoinToPbCoin(coin db.CoinType) (pb_v1.CoinType, error)
- func DbInvoiceStatusToPbInvoiceStatus(status db.InvoiceStatusType) (pb_v1.InvoiceStatusType, error)
- func DbInvoiceToPbInvoice(invoice *db.Invoice) *pb_v1.Invoice
- func GetMapKeys[K comparable, V any](m map[K]V) []K
- func GetOptionOrEnvValue(env string, opt string) string
- func GetRequestIdOrEmptyString(ctx context.Context) string
- func InitDbQueriesWithTx(ctx context.Context, dbConnPool *pgxpool.Pool) (*db.Queries, pgx.Tx, error)
- func PbCoinToDbCoin(coin pb_v1.CoinType) (db.CoinType, error)
- func PbNewInvoiceToProcessorNewInvoice(req *pb_v1.CreateInvoiceRequest) *dto.NewInvoiceRequest
- func PgUUIDToString(uuid pgtype.UUID) string
- func SliceToSet[T comparable](s []T) map[T]bool
- func StringToPgUUID(uuidStr string) (*pgtype.UUID, error)
- type CustomMetadata
- type SyncMapTypeSafe
- func (m *SyncMapTypeSafe[K, V]) Delete(key K)
- func (m *SyncMapTypeSafe[K, V]) Load(key K) (value V, ok bool)
- func (m *SyncMapTypeSafe[K, V]) LoadAndDelete(key K) (value V, loaded bool)
- func (m *SyncMapTypeSafe[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)
- func (m *SyncMapTypeSafe[K, V]) Range(f func(key K, value V) bool)
- func (m *SyncMapTypeSafe[K, V]) Store(key K, value V)
Constants ¶
View Source
const ( MIN_SYNC_TIMEOUT time.Duration = 10 * time.Second SEND_TIMEOUT time.Duration = 10 * time.Second HEALTH_CHECK_TIEMOUT time.Duration = 5 * time.Second )
View Source
const ( DefaultFailedSqlTxInitMsg string = "An error occurred while initiating an SQL transaction." DefaultFailedSqlQueryMsg string = "An error occurred while executing a SQL query." DefaultFailedScanningToPostgresqlDataTypeMsg string = "An error occurred while scanning the value into a PostgreSQL data type." DefaultFailedFetchingDaemonMsg string = "An error occurred while fetching." FailedStringToPgUUIDMappingMsg string = "An error occurred while converting the string to the PostgreSQL UUID data type." InvalidUserIdInvalidUUIDMsg string = "Invalid userId (invalid UUID)." InvalidUserIdUserExistsMsg string = "Invalid userId (user exists)." InvalidUserIdUserDoesNotExistMsg string = "Invalid userId (user does not exist)." InvoiceAmountBelow0ErrorMsg string = "Invoice amount can't be below 0." InvoiceErrorWhileHandlingMsg string = "An error occurred while handling invoice." InvoiceStreamSendingDataErrorMsg string = "An error occurred while sending data." InvoiceStreamClosedErrorMsg string = "Stream has been closed." )
View Source
const ( RequestIdKey string = "request-id" MetadataCtxKey contextKey = "metadata" )
View Source
const (
RequestIdLogKey = "requestId"
)
Variables ¶
View Source
var (
InvalidNetworkTypeErr error = errors.New("invalid network type")
)
Functions ¶
func DbInvoiceStatusToPbInvoiceStatus ¶
func DbInvoiceStatusToPbInvoiceStatus(status db.InvoiceStatusType) (pb_v1.InvoiceStatusType, error)
func GetMapKeys ¶ added in v0.7.0
func GetMapKeys[K comparable, V any](m map[K]V) []K
func GetOptionOrEnvValue ¶ added in v0.4.0
func GetRequestIdOrEmptyString ¶ added in v0.4.0
func InitDbQueriesWithTx ¶
func PbNewInvoiceToProcessorNewInvoice ¶
func PbNewInvoiceToProcessorNewInvoice(req *pb_v1.CreateInvoiceRequest) *dto.NewInvoiceRequest
func PgUUIDToString ¶
func SliceToSet ¶ added in v0.7.0
func SliceToSet[T comparable](s []T) map[T]bool
Types ¶
type CustomMetadata ¶ added in v0.4.0
type CustomMetadata struct {
RequestId string
}
type SyncMapTypeSafe ¶
func (*SyncMapTypeSafe[K, V]) Delete ¶
func (m *SyncMapTypeSafe[K, V]) Delete(key K)
func (*SyncMapTypeSafe[K, V]) Load ¶
func (m *SyncMapTypeSafe[K, V]) Load(key K) (value V, ok bool)
func (*SyncMapTypeSafe[K, V]) LoadAndDelete ¶
func (m *SyncMapTypeSafe[K, V]) LoadAndDelete(key K) (value V, loaded bool)
func (*SyncMapTypeSafe[K, V]) LoadOrStore ¶
func (m *SyncMapTypeSafe[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)
func (*SyncMapTypeSafe[K, V]) Range ¶
func (m *SyncMapTypeSafe[K, V]) Range(f func(key K, value V) bool)
func (*SyncMapTypeSafe[K, V]) Store ¶
func (m *SyncMapTypeSafe[K, V]) Store(key K, value V)
Click to show internal directories.
Click to hide internal directories.