Documentation ¶
Overview ¶
Try to remove EmitEvent() and SubcribeEvent()
Index ¶
- Constants
- func FromInterfaceString2String(bstr interface{}) string
- func ToBigInt(str string) *big.Int
- func ToNullString(s Stringer) (ns sql.NullString)
- type AuthenticationService
- type CollectionService
- type EventService
- type MarketplaceService
- type NftNewService
- type NotificationService
- type OrderService
- type ProfileService
- type RoleService
- type SearchService
- type Servicer
- type Services
- func (s *Services) Close() error
- func (s *Services) CreateCollection(ctx context.Context, collection entities.Collection) (ec entities.Collection, err error)
- func (s *Services) CreateEvent(ctx context.Context, event entities.Event) (ee entities.Event, err error)
- func (s *Services) CreateEventsByFulfilledOrder(ctx context.Context, order entities.Order, txHash string) (ees []entities.Event, err error)
- func (s *Services) CreateEventsByOrder(ctx context.Context, order entities.Order) (ees []entities.Event, err error)
- func (s *Services) CreateNotification(ctx context.Context, notification entities.NotificationPost) error
- func (s *Services) CreateOrder(ctx context.Context, order entities.Order) (err error)
- func (s *Services) DeleteProfile(ctx context.Context, address common.Address) error
- func (s *Services) DeleteUserRole(ctx context.Context, address string, roleId int32) error
- func (s *Services) EmitTask(ctx context.Context, event models.EnumTask, value []byte) error
- func (s *Services) FulFillOrder(ctx context.Context, order entities.Order) error
- func (s *Services) GenerateJWTToken(user *entities.User) (string, time.Time, error)
- func (s *Services) GetCollectionLastSyncBlock(ctx context.Context, token common.Address) (uint64, error)
- func (s *Services) GetExpiredOrder(ctx context.Context) (expiredOrderList []entities.ExpiredOrder, err error)
- func (s *Services) GetListCollection(ctx context.Context, query entities.Collection, offset int, limit int) (ecs []entities.Collection, err error)
- func (s *Services) GetListCollectionWithCategory(ctx context.Context, categogy string, offset int, limit int) (ecs []entities.Collection, err error)
- func (s *Services) GetListEvent(ctx context.Context, query entities.EventRead) (events []entities.Event, err error)
- func (s *Services) GetListNotification(ctx context.Context, address common.Address, isViewed *bool) (ns []entities.NotificationGet, err error)
- func (s *Services) GetMarketplaceLastSyncBlock(ctx context.Context) (uint64, error)
- func (s *Services) GetMarketplaceSettings(ctx context.Context, marketplaceAddress common.Address) (*entities.MarketplaceSettings, error)
- func (s *Services) GetNft(ctx context.Context, token common.Address, identifier *big.Int) (*entities.Nft, error)
- func (s *Services) GetOffer(ctx context.Context, owner common.Address, from common.Address) (offers []entities.Event, err error)
- func (s *Services) GetOrder(ctx context.Context, offer entities.OfferItem, ...) ([]entities.Order, error)
- func (s *Services) GetProfile(ctx context.Context, address string) (entities.Profile, error)
- func (s *Services) GetRoles(ctx context.Context) ([]*entities.Role, error)
- func (s *Services) GetUserByAddress(ctx context.Context, address string) (*entities.User, error)
- func (s *Services) GetUserNonce(ctx context.Context, address string) (string, error)
- func (s *Services) GetUsers(ctx context.Context, isBlock *bool, role string, offset int32, limit int32) ([]*entities.User, error)
- func (s *Services) HandleCounterIncremented(ctx context.Context, offerer common.Address) error
- func (s *Services) HandleOrderCancelled(ctx context.Context, orderHash common.Hash) error
- func (s *Services) InsertUser(ctx context.Context, user *entities.User) (*entities.User, error)
- func (s *Services) InsertUserRole(ctx context.Context, address string, roleId int32) (*entities.Role, error)
- func (s *Services) ListNftsWithListings(ctx context.Context, token common.Address, identifier *big.Int, ...) ([]*entities.NftRead, error)
- func (s *Services) Login(ctx context.Context, address string, messageStr string, sigHex string) (string, time.Time, error)
- func (s *Services) MintedNft(ctx context.Context, token common.Address, identifier *big.Int, ...) error
- func (s *Services) RemoveInvalidOrder(ctx context.Context, offerer common.Address, token common.Address, ...) error
- func (s *Services) SearchNFTsWithListings(ctx context.Context, token common.Address, owner common.Address, q string, ...) ([]*entities.NftRead, error)
- func (s *Services) SubcribeTask(ctx context.Context, event models.EnumTask, handler asynq.HandlerFunc) error
- func (s *Services) TransferAdminRole(ctx context.Context, maker string, taker string) (*entities.Role, error)
- func (s *Services) TransferNft(ctx context.Context, transfer models.NftTransfer, blockNumber uint64, ...) error
- func (s *Services) UpdateCollectionLastSyncBlock(ctx context.Context, token common.Address, block uint64) error
- func (s *Services) UpdateMarketplaceLastSyncBlock(ctx context.Context, block uint64) error
- func (s *Services) UpdateMarketplaceSettings(ctx context.Context, marketplace common.Address, beneficiary common.Address, ...) (*entities.MarketplaceSettings, error)
- func (s *Services) UpdateNftMetadata(ctx context.Context, token common.Address, identifier *big.Int, ...) (err error)
- func (s *Services) UpdateNftStatus(ctx context.Context, token common.Address, identifier *big.Int, isHidden bool) error
- func (s *Services) UpdateNotification(ctx context.Context, notification entities.NotificationUpdate) error
- func (s *Services) UpdateUserBlockState(ctx context.Context, address string, isBlock bool) error
- func (s *Services) UpsertProfile(ctx context.Context, profile entities.Profile) (entities.Profile, error)
- type Stringer
- type UserService
Constants ¶
View Source
const ( ADMIN_ROLE_ID = 1 MODERATOR_ROLE_ID = 2 USER_ROLE_ID = 3 )
View Source
const ListingLimit = 10
Variables ¶
This section is empty.
Functions ¶
func FromInterfaceString2String ¶
func FromInterfaceString2String(bstr interface{}) string
func ToNullString ¶
func ToNullString(s Stringer) (ns sql.NullString)
Types ¶
type AuthenticationService ¶
type CollectionService ¶
type CollectionService interface { CreateCollection(ctx context.Context, collection entities.Collection) (entities.Collection, error) GetListCollection(ctx context.Context, query entities.Collection, offset int, limit int) ([]entities.Collection, error) GetListCollectionWithCategory(ctx context.Context, categogy string, offset int, limit int) ([]entities.Collection, error) UpdateCollectionLastSyncBlock(ctx context.Context, token common.Address, block uint64) error GetCollectionLastSyncBlock(ctx context.Context, token common.Address) (uint64, error) }
type EventService ¶
type EventService interface { CreateEvent(ctx context.Context, event entities.Event) (entities.Event, error) CreateEventsByOrder(ctx context.Context, order entities.Order) ([]entities.Event, error) CreateEventsByFulfilledOrder(ctx context.Context, order entities.Order, txHash string) ([]entities.Event, error) GetListEvent(ctx context.Context, query entities.EventRead) ([]entities.Event, error) }
type MarketplaceService ¶
type MarketplaceService interface { UpdateMarketplaceLastSyncBlock(ctx context.Context, block uint64) error GetMarketplaceLastSyncBlock(ctx context.Context) (uint64, error) GetMarketplaceSettings(ctx context.Context, marketplaceAddress common.Address) (*entities.MarketplaceSettings, error) UpdateMarketplaceSettings(ctx context.Context, marketplace common.Address, beneficiary common.Address, royalty float64) (*entities.MarketplaceSettings, error) }
type NftNewService ¶
type NftNewService interface { UpdateNftStatus(ctx context.Context, token common.Address, identifier *big.Int, isHidden bool) error ListNftsWithListings( ctx context.Context, token common.Address, identifier *big.Int, owner common.Address, isHidden *bool, offset int32, limit int32, ) ([]*entities.NftRead, error) GetNft( ctx context.Context, token common.Address, identifier *big.Int, ) (*entities.Nft, error) }
type NotificationService ¶
type NotificationService interface { CreateNotification(ctx context.Context, notification entities.NotificationPost) error GetListNotification(ctx context.Context, address common.Address, isViewed *bool) ([]entities.NotificationGet, error) UpdateNotification(ctx context.Context, notification entities.NotificationUpdate) error }
type OrderService ¶
type OrderService interface { CreateOrder(ctx context.Context, order entities.Order) error FulFillOrder(ctx context.Context, order entities.Order) error GetOrder( ctx context.Context, offer entities.OfferItem, consideration entities.ConsiderationItem, orderHash common.Hash, offerer common.Address, IsFulfilled *bool, IsCancelled *bool, IsInvalid *bool, ) ([]entities.Order, error) RemoveInvalidOrder(ctx context.Context, offerer common.Address, token common.Address, identifier *big.Int) error HandleOrderCancelled(ctx context.Context, orderHash common.Hash) error HandleCounterIncremented(ctx context.Context, offerer common.Address) error GetExpiredOrder(ctx context.Context) ([]entities.ExpiredOrder, error) }
type ProfileService ¶
type ProfileService interface { GetProfile(ctx context.Context, address string) (entities.Profile, error) UpsertProfile(ctx context.Context, profile entities.Profile) (entities.Profile, error) DeleteProfile(ctx context.Context, address common.Address) error GetOffer(ctx context.Context, owner common.Address, from common.Address) ([]entities.Event, error) }
type RoleService ¶
type SearchService ¶
type Servicer ¶
type Servicer interface { OrderService NftNewService ProfileService CollectionService MarketplaceService EventService SearchService NotificationService AuthenticationService UserService RoleService EmitTask(ctx context.Context, event models.EnumTask, value []byte) error SubcribeTask(ctx context.Context, event models.EnumTask, handler asynq.HandlerFunc) error MintedNft( ctx context.Context, token common.Address, identifier *big.Int, to common.Address, token_uri string, blockNumber uint64, txIndex uint, ) error TransferNft(ctx context.Context, transfer models.NftTransfer, blockNumber uint64, txIndex uint) error UpdateNftMetadata(ctx context.Context, token common.Address, identifier *big.Int, metadata map[string]any) (err error) Close() error }
type Services ¶
type Services struct {
// contains filtered or unexported fields
}
func New ¶
func New( redisUrl string, redisPass string, nftReader infrastructure.NftReader, nftWriter infrastructure.NftWriter, orderReader infrastructure.OrderReader, orderWriter infrastructure.OrderWritter, collectionReader infrastructure.CollectionReader, collectionWriter infrastructure.CollectionWriter, eventReader infrastructure.EventReader, eventWriter infrastructure.EventWriter, notificationReader infrastructure.NotificationReader, notificationWriter infrastructure.NotificationWriter, marketplaceReader infrastructure.MarketplaceReader, marketplaceWriter infrastructure.MarketplaceWriter, searcher infrastructure.Searcher, profileReader infrastructure.ProfileReader, profileWriter infrastructure.ProfileWriter, userReader infrastructure.UserReader, userWriter infrastructure.UserWriter, ) *Services
func (*Services) CreateCollection ¶
func (s *Services) CreateCollection(ctx context.Context, collection entities.Collection) (ec entities.Collection, err error)
func (*Services) CreateEvent ¶
func (s *Services) CreateEvent(ctx context.Context, event entities.Event) (ee entities.Event, err error)
Add event to database
func (*Services) CreateEventsByFulfilledOrder ¶
func (s *Services) CreateEventsByFulfilledOrder(ctx context.Context, order entities.Order, txHash string) (ees []entities.Event, err error)
Add event sale to database
func (*Services) CreateEventsByOrder ¶
func (s *Services) CreateEventsByOrder(ctx context.Context, order entities.Order) (ees []entities.Event, err error)
Add event listing or offer to database
func (*Services) CreateNotification ¶
func (*Services) CreateOrder ¶
func (*Services) DeleteProfile ¶
func (*Services) DeleteUserRole ¶
func (*Services) FulFillOrder ¶
func (*Services) GenerateJWTToken ¶
func (*Services) GetCollectionLastSyncBlock ¶
func (*Services) GetExpiredOrder ¶
func (*Services) GetListCollection ¶
func (s *Services) GetListCollection(ctx context.Context, query entities.Collection, offset int, limit int) (ecs []entities.Collection, err error)
func (*Services) GetListCollectionWithCategory ¶
func (*Services) GetListEvent ¶
func (*Services) GetListNotification ¶
func (*Services) GetMarketplaceLastSyncBlock ¶
func (*Services) GetMarketplaceSettings ¶
func (*Services) GetProfile ¶
func (*Services) GetUserByAddress ¶
func (*Services) GetUserNonce ¶
func (*Services) HandleCounterIncremented ¶
func (*Services) HandleOrderCancelled ¶
func (*Services) InsertUser ¶
func (*Services) InsertUserRole ¶
func (*Services) ListNftsWithListings ¶
func (*Services) RemoveInvalidOrder ¶
func (*Services) SearchNFTsWithListings ¶
func (*Services) SubcribeTask ¶
func (*Services) TransferAdminRole ¶
func (*Services) TransferNft ¶
func (*Services) UpdateCollectionLastSyncBlock ¶
func (*Services) UpdateMarketplaceLastSyncBlock ¶
func (*Services) UpdateMarketplaceSettings ¶
func (*Services) UpdateNftMetadata ¶
func (*Services) UpdateNftStatus ¶
func (*Services) UpdateNotification ¶
func (*Services) UpdateUserBlockState ¶
type UserService ¶
type UserService interface { GetUserByAddress(ctx context.Context, address string) (*entities.User, error) GetUsers(ctx context.Context, isBlock *bool, role string, offset int32, limit int32) ([]*entities.User, error) UpdateUserBlockState(ctx context.Context, address string, isBlock bool) error InsertUserRole(ctx context.Context, address string, roleId int32) (*entities.Role, error) DeleteUserRole(ctx context.Context, address string, roleID int32) error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.