api

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: BSD-3-Clause Imports: 61 Imported by: 0

Documentation

Overview

Package api provides the functionality of the aurora client-facing HTTP API.

Copyright 2021 The Swarm Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

View Source
const (
	AuroraPinHeader            = "Aurora-Pin"
	AuroraTagHeader            = "Aurora-Tag"
	AuroraEncryptHeader        = "Aurora-Encrypt"
	AuroraIndexDocumentHeader  = "Aurora-Index-Document"
	AuroraErrorDocumentHeader  = "Aurora-Error-Document"
	AuroraFeedIndexHeader      = "Aurora-Feed-Index"
	AuroraFeedIndexNextHeader  = "Aurora-Feed-Index-Next"
	AuroraCollectionHeader     = "Aurora-Collection"
	AuroraCollectionNameHeader = "Aurora-Collection-Name"
)
View Source
const (
	StringTrue = "true"
)
View Source
const (
	// TargetsRecoveryHeader defines the Header for Recovery targets in Global Pinning
	TargetsRecoveryHeader = "aurora-recovery-targets"
)

Variables

View Source
var (
	ErrNotFound    = errors.New("manifest: not found")
	ErrServerError = errors.New("manifest: ServerError")
)
View Source
var BufferSizeMul int

Functions

func UnescapeUnicode added in v1.1.0

func UnescapeUnicode(raw string) (string, error)

UnescapeUnicode convert the raw Unicode encoding to character

Types

type AllRequest added in v1.2.1

type AllRequest struct {
	Id      int           `json:"id"`
	JsonRpc string        `json:"jsonrpc"`
	Method  string        `json:"method"`
	Params  []interface{} `json:"params"`
}

type AllResponse added in v1.2.1

type AllResponse struct {
	Id      int         `json:"id"`
	JsonRpc string      `json:"jsonrpc"`
	Result  interface{} `json:"result"`
}

type FileInfo added in v1.1.0

type FileInfo struct {
	Path        string
	Name        string
	ContentType string
	Size        int64
	Reader      io.Reader
}

type Options

type Options struct {
	CORSAllowedOrigins []string
	GatewayMode        bool
	WsPingPeriod       time.Duration
	BufferSizeMul      int
	Restricted         bool
	DebugApiAddr       string
	RPCWSAddr          string
}

type Service

type Service interface {
	http.Handler
	m.Collector
	io.Closer
}

Service is the API service interface.

func New

func New(storer storage.Storer, resolver resolver.Interface, addr boson.Address, chunkInfo chunkinfo.Interface,
	traversalService traversal.Traverser, pinning pinning.Interface, auth authenticator, logger logging.Logger,
	tracer *tracing.Tracer, traffic traffic.ApiInterface, commonChain chain.Common, oracleChain chain.Resolver, netRelay netrelay.NetRelay,
	multicast multicast.GroupInterface, o Options) Service

New will create a and initialize a new API service.

type TransactionResponse added in v1.2.2

type TransactionResponse struct {
	Hash     common.Hash
	Address  boson.Address
	Register bool
}

type UpgradedResponseWriter added in v1.1.0

type UpgradedResponseWriter interface {
	http.ResponseWriter
	http.Pusher
	http.Hijacker
	http.Flusher
	// staticcheck SA1019 CloseNotifier interface is required by gorilla compress handler
	// nolint:staticcheck
	http.CloseNotifier // skipcq: SCC-SA1019
}

UpgradedResponseWriter adds more functionality on top of ResponseWriter

Jump to

Keyboard shortcuts

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