Documentation
¶
Index ¶
- type AccessData
- type Authorization
- type AuthorizationService
- type DclClient
- type Decentraland
- type Estate
- type MapResponse
- type Parcel
- type Redis
- func (r Redis) AddCID(cid string) error
- func (r Redis) ClearScene(cid string) error
- func (r Redis) GetParcelCID(pid string) (string, error)
- func (r Redis) GetParcelContent(parcelID string) (map[string]string, error)
- func (r Redis) GetParcelMetadata(parcelID string) (map[string]interface{}, error)
- func (r Redis) GetRootCid(sceneCID string) (string, error)
- func (r Redis) GetSceneCid(rootCID string) (string, error)
- func (r Redis) GetSceneParcels(cid string) ([]string, error)
- func (r Redis) IsContentMember(value string) (bool, error)
- func (r Redis) ProcessedParcel(pid string) (bool, error)
- func (r Redis) SaveRootCidSceneCid(rootCID, sceneCID string) error
- func (r Redis) SetProcessedParcel(pid string) error
- func (r Redis) SetSceneParcels(scene string, parcels []string) error
- func (r Redis) StoreContent(key string, field string, value string) error
- func (r Redis) StoreMetadata(key string, fields map[string]interface{}) error
- type RedisClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessData ¶
type AccessData struct { Id string Address string IsApprovedForAll bool IsUpdateManager bool IsOwner bool IsOperator bool IsUpdateOperato bool IsUpdateAuthorized bool }
func (*AccessData) HasAccess ¶
func (ad *AccessData) HasAccess() bool
type Authorization ¶
type AuthorizationService ¶
type AuthorizationService struct {
// contains filtered or unexported fields
}
func NewAuthorizationService ¶
func NewAuthorizationService(client Decentraland) *AuthorizationService
func (AuthorizationService) IsSignatureValid ¶
func (service AuthorizationService) IsSignatureValid(msg, hexSignature, hexAddress string) bool
func (AuthorizationService) UserCanModifyParcels ¶
func (service AuthorizationService) UserCanModifyParcels(pubkey string, parcelsList []string) (bool, error)
type DclClient ¶
func (DclClient) GetParcelAccessData ¶
Retrieves the access data of a address over a given accessData
type Decentraland ¶
type Decentraland interface {
GetParcelAccessData(address string, x int64, y int64) (*AccessData, error)
}
type MapResponse ¶
type Redis ¶
func NewRedisClient ¶
func (Redis) ClearScene ¶
func (Redis) GetParcelContent ¶
func (Redis) GetParcelMetadata ¶
func (Redis) SaveRootCidSceneCid ¶
func (Redis) SetProcessedParcel ¶
func (Redis) SetSceneParcels ¶
This function maps scene cid to list of parcels "Qvcslk2duadjao0rsdfaZaAAA"... -> ["35,-145", "-22,14"] Every every parcel or pair of coordinates must be unique for between all scenes, so we need to check for every parcel if it got a scene before and delete it if needed Parcels will map its own cid, "99,108" -> Qvcslk2duadjao0rsdfaZaAAA... We can be tempted to remove the old parcel -> old cid map, but that would break the /mappings map, so for now we are going to keep that map and check the validity of the cid when requesting /scenes, thing that will be updatable once removed the /mappings endpoint
func (Redis) StoreContent ¶
type RedisClient ¶
type RedisClient interface { GetParcelMetadata(parcelID string) (map[string]interface{}, error) GetParcelContent(parcelID string) (map[string]string, error) StoreContent(key string, field string, value string) error StoreMetadata(key string, fields map[string]interface{}) error AddCID(cid string) error IsContentMember(value string) (bool, error) // Retrieves the root cid of the given parcel GetParcelCID(pid string) (string, error) // Deletes the mapping root cid -> [parcels] ClearScene(cid string) error // Updates the mapping root cid -> [parcels] SetSceneParcels(cid string, pid []string) error // Gets the mapping root cid -> [parcels] GetSceneParcels(cid string) ([]string, error) // Flags parcels as processed, this is used for flagging when the root cid -> parcels maps has been created SetProcessedParcel(pid string) error // Retrieves whether a parcels has been processed ProcessedParcel(pid string) (bool, error) // Saves the map root cid <--> scene cid SaveRootCidSceneCid(rootCID, sceneCID string) error // Retrieves the scene cid given the root cid of a scene GetSceneCid(rootCID string) (string, error) // Retrieves the root cid given the scene cid of a scene GetRootCid(sceneCID string) (string, error) }