handlers

package
v0.0.0-...-5de6587 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2021 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentElement

type ContentElement struct {
	File string `json:"file"`
	Cid  string `json:"hash"`
}

type ContentHandler

type ContentHandler interface {
	GetContents(c *gin.Context)
	CheckContentStatus(c *gin.Context)
}

func NewContentHandler

func NewContentHandler(storage storage.Storage, client data.RedisClient, l *log.Logger) ContentHandler

type ContentTypeFilter

type ContentTypeFilter struct {
	// contains filtered or unexported fields
}

func NewContentTypeFilter

func NewContentTypeFilter(types []string) *ContentTypeFilter

Retrieves a new content filter. If the lis is empty all content types will be allowed

func (*ContentTypeFilter) IsAllowed

func (f *ContentTypeFilter) IsAllowed(t string) bool

type FileMetadata

type FileMetadata struct {
	Cid  string `json:"cid" validate:"required"`
	Name string `json:"name" validate:"required"`
}

type InvalidArgument

type InvalidArgument struct {
	Message string
}

func (InvalidArgument) Error

func (e InvalidArgument) Error() string

type MappingsHandler

type MappingsHandler interface {
	GetMappings(c *gin.Context)
	GetScenes(c *gin.Context)
	GetParcelInformation(parcelId string) (*ParcelContent, error)
	GetInfo(c *gin.Context)
}

func NewMappingsHandler

func NewMappingsHandler(client data.RedisClient, dcl data.Decentraland, storage storage.Storage, l *log.Logger) MappingsHandler

type Metadata

type Metadata struct {
	Value        string `json:"value" structs:"value " validate:"required"`
	Signature    string `json:"signature" structs:"signature" validate:"required,prefix=0x"`
	Validity     string `json:"validity" structs:"validity" validate:"required"`
	ValidityType int    `json:"validityType" structs:"validityType" validate:"gte=0"`
	Sequence     int    `json:"sequence" structs:"sequence" validate:"gte=0"`
	PubKey       string `json:"pubkey" structs:"pubkey" validate:"required,eth_addr"`
	RootCid      string `json:"root_cid" structs:"root_cid" validate:"required"`
	Timestamp    int64  `json:"timestamp" structs:"timestamp" validate:"gte=0"`
}

type MetadataHandler

type MetadataHandler interface {
	GetParcelMetadata(c *gin.Context)
}

func NewMetadataHandler

func NewMetadataHandler(client data.RedisClient, l *log.Logger) MetadataHandler

type ParcelContent

type ParcelContent struct {
	ParcelID  string            `json:"parcel_id"`
	Contents  []*ContentElement `json:"contents"`
	RootCID   string            `json:"root_cid"`
	Publisher string            `json:"publisher"`
}

type RequiredValueError

type RequiredValueError struct {
	Message string
}

func (RequiredValueError) Error

func (e RequiredValueError) Error() string

type Scene

type Scene struct {
	ParcelId string `json:"parcel_id"`
	RootCID  string `json:"root_cid"`
	SceneCID string `json:"scene_cid"`
}

type SceneContent

type SceneContent struct {
	RootCID  string         `json:"root_cid"`
	SceneCID string         `json:"scene_cid"`
	Content  *ParcelContent `json:"content"`
}

type StringPair

type StringPair struct {
	A string
	B string
}

type UnauthorizedError

type UnauthorizedError struct {
	Message string
}

func (UnauthorizedError) Error

func (e UnauthorizedError) Error() string

type UnexpectedError

type UnexpectedError struct {
	Message string
	// contains filtered or unexported fields
}

type UploadHandler

type UploadHandler interface {
	UploadContent(c *gin.Context)
}

type UploadRequest

type UploadRequest struct {
	Metadata      Metadata                           `validate:"required"`
	Manifest      *[]FileMetadata                    `validate:"required"`
	UploadedFiles map[string][]*multipart.FileHeader `validate:"required"`
	Scene         *scene                             `validate:"required"`
	Origin        string
}

type UploadService

type UploadService interface {
	ProcessUpload(r *UploadRequest) error
}

type UploadServiceImpl

type UploadServiceImpl struct {
	Storage         storage.Storage
	RedisClient     data.RedisClient
	IpfsNode        *core.IpfsNode
	Auth            data.Authorization
	Agent           *metrics.Agent
	ParcelSizeLimit int64
	Workdir         string

	Log *log.Logger
	// contains filtered or unexported fields
}

func NewUploadService

func NewUploadService(storage storage.Storage, client data.RedisClient, node *core.IpfsNode, auth data.Authorization,
	agent *metrics.Agent, parcelSizeLimit int64, workdir string,
	rpc *rpc.RPC, l *log.Logger) *UploadServiceImpl

func (*UploadServiceImpl) ProcessUpload

func (us *UploadServiceImpl) ProcessUpload(r *UploadRequest) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL