services

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: MIT Imports: 4 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	Get(ctx context.Context, key *datastore.Key, dst interface{}) (err error)
	Put(ctx context.Context, key *datastore.Key, src interface{}) (*datastore.Key, error)
	GetMulti(ctx context.Context, keys []*datastore.Key, dst interface{}) (err error)
	PutMulti(ctx context.Context, keys []*datastore.Key, src interface{}) (_ []*datastore.Key, err error)
}

Database provides the functionality to persist and recall data. In production we use the gcs datastore. In local development mode we use a memory data store.

type Fetcher

type Fetcher interface {
	Fetch(ctx context.Context, url string) (billy.Filesystem, error)
}

Fetcher fetches the worktree for a git repository. In production the repo is cloned or loaded from the persistence cache and fetched to ensure it's update. In local development mode the repo is loaded from the local GOPATH.

type Fileserver

type Fileserver interface {
	Write(ctx context.Context, bucket, name string, reader io.Reader, overwrite bool, contentType, cacheControl string) (saved bool, err error)
	Read(ctx context.Context, bucket, name string, writer io.Writer) (found bool, err error)
	Exists(ctx context.Context, bucket, name string) (bool, error)
}

Fileserver provides the functionality to persist files and host them for web delivery. In production we use GCS buckets. In local storage mode we use a temporary directory

type Message

type Message interface{}

type Resolver

type Resolver interface {
	Resolve(ctx context.Context, path string) (url string, root string, err error)
}

Resolver provides the functionality to resolve package paths to repo URLs. In production mode this uses the `go get` codebase. In local mode we scan the gopath.

Directories

Path Synopsis
package constor (concurrent storer) for storing items into a services.Fileserver concurrently
package constor (concurrent storer) for storing items into a services.Fileserver concurrently
database
fetcher
fileserver
getter
get
Package str provides string manipulation utilities.
Package str provides string manipulation utilities.
Package srcimporter implements importing directly from source files rather than installed packages.
Package srcimporter implements importing directly from source files rather than installed packages.

Jump to

Keyboard shortcuts

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