Documentation
¶
Index ¶
Constants ¶
View Source
const ( DOCKER_EXITED containerStatus = "exited" DOCKER_RUNNING containerStatus = "running" )
Variables ¶
View Source
var ( ErrWalletNotFound = errors.New("wallet not found") ErrWalletNotRunning = errors.New("wallet not running") ErrWalletAlreadyRunning = errors.New("wallet already running") ErrCouldNotStopWallet = errors.New("wallet could not be stopped") ErrCouldNotStartWallet = errors.New("wallet could not be started") ErrCouldNotSaveWallet = errors.New("wallet could not be saved") ErrCouldNotKillWallet = errors.New("wallet could not be killed") )
Functions ¶
Types ¶
type BlockHeight ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(apiRouter *gin.RouterGroup) Controller
func (*Controller) Routes ¶
func (controller *Controller) Routes()
Routes registers this controllers sub-routing in the main apiRouter. It returns a RouterGroup containing only the routes for the operations on the Wallet model.
type CreateDTO ¶
type CreateDTO struct {
PasswordDTO
Name string `json:"name" binding:"required,max=255"`
}
type DetailedWallet ¶
type DetailedWallet struct {
*LoadedWallet
Balance Balance `json:"balance"`
BlockHeight BlockHeight `json:"blockHeight"`
PeerCount uint8 `json:"peerCount"`
}
type InstanceStatus ¶
type InstanceStatus string
const ( STOPPED InstanceStatus = "STOPPED" RUNNING InstanceStatus = "RUNNING" ERROR InstanceStatus = "ERROR" )
type LoadedWallet ¶
type LoadedWallet struct {
*Wallet
}
type PasswordDTO ¶
type PasswordDTO struct {
Password string `json:"password" binding:"required,min=8"`
}
type Service ¶
type Service interface {
CreateWallet(dto CreateDTO, userId string) (*DetailedWallet, error)
ImportWallet(dto ImportDTO, userId string) (*DetailedWallet, error)
GetWallets(userId string) ([]*Wallet, error)
GetWallet(walletId string, userId string) (*DetailedWallet, error)
StartWallet(walletId string, password string, userId string) (*DetailedWallet, error)
StopWallet(walletId string, userId string) (*Wallet, error)
FetchDetails(wallet *LoadedWallet, rpc iridium.WalletdRPC) (*DetailedWallet, error)
NewWalletdClient(walletId string) (iridium.WalletdRPC, error)
}
func InitService ¶
type StatusEvent ¶
type StatusEvent struct {
WalletID string
Status InstanceStatus
}
type StatusWatcher ¶
type StatusWatcher interface {
Run() chan *DetailedWallet
Close()
AddWallet(wallet *LoadedWallet)
RemoveWallet(wallet *Wallet)
}
func InitWatcher ¶
func InitWatcher(dockerClient *client.Client, eventService event.Service) StatusWatcher
Click to show internal directories.
Click to hide internal directories.