Documentation
¶
Index ¶
- Variables
- func ActivateUser(userID int, active bool, updatedBy string) error
- func AddAssetCode(account *models.AdminStellarAccount, assetCode string, updatedBy string) error
- func AddIcoPhase(icoPhase *models.IcoPhase, ...) error
- func AddKnownCurrency(currency *models.AdminKnownCurrency) error
- func AddKnownInflationDestination(inflationDestination *models.AdminKnownInflationDestination) error
- func AddPromo(promo *models.AdminPromo) error
- func AddSigner(account *models.AdminStellarAccount, signer *models.AdminStellarSigner, ...) error
- func AddStellarAccount(account *models.AdminStellarAccount, assetCode string) error
- func AddTrustline(trustline *models.AdminUnauthorizedTrustline, updatedBy string) error
- func AllActiveAdministrators() (models.AdminUserSlice, error)
- func AllStellarAccounts() (models.AdminStellarAccountSlice, error)
- func AllUsers() (models.AdminUserSlice, error)
- func ChangeKnownCurrencyOrder(currency *models.AdminKnownCurrency, OrderModifier int, updatedBy string) error
- func ChangeKnownInflationDestinationOrder(inflationDestination *models.AdminKnownInflationDestination, OrderModifier int, ...) error
- func ChangePromoOrder(promo *models.AdminPromo, OrderModifier int, updatedBy string) error
- func CreateNewDB(cnf *config.Config) error
- func DeleteIco(ico *models.Ico) error
- func DeleteKnownCurrency(currency *models.AdminKnownCurrency) error
- func DeleteKnownInflationDestination(inflationDestination *models.AdminKnownInflationDestination) error
- func DeletePromo(promo *models.AdminPromo) error
- func DeleteStellarAccount(account *models.AdminStellarAccount) error
- func DeleteUnauthorizedTrustline(trustorPublicKey string, issuingPublicKey string, assetCode string) error
- func ExistsCurrency(id int) (bool, error)
- func ExistsIcoName(icoName string, selfID *int) (bool, error)
- func ExistsKnownCurrency(issuerPublicKey, assetCode string) (bool, error)
- func ExistsKnownInflationDestination(issuerPublicKey string) (bool, error)
- func ExistsStellarAccount(publicKey string) (bool, error)
- func ExistsUnauthorizedTrustline(trustorPublicKey string, issuingPublicKey string, assetCode string) (bool, error)
- func GetActivePromos() (models.AdminPromoSlice, error)
- func GetCoreTrustlines(accountPublicKey string) (coremodels.TrustlineSlice, error)
- func GetIco(id int) (*models.Ico, error)
- func GetIcoEager(id int) (*models.Ico, error)
- func GetKnownCurrencies() (models.AdminKnownCurrencySlice, error)
- func GetKnownCurrency(issuerPublicKey, assetCode string) (*models.AdminKnownCurrency, error)
- func GetKnownCurrencyByID(ID int) (*models.AdminKnownCurrency, error)
- func GetKnownInflationDestination(issuerPublicKey string) (*models.AdminKnownInflationDestination, error)
- func GetKnownInflationDestinationByID(ID int) (*models.AdminKnownInflationDestination, error)
- func GetKnownInflationDestinations() (models.AdminKnownInflationDestinationSlice, error)
- func GetPromoByID(ID int) (*models.AdminPromo, error)
- func GetPromos() (models.AdminPromoSlice, error)
- func GetStellarAccount(publicKey string) (*models.AdminStellarAccount, error)
- func GetStellarIssuerAccounts() (models.AdminStellarAccountSlice, error)
- func GetStellarSigner(publicKey string) (*models.AdminStellarSigner, error)
- func GetUnauthorizedTrustlines(trustorPublicKey string) (models.AdminUnauthorizedTrustlineSlice, error)
- func IssuerAssetCodes(issuerPublicKey string) (models.AdminStellarAssetSlice, error)
- func IssuerStellarAccounts() (models.AdminStellarAccountSlice, error)
- func KnownCurrencyNewOrderIndex() (int, error)
- func KnownInflationDestinationNewOrderIndex() (int, error)
- func PromoNewOrderIndex() (int, error)
- func RegisterUser(user *models.AdminUser, groups []string) error
- func RemoveAssetCode(account *models.AdminStellarAccount, assetCode string, updatedBy string) error
- func RemoveSigner(account *models.AdminStellarAccount, signerPublicKey string, signerType string, ...) error
- func SetGroups(userID int, groups []string) error
- func UpdateKnownCurrency(currency *models.AdminKnownCurrency, updatedBy string) error
- func UpdateKnownInflationDestination(inflationDestination *models.AdminKnownInflationDestination, updatedBy string) error
- func UpdateLastLogin(user UserDetails) error
- func UpdatePromo(promo *models.AdminPromo, updatedBy string) error
- func UpdateSigner(signer *models.AdminStellarSigner, updatedBy string) error
- func UpdateStellarAccount(account *models.AdminStellarAccount, updatedBy string) error
- func UpdateSupportedCurrencies(icoID int, supportedCurrencies models.IcoSupportedExchangeCurrencySlice) error
- func UpdateUser(user models.AdminUser, updatedBy string) error
- type UserDetails
Constants ¶
This section is empty.
Variables ¶
var DB *sql.DB
DB is the admin database
var DBC *sql.DB
DBC is the customer database
var DBSC *sql.DB
DBSC is the stellar core database
var MimeTypes map[string]string
MimeTypes - dictionary of mime types used
Functions ¶
func ActivateUser ¶
ActivateUser activates or deactivates the state of a user
func AddAssetCode ¶
func AddAssetCode(account *models.AdminStellarAccount, assetCode string, updatedBy string) error
AddAssetCode - adds new asset code to issuer account
func AddIcoPhase ¶
func AddIcoPhase(icoPhase *models.IcoPhase, currencies models.IcoPhaseActivatedExchangeCurrencySlice) error
AddIcoPhase - adds a new ico phase
func AddKnownCurrency ¶
func AddKnownCurrency(currency *models.AdminKnownCurrency) error
AddKnownCurrency adds new currency to known currencies
func AddKnownInflationDestination ¶
func AddKnownInflationDestination(inflationDestination *models.AdminKnownInflationDestination) error
AddKnownInflationDestination adds new inflation destination to known inflation destinations
func AddSigner ¶
func AddSigner(account *models.AdminStellarAccount, signer *models.AdminStellarSigner, updatedBy string) error
AddSigner - adds new signer to issuer account
func AddStellarAccount ¶
func AddStellarAccount(account *models.AdminStellarAccount, assetCode string) error
AddStellarAccount creates a new account
func AddTrustline ¶
func AddTrustline(trustline *models.AdminUnauthorizedTrustline, updatedBy string) error
AddTrustline adds a new trustline
func AllActiveAdministrators ¶
func AllActiveAdministrators() (models.AdminUserSlice, error)
AllActiveAdministrators - returns all users
func AllStellarAccounts ¶
func AllStellarAccounts() (models.AdminStellarAccountSlice, error)
AllStellarAccounts - returns all stellar accounts
func ChangeKnownCurrencyOrder ¶
func ChangeKnownCurrencyOrder(currency *models.AdminKnownCurrency, OrderModifier int, updatedBy string) error
ChangeKnownCurrencyOrder - changes the order of the currency
func ChangeKnownInflationDestinationOrder ¶
func ChangeKnownInflationDestinationOrder(inflationDestination *models.AdminKnownInflationDestination, OrderModifier int, updatedBy string) error
ChangeKnownInflationDestinationOrder - changes the order of the inflation destination
func ChangePromoOrder ¶
func ChangePromoOrder(promo *models.AdminPromo, OrderModifier int, updatedBy string) error
ChangePromoOrder - changes the order of the promo
func CreateNewDB ¶
CreateNewDB creates a new DB connection
func DeleteKnownCurrency ¶
func DeleteKnownCurrency(currency *models.AdminKnownCurrency) error
DeleteKnownCurrency - deletes the currency
func DeleteKnownInflationDestination ¶
func DeleteKnownInflationDestination(inflationDestination *models.AdminKnownInflationDestination) error
DeleteKnownInflationDestination - deletes the inflation destination
func DeleteStellarAccount ¶
func DeleteStellarAccount(account *models.AdminStellarAccount) error
DeleteStellarAccount - deletes the account
func DeleteUnauthorizedTrustline ¶
func DeleteUnauthorizedTrustline(trustorPublicKey string, issuingPublicKey string, assetCode string) error
DeleteUnauthorizedTrustline - removes the trustline
func ExistsCurrency ¶
ExistsCurrency - true if a currency with the specified asset code and issuer is found
func ExistsIcoName ¶
ExistsIcoName - true if an ico with the same name exists
func ExistsKnownCurrency ¶
ExistsKnownCurrency - true if a currency with the same public key and asset code exists
func ExistsKnownInflationDestination ¶
ExistsKnownInflationDestination - true if a inflation destination with the same asset code exists
func ExistsStellarAccount ¶
ExistsStellarAccount - true if an account with the public key already exists
func ExistsUnauthorizedTrustline ¶
func ExistsUnauthorizedTrustline(trustorPublicKey string, issuingPublicKey string, assetCode string) (bool, error)
ExistsUnauthorizedTrustline - true if trustline already exists
func GetActivePromos ¶
func GetActivePromos() (models.AdminPromoSlice, error)
GetActivePromos - returns active promos
func GetCoreTrustlines ¶
func GetCoreTrustlines(accountPublicKey string) (coremodels.TrustlineSlice, error)
GetCoreTrustlines - gets the trustlines
func GetIcoEager ¶
GetIcoEager - gets ico and eager loads its children
func GetKnownCurrencies ¶
func GetKnownCurrencies() (models.AdminKnownCurrencySlice, error)
GetKnownCurrencies - returns all known currencies
func GetKnownCurrency ¶
func GetKnownCurrency(issuerPublicKey, assetCode string) (*models.AdminKnownCurrency, error)
GetKnownCurrency - returns the known currency
func GetKnownCurrencyByID ¶
func GetKnownCurrencyByID(ID int) (*models.AdminKnownCurrency, error)
GetKnownCurrencyByID - returns the known currency associated to the id
func GetKnownInflationDestination ¶
func GetKnownInflationDestination(issuerPublicKey string) (*models.AdminKnownInflationDestination, error)
GetKnownInflationDestination - returns the known inflation destination
func GetKnownInflationDestinationByID ¶
func GetKnownInflationDestinationByID(ID int) (*models.AdminKnownInflationDestination, error)
GetKnownInflationDestinationByID - returns the known inflation destination associated to the id
func GetKnownInflationDestinations ¶
func GetKnownInflationDestinations() (models.AdminKnownInflationDestinationSlice, error)
GetKnownInflationDestinations - returns all known inflation destinations
func GetPromoByID ¶
func GetPromoByID(ID int) (*models.AdminPromo, error)
GetPromoByID - returns the promo associated to the id
func GetStellarAccount ¶
func GetStellarAccount(publicKey string) (*models.AdminStellarAccount, error)
GetStellarAccount - returns the stellar account
func GetStellarIssuerAccounts ¶
func GetStellarIssuerAccounts() (models.AdminStellarAccountSlice, error)
GetStellarIssuerAccounts - gets the stellar issuer accounts
func GetStellarSigner ¶
func GetStellarSigner(publicKey string) (*models.AdminStellarSigner, error)
GetStellarSigner - returns the stellar signer
func GetUnauthorizedTrustlines ¶
func GetUnauthorizedTrustlines(trustorPublicKey string) (models.AdminUnauthorizedTrustlineSlice, error)
GetUnauthorizedTrustlines - gets the trustlines
func IssuerAssetCodes ¶
func IssuerAssetCodes(issuerPublicKey string) (models.AdminStellarAssetSlice, error)
IssuerAssetCodes - returns the asset codes
func IssuerStellarAccounts ¶
func IssuerStellarAccounts() (models.AdminStellarAccountSlice, error)
IssuerStellarAccounts - returns the issuer stellar accounts
func KnownCurrencyNewOrderIndex ¶
KnownCurrencyNewOrderIndex returns the greatest order from the db + 1, used when inserting a new currency
func KnownInflationDestinationNewOrderIndex ¶
KnownInflationDestinationNewOrderIndex returns the greatest order from the db + 1, used when inserting a new inflation destination
func PromoNewOrderIndex ¶
PromoNewOrderIndex returns the greatest order from the db + 1, used when inserting a new promo
func RegisterUser ¶
RegisterUser creates a new user
func RemoveAssetCode ¶
func RemoveAssetCode(account *models.AdminStellarAccount, assetCode string, updatedBy string) error
RemoveAssetCode - removes asset code from issuer account
func RemoveSigner ¶
func RemoveSigner(account *models.AdminStellarAccount, signerPublicKey string, signerType string, updatedBy string) error
RemoveSigner - removes signer from issuer account
func UpdateKnownCurrency ¶
func UpdateKnownCurrency(currency *models.AdminKnownCurrency, updatedBy string) error
UpdateKnownCurrency - updates the currency in the db
func UpdateKnownInflationDestination ¶
func UpdateKnownInflationDestination(inflationDestination *models.AdminKnownInflationDestination, updatedBy string) error
UpdateKnownInflationDestination - updates the inflation destination in the db
func UpdateLastLogin ¶
func UpdateLastLogin(user UserDetails) error
UpdateLastLogin updates in the db the last login date
func UpdatePromo ¶
func UpdatePromo(promo *models.AdminPromo, updatedBy string) error
UpdatePromo - updates the promo in the db
func UpdateSigner ¶
func UpdateSigner(signer *models.AdminStellarSigner, updatedBy string) error
UpdateSigner - updates the signer
func UpdateStellarAccount ¶
func UpdateStellarAccount(account *models.AdminStellarAccount, updatedBy string) error
UpdateStellarAccount - updates the account in the db
func UpdateSupportedCurrencies ¶
func UpdateSupportedCurrencies(icoID int, supportedCurrencies models.IcoSupportedExchangeCurrencySlice) error
UpdateSupportedCurrencies - updates the supported currencies of an ico
Types ¶
type UserDetails ¶
type UserDetails struct { ID int `json:"id"` Password string `json:"password"` Email string `json:"email"` FirstName string `json:"firstname"` LastName string `json:"lastName"` Phone string `json:"phone"` Active bool `json:"active"` Groups []string `json:"groups"` }
UserDetails holds the user info
func GetUserByEmail ¶
func GetUserByEmail(email string) (*UserDetails, error)
GetUserByEmail returns the user details for the specified email
func GetUserByID ¶
func GetUserByID(userID int) (*UserDetails, error)
GetUserByID returns the user details for the specified ID