entities

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2018 License: Apache-2.0, BSD-2-Clause-Views, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowedFi

type AllowedFi struct {
	ID        *int64    `db:"id"`
	Name      string    `db:"name"`
	Domain    string    `db:"domain"`
	PublicKey string    `db:"public_key"`
	AllowedAt time.Time `db:"allowed_at"`
	// contains filtered or unexported fields
}

AllowedFi represents allowed FI

func (*AllowedFi) GetID

func (e *AllowedFi) GetID() *int64

GetID returns ID of the entity

func (*AllowedFi) IsNew

func (e *AllowedFi) IsNew() bool

IsNew returns true if the entity has not been persisted yet

func (*AllowedFi) SetExists

func (e *AllowedFi) SetExists()

SetExists sets entity as persisted

func (*AllowedFi) SetID

func (e *AllowedFi) SetID(id int64)

SetID sets ID of the entity

type AllowedUser

type AllowedUser struct {
	ID          *int64    `db:"id"`
	FiName      string    `db:"fi_name"`
	FiDomain    string    `db:"fi_domain"`
	FiPublicKey string    `db:"fi_public_key"`
	UserID      string    `db:"user_id"`
	AllowedAt   time.Time `db:"allowed_at"`
	// contains filtered or unexported fields
}

AllowedUser represents allowed user

func (*AllowedUser) GetID

func (e *AllowedUser) GetID() *int64

GetID returns ID of the entity

func (*AllowedUser) IsNew

func (e *AllowedUser) IsNew() bool

IsNew returns true if the entity has not been persisted yet

func (*AllowedUser) SetExists

func (e *AllowedUser) SetExists()

SetExists sets entity as persisted

func (*AllowedUser) SetID

func (e *AllowedUser) SetID(id int64)

SetID sets ID of the entity

type AuthorizedTransaction

type AuthorizedTransaction struct {
	ID             *int64    `db:"id"`
	TransactionID  string    `db:"transaction_id"`
	Memo           string    `db:"memo"`
	TransactionXdr string    `db:"transaction_xdr"`
	AuthorizedAt   time.Time `db:"authorized_at"`
	Data           string    `db:"data"`
	// contains filtered or unexported fields
}

AuthorizedTransaction represents authorized transaction

func (*AuthorizedTransaction) GetID

func (e *AuthorizedTransaction) GetID() *int64

GetID returns ID of the entity

func (*AuthorizedTransaction) IsNew

func (e *AuthorizedTransaction) IsNew() bool

IsNew returns true if the entity has not been persisted yet

func (*AuthorizedTransaction) SetExists

func (e *AuthorizedTransaction) SetExists()

SetExists sets entity as persisted

func (*AuthorizedTransaction) SetID

func (e *AuthorizedTransaction) SetID(id int64)

SetID sets ID of the entity

type Entity

type Entity interface {
	GetID() *int64 // Returns nil if object hasn't been persisted yet.
	SetID(int64)   // Used by driver. Sets `Id` field to the id of the row in DB.
	IsNew() bool   // Returns true if object hasn't been persisted in DB yet.
	SetExists()    // Used by driver. Sets internal `exists` flag of Entity to true.
}

Entity interface must be implemented by every struct that can be persisted in a DB

type ReceivedPayment

type ReceivedPayment struct {
	ID            *int64    `db:"id" json:"id"`
	OperationID   string    `db:"operation_id" json:"operation_id"`
	ProcessedAt   time.Time `db:"processed_at" json:"processed_at"`
	PagingToken   string    `db:"paging_token" json:"paging_token"`
	Status        string    `db:"status" json:"status"`
	TransactionID string    `db:"transaction_id" json:"transaction_id"`
	// contains filtered or unexported fields
}

ReceivedPayment represents payment received by the gateway server

func (*ReceivedPayment) GetID

func (e *ReceivedPayment) GetID() *int64

GetID returns ID of the entity

func (*ReceivedPayment) IsNew

func (e *ReceivedPayment) IsNew() bool

IsNew returns true if the entity has not been persisted yet

func (*ReceivedPayment) SetExists

func (e *ReceivedPayment) SetExists()

SetExists sets entity as persisted

func (*ReceivedPayment) SetID

func (e *ReceivedPayment) SetID(id int64)

SetID sets ID of the entity

type SentTransaction

type SentTransaction struct {
	ID            *int64                `db:"id" json:"id"`
	PaymentID     *string               `db:"payment_id" json:"payment_id"`
	TransactionID string                `db:"transaction_id" json:"transaction_id"`
	Status        SentTransactionStatus `db:"status" json:"status"` // sending/success/failure
	Source        string                `db:"source" json:"source"`
	SubmittedAt   time.Time             `db:"submitted_at" json:"submitted_at"`
	SucceededAt   *time.Time            `db:"succeeded_at" json:"succeeded_at"`
	Ledger        *uint64               `db:"ledger" json:"ledger"`
	EnvelopeXdr   string                `db:"envelope_xdr" json:"envelope_xdr"`
	ResultXdr     *string               `db:"result_xdr" json:"result_xdr"`
	// contains filtered or unexported fields
}

SentTransaction represents transaction sent by the gateway server

func (*SentTransaction) GetID

func (e *SentTransaction) GetID() *int64

GetID returns ID of the entity

func (*SentTransaction) IsNew

func (e *SentTransaction) IsNew() bool

IsNew returns true if the entity has not been persisted yet

func (*SentTransaction) MarkFailed

func (e *SentTransaction) MarkFailed(resultXdr string)

MarkFailed marks transaction as failed

func (*SentTransaction) MarkSucceeded

func (e *SentTransaction) MarkSucceeded(ledger uint64)

MarkSucceeded marks transaction as succeeded

func (*SentTransaction) SetExists

func (e *SentTransaction) SetExists()

SetExists sets entity as persisted

func (*SentTransaction) SetID

func (e *SentTransaction) SetID(id int64)

SetID sets ID of the entity

type SentTransactionStatus

type SentTransactionStatus string

SentTransactionStatus type represents sent transaction status

const (
	// SentTransactionStatusSending is a status indicating that transaction is sending
	SentTransactionStatusSending SentTransactionStatus = "sending"
	// SentTransactionStatusSuccess is a status indicating that transaction has been successfully sent
	SentTransactionStatusSuccess SentTransactionStatus = "success"
	// SentTransactionStatusFailure is a status indicating that there has been an error while sending a transaction
	SentTransactionStatusFailure SentTransactionStatus = "failure"
)

func (*SentTransactionStatus) Scan added in v0.0.27

func (s *SentTransactionStatus) Scan(src interface{}) error

Scan implements database/sql.Scanner interface

func (SentTransactionStatus) Value

func (status SentTransactionStatus) Value() (driver.Value, error)

Value implements driver.Valuer

Jump to

Keyboard shortcuts

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