ipfs

package
v1.0.0-beta.16 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package ipfs provides methods and message types of the ipfs v1alpha1 API.

Index

Constants

View Source
const (
	ListPinsRequestOrderByCreatedAtAsc  = ListPinsRequestOrderBy("created_at_asc")
	ListPinsRequestOrderByCreatedAtDesc = ListPinsRequestOrderBy("created_at_desc")
)
View Source
const (
	ListVolumesRequestOrderByCreatedAtAsc  = ListVolumesRequestOrderBy("created_at_asc")
	ListVolumesRequestOrderByCreatedAtDesc = ListVolumesRequestOrderBy("created_at_desc")
)
View Source
const (
	PinStatusUnknownStatus = PinStatus("unknown_status")
	PinStatusQueued        = PinStatus("queued")
	PinStatusPinning       = PinStatus("pinning")
	PinStatusFailed        = PinStatus("failed")
	PinStatusPinned        = PinStatus("pinned")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API: pinning service ipfs API for Scaleway. Ipfs pinning service v1alpha1.

func NewAPI

func NewAPI(client *scw.Client) *API

NewAPI returns a API object from a Scaleway client.

func (*API) CreatePinByCID

func (s *API) CreatePinByCID(req *CreatePinByCIDRequest, opts ...scw.RequestOption) (*Pin, error)

CreatePinByCID: add content in s3 bucket.

func (*API) CreatePinByRaw

func (s *API) CreatePinByRaw(req *CreatePinByRawRequest, opts ...scw.RequestOption) (*Pin, error)

CreatePinByRaw: add content in s3 bucket.

func (*API) CreatePinByURL

func (s *API) CreatePinByURL(req *CreatePinByURLRequest, opts ...scw.RequestOption) (*Pin, error)

CreatePinByURL: add content in s3 bucket.

func (*API) CreateVolume

func (s *API) CreateVolume(req *CreateVolumeRequest, opts ...scw.RequestOption) (*Volume, error)

CreateVolume: create volume in S3 bucket.

func (*API) DeletePin

func (s *API) DeletePin(req *DeletePinRequest, opts ...scw.RequestOption) error

DeletePin: remove by pin id.

func (*API) DeleteVolume

func (s *API) DeleteVolume(req *DeleteVolumeRequest, opts ...scw.RequestOption) error

DeleteVolume: delete volume in S3 bucket.

func (*API) GetPin

func (s *API) GetPin(req *GetPinRequest, opts ...scw.RequestOption) (*Pin, error)

GetPin: get pin id create when content is add in s3 bucket.

func (*API) GetVolume

func (s *API) GetVolume(req *GetVolumeRequest, opts ...scw.RequestOption) (*Volume, error)

GetVolume: get information about volume.

func (*API) ListPins

func (s *API) ListPins(req *ListPinsRequest, opts ...scw.RequestOption) (*ListPinsResponse, error)

func (*API) ListVolumes

func (s *API) ListVolumes(req *ListVolumesRequest, opts ...scw.RequestOption) (*ListVolumesResponse, error)

ListVolumes: list volumes in project-id.

func (*API) Regions

func (s *API) Regions() []scw.Region

Regions list localities the api is available in

func (*API) ReplacePin

func (s *API) ReplacePin(req *ReplacePinRequest, opts ...scw.RequestOption) (*ReplacePinResponse, error)

func (*API) UpdateVolume

func (s *API) UpdateVolume(req *UpdateVolumeRequest, opts ...scw.RequestOption) (*Volume, error)

UpdateVolume: update volume name or tag.

type CreatePinByCIDRequest

type CreatePinByCIDRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	VolumeID string `json:"volume_id"`

	Cid string `json:"cid"`

	Name *string `json:"name"`

	Origins []string `json:"origins"`

	Meta *PinCIDMeta `json:"meta"`

	PinOptions *PinOptions `json:"pin_options"`
}

type CreatePinByRawRequest

type CreatePinByRawRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	VolumeID string `json:"volume_id"`

	Content []byte `json:"content"`

	MimeType *string `json:"mime_type"`

	Name *string `json:"name"`

	PinOptions *PinOptions `json:"pin_options"`
}

type CreatePinByURLRequest

type CreatePinByURLRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	VolumeID string `json:"volume_id"`

	URL string `json:"url"`

	Name *string `json:"name"`

	PinOptions *PinOptions `json:"pin_options"`
}

type CreateVolumeRequest

type CreateVolumeRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	ProjectID string `json:"project_id"`

	Name string `json:"name"`
}

type DeletePinRequest

type DeletePinRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	PinID string `json:"-"`

	VolumeID string `json:"-"`
}

type DeleteVolumeRequest

type DeleteVolumeRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	VolumeID string `json:"-"`
}

type GetPinRequest

type GetPinRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	PinID string `json:"-"`

	VolumeID string `json:"-"`
}

type GetVolumeRequest

type GetVolumeRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	VolumeID string `json:"-"`
}

type ListPinsRequest

type ListPinsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	VolumeID string `json:"-"`

	ProjectID *string `json:"-"`

	OrganizationID *string `json:"-"`

	Page *int32 `json:"-"`

	PageSize *uint32 `json:"-"`
	// OrderBy: default value: created_at_asc
	OrderBy ListPinsRequestOrderBy `json:"-"`
	// Status: default value: unknown_status
	Status PinStatus `json:"-"`
}

type ListPinsRequestOrderBy

type ListPinsRequestOrderBy string

func (ListPinsRequestOrderBy) MarshalJSON

func (enum ListPinsRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListPinsRequestOrderBy) String

func (enum ListPinsRequestOrderBy) String() string

func (*ListPinsRequestOrderBy) UnmarshalJSON

func (enum *ListPinsRequestOrderBy) UnmarshalJSON(data []byte) error

type ListPinsResponse

type ListPinsResponse struct {
	TotalCount uint64 `json:"total_count"`

	Pins []*Pin `json:"pins"`
}

func (*ListPinsResponse) UnsafeAppend

func (r *ListPinsResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListPinsResponse) UnsafeGetTotalCount

func (r *ListPinsResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type ListVolumesRequest

type ListVolumesRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	ProjectID string `json:"-"`

	Page *int32 `json:"-"`

	PageSize *uint32 `json:"-"`
	// OrderBy: default value: created_at_asc
	OrderBy ListVolumesRequestOrderBy `json:"-"`
}

type ListVolumesRequestOrderBy

type ListVolumesRequestOrderBy string

func (ListVolumesRequestOrderBy) MarshalJSON

func (enum ListVolumesRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListVolumesRequestOrderBy) String

func (enum ListVolumesRequestOrderBy) String() string

func (*ListVolumesRequestOrderBy) UnmarshalJSON

func (enum *ListVolumesRequestOrderBy) UnmarshalJSON(data []byte) error

type ListVolumesResponse

type ListVolumesResponse struct {
	Volumes []*Volume `json:"volumes"`

	TotalCount uint64 `json:"total_count"`
}

func (*ListVolumesResponse) UnsafeAppend

func (r *ListVolumesResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListVolumesResponse) UnsafeGetTotalCount

func (r *ListVolumesResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type Pin

type Pin struct {
	PinID string `json:"pin_id"`
	// Status: default value: unknown_status
	Status PinStatus `json:"status"`

	CreatedAt *time.Time `json:"created_at"`

	Cid *PinCID `json:"cid"`

	Delegates []string `json:"delegates"`

	Info *PinInfo `json:"info"`
}

type PinCID

type PinCID struct {
	Cid string `json:"cid"`

	Name *string `json:"name"`

	Origins []string `json:"origins"`

	Meta *PinCIDMeta `json:"meta"`
}

type PinCIDMeta

type PinCIDMeta struct {
	AppID string `json:"app_id"`
}

type PinInfo

type PinInfo struct {
	StatusDetails *string `json:"status_details"`
}

type PinOptions

type PinOptions struct {
	RequiredZones []string `json:"required_zones"`

	ReplicationCount uint32 `json:"replication_count"`
}

type PinStatus

type PinStatus string

func (PinStatus) MarshalJSON

func (enum PinStatus) MarshalJSON() ([]byte, error)

func (PinStatus) String

func (enum PinStatus) String() string

func (*PinStatus) UnmarshalJSON

func (enum *PinStatus) UnmarshalJSON(data []byte) error

type ReplacePinRequest

type ReplacePinRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	PinID string `json:"-"`

	VolumeID string `json:"volume_id"`

	Cid string `json:"cid"`

	Name *string `json:"name"`

	Origins []string `json:"origins"`

	Meta *PinCIDMeta `json:"meta"`

	PinOptions *PinOptions `json:"pin_options"`
}

type ReplacePinResponse

type ReplacePinResponse struct {
	Pin *Pin `json:"pin"`
}

type UpdateVolumeRequest

type UpdateVolumeRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	VolumeID string `json:"-"`

	Name *string `json:"name"`

	Tags *[]string `json:"tags"`
}

type Volume

type Volume struct {
	ID string `json:"id"`

	ProjectID string `json:"project_id"`

	Region scw.Region `json:"region"`

	CountPin uint64 `json:"count_pin"`

	CreatedAt *time.Time `json:"created_at"`

	UpdatedAt *time.Time `json:"updated_at"`

	Tags []string `json:"tags"`

	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

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