api

package
v0.0.0-...-fa704fd Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: BSD-3-Clause Imports: 60 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	PenguinPinHeader            = "Penguin-Pin"
	PenguinTagHeader            = "Penguin-Tag"
	PenguinEncryptHeader        = "Penguin-Encrypt"
	PenguinIndexDocumentHeader  = "Penguin-Index-Document"
	PenguinErrorDocumentHeader  = "Penguin-Error-Document"
	PenguinFeedIndexHeader      = "Penguin-Feed-Index"
	PenguinFeedIndexNextHeader  = "Penguin-Feed-Index-Next"
	PenguinCollectionHeader     = "Penguin-Collection"
	PenguinPostageBatchIdHeader = "Penguin-Postage-Batch-Id"
)
View Source
const RPC_TIME_OUT = 20 * time.Second
View Source
const (
	// TargetsRecoveryHeader defines the Header for Recovery targets in Global Pinning
	TargetsRecoveryHeader = "penguin-recovery-targets"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

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
}

type Service

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

Service is the API service interface.

func New

func New(tags *tags.Tags, storer storage.Storer, resolver resolver.Interface, pss pss.Interface,
	traversalService traversal.Traverser, pinning pinning.Interface, feedFactory feeds.Factory,
	post postage.Service, postageContract postagecontract.Interface, steward steward.Reuploader,
	signer crypto.Signer, swapBackend *xwcclient.Client, logger logging.Logger, tracer *tracing.Tracer, o Options) Service

New will create and initialize a new API service.

type UpgradedResponseWriter

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 the top of ResponseWriter

Jump to

Keyboard shortcuts

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