Documentation ¶
Index ¶
- type Service
- func (db *Service) Create(sc datatype.ServiceContainer, userID datatype.ID, name string, symbol string, ...) (*datatype.Asset, error)
- func (db *Service) CreateAssetBlock(userID datatype.ID, assetID datatype.ID, blockText string, images []string) (*datatype.Block, error)
- func (db *Service) DepositBalance(userID datatype.ID, assetID datatype.ID, amount decimaldt.Decimal) error
- func (db *Service) DidUserLikeBlock(userID datatype.ID, blockID datatype.ID) bool
- func (db *Service) FindAll(user *datatype.User) ([]datatype.Asset, error)
- func (db *Service) FindByID(id datatype.ID) (*datatype.Asset, error)
- func (db *Service) FindByName(name string) (*datatype.Asset, error)
- func (db *Service) FindBySymbol(symbol string) (*datatype.Asset, error)
- func (db *Service) FindUserBalance(userID datatype.ID, assetID datatype.ID) (decimaldt.Decimal, decimaldt.Decimal, error)
- func (db *Service) FindUserFavoriteAssets(user *datatype.User) ([]datatype.Asset, error)
- func (db *Service) GetAssetBlockImages(blockID datatype.ID) ([]string, error)
- func (db *Service) GetAssetBlocks(assetID datatype.ID) ([]datatype.Block, error)
- func (db *Service) GetAssetMiners(assetID datatype.ID) ([]datatype.Miner, error)
- func (db *Service) IsMiner(userID datatype.ID, assetID datatype.ID) bool
- func (db *Service) IsOracle(userID datatype.ID, assetID datatype.ID) bool
- func (db *Service) SensorVerifyBlock(sc *datatype.ServiceContainer, status int, accessToken string) error
- func (db *Service) ToggleFavorite(user *datatype.User, assetID datatype.ID) error
- func (db *Service) ToggleFavoriteBlock(user *datatype.User, blockID datatype.ID) error
- func (db *Service) UpdateOraclePingTime(accessToken string) error
- func (db *Service) ValidateAsset(name string, symbol string, description string) error
- func (db *Service) VerifyAssetBlock(sc *datatype.ServiceContainer, user *datatype.User, blockID datatype.ID, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
Service defines asset service type
func (*Service) Create ¶
func (db *Service) Create( sc datatype.ServiceContainer, userID datatype.ID, name string, symbol string, description string, isSensor bool, ethereumAddress string, ethereumTransactionAddress string, ) (*datatype.Asset, error)
Create insert asset
func (*Service) CreateAssetBlock ¶
func (db *Service) CreateAssetBlock( userID datatype.ID, assetID datatype.ID, blockText string, images []string, ) (*datatype.Block, error)
CreateAssetBlock insert asset block
func (*Service) DepositBalance ¶
func (db *Service) DepositBalance( userID datatype.ID, assetID datatype.ID, amount decimaldt.Decimal, ) error
DepositBalance cache user balance in the SQL db
func (*Service) DidUserLikeBlock ¶
DidUserLikeBlock checks whether user liked a block or not
func (*Service) FindByName ¶
FindByName find asset by name
func (*Service) FindBySymbol ¶
FindBySymbol find asset by symbol
func (*Service) FindUserBalance ¶
func (db *Service) FindUserBalance( userID datatype.ID, assetID datatype.ID, ) ( decimaldt.Decimal, decimaldt.Decimal, error, )
FindUserBalance finds user's balance of given asset
func (*Service) FindUserFavoriteAssets ¶
FindUserFavoriteAssets finds all user's favored assits
func (*Service) GetAssetBlockImages ¶
GetAssetBlockImages finds block images
func (*Service) GetAssetBlocks ¶
GetAssetBlocks finds all user's favored assits
func (*Service) GetAssetMiners ¶
GetAssetMiners finds all user's favored assits
func (*Service) SensorVerifyBlock ¶
func (db *Service) SensorVerifyBlock( sc *datatype.ServiceContainer, status int, accessToken string, ) error
SensorVerifyBlock sensor claim verification
func (*Service) ToggleFavorite ¶
ToggleFavorite toggles asset as fav/not fav
func (*Service) ToggleFavoriteBlock ¶
ToggleFavoriteBlock toggles asset block as fav/not fav
func (*Service) UpdateOraclePingTime ¶
UpdateOraclePingTime updates last ping from oracle
func (*Service) ValidateAsset ¶
ValidateAsset checks whether a user is a miner of a token or not
Source Files ¶
- create-asset-block.go
- create.go
- deposit-balance.go
- did-user-like-block.go
- find-all.go
- find-by-id.go
- find-by-name.go
- find-by-symbol.go
- find-user-balance.go
- find-user-favorite-assets.go
- get-asset-block-images.go
- get-asset-blocks.go
- get-asset-miners.go
- is-miner.go
- is-oracle.go
- sensor-verify-block.go
- service.go
- toggle-favorite-block.go
- toggle-favorite.go
- update-oracle-ping-time.go
- validate-asset.go
- verify-asset-block.go