model

package
v0.0.0-...-cd9cbe6 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKey

type ApiKey struct {
	ApiKey    string `json:"api_key"`
	ApiSecret string `json:"api_secret"`
	Jwt       string `json:"jwt"`
}

type Endpoints

type Endpoints struct {
	Pins    ScopePins    `json:"pins"`
	Data    ScopeData    `json:"data"`
	Pinning ScopePinning `json:"pinning"`
}

type Failure

type Failure struct {
	Error FailureError `json:"error"`
}

Failure - Response for a failed request

type FailureError

type FailureError struct {

	// Mandatory string identifying the type of error
	Reason string `json:"reason"`

	// Optional, longer description of the error; may include UUID of transaction for support, links to documentation etc
	Details string `json:"details,omitempty"`
}

type KeyInfo

type KeyInfo struct {
	KeyName string `json:"key_name" example:"mykey"`
	MaxUses uint64 `json:"max_uses,omitempty"`
	Scope   Scope  `json:"scope"`
}

type MetaData

type MetaData struct {
	// Optional name for pinned data; can be used for lookups later
	Name string `json:"name,omitempty" example:"PreciousData.pdf"`

	// Optional metadata for pin object
	Meta map[string]string `json:"meta,omitempty" example:"app_id:99986338-1113-4706-8302-4420da6158aa"`
}

type PaginationParams

type PaginationParams struct {
	Page     int `json:"page"`
	PageSize int `json:"page_size"`
}

type Pin

type Pin struct {

	// Content Identifier (CID) to be pinned recursively
	Cid string `json:"cid" example:"QmCIDToBePinned"`

	// Optional name for pinned data; can be used for lookups later
	Name string `json:"name,omitempty" maximum:"255" example:"PreciousData.pdf"`

	// Optional list of multiaddrs known to provide the data
	Origins []string `` /* 133-byte string literal not displayed */

	// Optional metadata for pin object
	Meta map[string]string `json:"meta,omitempty" example:"app_id:99986338-1113-4706-8302-4420da6158aa"`
}

Pin - Pin object

type PinFileResponse

type PinFileResponse struct {
	Cid       string `json:"cid"`
	RequestId string `json:"request_id"`
}

type PinResults

type PinResults struct {

	// The total number of pin objects that exist for passed query filters
	Count int32 `json:"count"`

	// An array of object results
	Results []*PinStatus `json:"results"`
}

type PinStatus

type PinStatus struct {

	// Globally unique identifier of the pin request; can be used to check the status of ongoing pinning, or pin removal
	Requestid string `json:"requestid" example:"UniqueIdOfPinRequest"`

	Status Status `json:"status" example:"queued"`

	// Immutable timestamp indicating when a pin request entered a pinning service; can be used for filtering results and pagination
	Created common.UTCTime `json:"created" example:"2020-07-27T17:32:28Z"`

	Pin Pin `json:"pin"`

	// List of multiaddrs designated by pinning service for transferring any new data from external peers
	Delegates []string `json:"delegates" example:"/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId"`

	// Optional info for PinStatus response
	Info map[string]string `json:"info,omitempty" example:"status_details:Queue position 7 of 9"`
}

PinStatus - Pin object with status

type PinnedTotal

type PinnedTotal struct {
	Count                     int64           `json:"count"`
	SizeTotal                 decimal.Decimal `json:"size_total"`
	SizeWithReplicationsTotal decimal.Decimal `json:"size_with_replications_total"`
}

type PolicyParam

type PolicyParam struct {
	NewPinPolicy map[string]int `json:"new_pin_policy"`
}

type Scope

type Scope struct {
	Admin     *bool      `json:"admin,omitempty"`
	Endpoints *Endpoints `json:"endpoints,omitempty"`
}

type ScopeData

type ScopeData struct {
	PinnedTotal bool `json:"pinnedTotal"`
	UploadFile  bool `json:"uploadFile"`
}

type ScopePinning

type ScopePinning struct {
	MetaData      bool `json:"metaData"`
	PinPolicy     bool `json:"pinPolicy"`
	UserPinPolicy bool `json:"userPinPolicy"`
}

type ScopePins

type ScopePins struct {
	AddPinObject     bool `json:"addPinObject"`
	GetPinObject     bool `json:"getPinObject"`
	ListPinObjects   bool `json:"listPinObjects"`
	RemovePinObject  bool `json:"removePinObject"`
	ReplacePinObject bool `json:"replacePinObject"`
}

type SearchPinParam

type SearchPinParam struct {
	Cid    []string             `json:"cid,omitempty"`
	Name   string               `json:"name,omitempty"`
	Match  TextMatchingStrategy `json:"match"`
	Status []Status             `json:"status"`
	Before *common.UTCTime      `json:"before,omitempty"`
	After  *common.UTCTime      `json:"after,omitempty"`
	Meta   map[string]string    `json:"meta,omitempty"`
	Limit  int                  `json:"limit"`
	Page   int                  `json:"page,omitempty"` // Paging if set it
}

type Status

type Status string

Status : Status a pin object can have at a pinning service

const (
	QUEUED  Status = "queued"
	PINNING Status = "pinning"
	PINNED  Status = "pinned"
	FAILED  Status = "failed"

	UNPINNED Status = "unpinned"
)

List of Status

type TextMatchingStrategy

type TextMatchingStrategy string

TextMatchingStrategy : Alternative text matching strategy

const (
	EXACT    TextMatchingStrategy = "exact"
	IEXACT   TextMatchingStrategy = "iexact"
	PARTIAL  TextMatchingStrategy = "partial"
	IPARTIAL TextMatchingStrategy = "ipartial"
)

List of TextMatchingStrategy

type UploadParam

type UploadParam struct {
	Name string `json:"name"`
	Size int64  `json:"size"`
	Mime string `json:"mime"`
}

type UploadResponse

type UploadResponse struct {
	Token string `json:"token"`
	Host  string `json:"host"`
}

Jump to

Keyboard shortcuts

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