backends

package
v0.0.0-...-94e1d31 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package backends provides utilities for communicating with backend Jupyter API servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

Backend is a wrapper around a Jupyter API server.

func New

func New(backendName string, resourceNameSuffix string, host string, proxy http.Handler) *Backend

New returns a new instance of Backend.

func ParseUnifiedID

func ParseUnifiedID(id string, backends []*Backend) (b *Backend, localID string, err error)

ParseUnifiedID takes a resource ID that is globally unique and returns one that is specific to either the remote or local backend.

func (*Backend) Create

func (b *Backend) Create(path string, body []byte) ([]byte, error)

Create inserts a new resource at the given URL path with the given contents.

func (*Backend) Delete

func (b *Backend) Delete(path string) error

Delete deletes the resource at the given URL path.

func (*Backend) Get

func (b *Backend) Get(path string) ([]byte, error)

Get returns the contents (as a slice of bytes) of the resource at the given URL path.

func (*Backend) Name

func (b *Backend) Name() string

Name returns the name of the backend.

func (*Backend) Patch

func (b *Backend) Patch(path string, body []byte) ([]byte, error)

Patch updates a new resource at the given URL path with the given contents.

func (*Backend) ServeHTTP

func (b *Backend) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface.

func (*Backend) UnifiedID

func (b *Backend) UnifiedID(localID string) string

UnifiedID takes a resource ID that is specific to the backend and returns an ID that is globally unique.

func (*Backend) UnifiedName

func (b *Backend) UnifiedName(localName string) string

UnifiedName takes the name for a resource in either the remote or local backend and returns a name that is appropriate for the combination of both backends.

Jump to

Keyboard shortcuts

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