kubeless

package module
v0.0.0-...-9db3ab3 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: BSD-2-Clause Imports: 8 Imported by: 0

README

uniprot cache function

A Golang-based Kubeless function to store mapping between UniProt and D.discoideum gene identifiers.

Dependencies

Deploy function

$_> zip uniprot.zip *.go go.mod
$_> kubeless function deploy \
uniprotcachefn --runtime go1.13 --from-file uniprot.zip --handler uniprot.CacheIds
--dependencies go.mod --namespace dictybase

  • read the deployment status of function (blocks terminal)

    $_> kubectl get pod -l function=uniprotcachefn -n dictybase -w

  • check the status of function

    $_> kubeless function ls uniprotcachefn --namespace dictybase

Run function

$_> kubeless function call uniprotcachefn --namespace dictybase

You will receive the following output
name:3664 id:8397 isoform:97 unresolved:8 nomap:1063

Also open the log in another terminal (blocks terminal)

$_> kubeless function log uniprotcachefn --namespace dictybase -f

Documentation

Index

Constants

View Source
const (
	// IDCacheKey is the key for storing redis hash field value
	IDCacheKey = "UNIPROT2NAME/uniprot"
	// URL is the uniprot endpoint
	URL = "https://www.uniprot.org/uniprot/?query=taxonomy:44689&columns=id,database(dictyBase),genes(PREFERRED)&format=tab"
)

Variables

This section is empty.

Functions

func CacheIds

func CacheIds(event functions.Event, ctx functions.Context) (string, error)

CacheIds stores uniprot and gene name or identifier mapping in redis

Types

type Storage

type Storage interface {
	Get(string, string) (string, error)
	Set(string, string, string) error
	Delete(string, ...string) error
	IsExist(string, string) bool
	Close() error
}

Storage interface is for manging key value data

func NewRedisStorage

func NewRedisStorage(master, slave string) Storage

NewRedisStorage is the constructor for redis for storing hash based key value

Jump to

Keyboard shortcuts

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