Documentation ¶
Index ¶
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type AllowedFI
- type AllowedUser
- type AuthData
- type AuthorizedTransaction
- type Database
- type PostgresDatabase
- func (d *PostgresDatabase) DeleteAllowedFIByDomain(domain string) error
- func (d *PostgresDatabase) DeleteAllowedUserByDomainAndUserID(domain, userID string) error
- func (d *PostgresDatabase) GetAllowedFIByDomain(domain string) (*AllowedFI, error)
- func (d *PostgresDatabase) GetAllowedUserByDomainAndUserID(domain, userID string) (*AllowedUser, error)
- func (d *PostgresDatabase) GetAuthData(requestID string) (*AuthData, error)
- func (d *PostgresDatabase) GetAuthorizedTransactionByMemo(memo string) (*AuthorizedTransaction, error)
- func (d *PostgresDatabase) GetDB() *sql.DB
- func (d *PostgresDatabase) InsertAllowedFI(fi *AllowedFI) error
- func (d *PostgresDatabase) InsertAllowedUser(user *AllowedUser) error
- func (d *PostgresDatabase) InsertAuthData(authData *AuthData) error
- func (d *PostgresDatabase) InsertAuthorizedTransaction(transaction *AuthorizedTransaction) error
- func (d *PostgresDatabase) Open(dsn string) error
Constants ¶
This section is empty.
Variables ¶
var Migrations migrate.MigrationSource = &migrate.AssetMigrationSource{ Asset: Asset, AssetDir: AssetDir, Dir: "migrations", }
Migrations represents all of the schema migration
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
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"` }
AllowedFI represents allowed FI
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"` }
AllowedUser represents allowed user
type AuthData ¶
type AuthData struct { ID int64 `db:"id"` RequestID string `db:"request_id"` Domain string `db:"domain"` AuthData string `db:"auth_data"` }
AuthData represents auth data
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"` }
AuthorizedTransaction represents authorized transaction
type Database ¶
type Database interface { InsertAuthorizedTransaction(transaction *AuthorizedTransaction) error GetAuthorizedTransactionByMemo(memo string) (*AuthorizedTransaction, error) InsertAllowedFI(fi *AllowedFI) error GetAllowedFIByDomain(domain string) (*AllowedFI, error) DeleteAllowedFIByDomain(domain string) error InsertAllowedUser(user *AllowedUser) error GetAllowedUserByDomainAndUserID(domain, userID string) (*AllowedUser, error) DeleteAllowedUserByDomainAndUserID(domain, userID string) error InsertAuthData(authData *AuthData) error GetAuthData(requestID string) (*AuthData, error) }
type PostgresDatabase ¶
type PostgresDatabase struct {
// contains filtered or unexported fields
}
func (*PostgresDatabase) DeleteAllowedFIByDomain ¶
func (d *PostgresDatabase) DeleteAllowedFIByDomain(domain string) error
DeleteAllowedFIByDomain deletes allowed FI by a domain
func (*PostgresDatabase) DeleteAllowedUserByDomainAndUserID ¶
func (d *PostgresDatabase) DeleteAllowedUserByDomainAndUserID(domain, userID string) error
DeleteAllowedUserByDomainAndUserID deletes allowed user by domain and userID
func (*PostgresDatabase) GetAllowedFIByDomain ¶
func (d *PostgresDatabase) GetAllowedFIByDomain(domain string) (*AllowedFI, error)
GetAllowedFIByDomain returns allowed FI by a domain
func (*PostgresDatabase) GetAllowedUserByDomainAndUserID ¶
func (d *PostgresDatabase) GetAllowedUserByDomainAndUserID(domain, userID string) (*AllowedUser, error)
GetAllowedUserByDomainAndUserID returns allowed user by domain and userID
func (*PostgresDatabase) GetAuthData ¶
func (d *PostgresDatabase) GetAuthData(requestID string) (*AuthData, error)
GetAuthData gets auth data by request ID
func (*PostgresDatabase) GetAuthorizedTransactionByMemo ¶
func (d *PostgresDatabase) GetAuthorizedTransactionByMemo(memo string) (*AuthorizedTransaction, error)
GetAuthorizedTransactionByMemo returns authorized transaction searching by memo
func (*PostgresDatabase) GetDB ¶
func (d *PostgresDatabase) GetDB() *sql.DB
func (*PostgresDatabase) InsertAllowedFI ¶
func (d *PostgresDatabase) InsertAllowedFI(fi *AllowedFI) error
InsertAllowedFI inserts a new allowed FI into DB.
func (*PostgresDatabase) InsertAllowedUser ¶
func (d *PostgresDatabase) InsertAllowedUser(user *AllowedUser) error
InsertAllowedUser inserts a new allowed user into DB.
func (*PostgresDatabase) InsertAuthData ¶
func (d *PostgresDatabase) InsertAuthData(authData *AuthData) error
InsertAuthData inserts a new auth data into DB.
func (*PostgresDatabase) InsertAuthorizedTransaction ¶
func (d *PostgresDatabase) InsertAuthorizedTransaction(transaction *AuthorizedTransaction) error
InsertAuthorizedTransaction inserts a new authorized transaction into DB.
func (*PostgresDatabase) Open ¶
func (d *PostgresDatabase) Open(dsn string) error