benchling

package module
v0.0.0-...-94ea356 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

README

Package cloudeng.io/webapi/clients/benchling

import cloudeng.io/webapi/clients/benchling

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

Constants

DocumentType, EntryType, ProjectType, FolderType, UserType
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")

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 {
	UserID  string
	TokenID string
}

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

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

WithAuthorization implements operations.Authorizer.

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.

Functions
func NewBackoff(initial time.Duration, steps int) *Backoff
Methods
func (bb *Backoff) Retries() int
func (bb *Backoff) Wait(ctx context.Context, r any) (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
}
Functions
func NewDocumentIndexer(fs operations.FS, downloads string, sharder path.Sharder, concurrency int) *DocumentIndexer
Methods
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 Objects
type Objects interface {
	benchlingsdk.Entry | benchlingsdk.User | benchlingsdk.Folder | benchlingsdk.Project | Document
}
Type Params
type Params interface {
	*benchlingsdk.ListEntriesParams | *benchlingsdk.ListUsersParams | *benchlingsdk.ListFoldersParams | *benchlingsdk.ListProjectsParams
}
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
}

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 {
	UserID  string
	TokenID string
}

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

func (APIToken) WithAuthorization

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

WithAuthorization implements operations.Authorizer.

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, r any) (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