benchling

package module
v0.0.0-...-ccb06fb Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package benchling provides support for crawling and indexing benchling.com.

Index

Constants

View Source
const (
	DocumentType = content.Type("benchling.com/document")
	EntryType    = content.Type("benchling.com/entry")
	ProjectType  = content.Type("benchling.com/project")
	FolderType   = content.Type("benchling.com/folder")
	UserType     = content.Type("benchling.com/user")
)

Variables

This section is empty.

Functions

func ContentType

func ContentType[ObjectT Objects](obj ObjectT) content.Type

func NewScanner

func NewScanner[ScannerT Scanners, ParamsT Params](ctx context.Context, serviceURL string, params ParamsT, opts ...operations.Option) *operations.Scanner[ScannerT]

func ObjectID

func ObjectID[ObjectT Objects](obj ObjectT) string

Types

type APIToken

type APIToken struct {
	Token string
}

APIToken is an implementation of operations.Authorizer for a benchling API token.

func (APIToken) WithAuthorization

func (pbt APIToken) WithAuthorization(_ context.Context, req *http.Request) error

type Backoff

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

Backoff implements a backoff strategy that first looks for the specific backoff period specified in the x-rate-limit-reset header in benchling.com's http response when a rate limit is reached. If no such header is found then exponential backoff is used.

func NewBackoff

func NewBackoff(initial time.Duration, steps int) *Backoff

func (*Backoff) Retries

func (bb *Backoff) Retries() int

func (*Backoff) Wait

func (bb *Backoff) Wait(ctx context.Context, resp *http.Response) (bool, error)

Wait implements Backoff.

type Document

type Document struct {
	Entry    benchlingsdk.Entry   // An actual data entry.
	Folder   benchlingsdk.Folder  // The folder containing the entry.
	Project  benchlingsdk.Project // The project containing the folder.
	DayNotes string
	Parents  []string                     // The parent folders of the folder containing the entry.
	Users    map[string]benchlingsdk.User // All users referenced in the entry, keyed by their userid.
}

Document represents the structure of information within benchling in terms of an a single indexable document.

type DocumentIndexer

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

func NewDocumentIndexer

func NewDocumentIndexer(fs operations.FS, downloads string, sharder path.Sharder, concurrency int) *DocumentIndexer

func (*DocumentIndexer) Index

func (di *DocumentIndexer) Index(ctx context.Context) error

type Entries

type Entries struct {
	NextToken *string
	Entries   []benchlingsdk.Entry
}

type Folders

type Folders struct {
	NextToken *string
	Folders   []benchlingsdk.Folder
}

type Projects

type Projects struct {
	NextToken *string
	Projects  []benchlingsdk.Project
}

type ScanPayload

type ScanPayload[T any] struct {
	NextToken *string
	Payload   []T
}

type Scanners

type Scanners interface {
	Entries | Users | Folders | Projects
}

type Users

type Users struct {
	NextToken *string
	Users     []benchlingsdk.User
}

Directories

Path Synopsis
Package benchlingcmd provides support for building command line tools that access benchling.com
Package benchlingcmd provides support for building command line tools that access benchling.com
Package benchlingsdk provides primitives to interact with the openapi HTTP API.
Package benchlingsdk provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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