All Projects → flowup → Cloudfunc

flowup / Cloudfunc

Licence: mit
deploying Google Cloud Functions written in Golang with ease

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Cloudfunc

Awesome Aws
A curated list of awesome Amazon Web Services (AWS) libraries, open source repos, guides, blogs, and other resources. Featuring the Fiery Meter of AWSome.
Stars: ✭ 9,895 (+9996.94%)
Mutual labels:  serverless
Lambstatus
[Maintenance mode] Serverless Status Page System
Stars: ✭ 1,323 (+1250%)
Mutual labels:  serverless
Faasd
A lightweight & portable faas engine
Stars: ✭ 1,330 (+1257.14%)
Mutual labels:  serverless
Lambda Cost Calculator
Forecast Lambda functions costs 💰
Stars: ✭ 91 (-7.14%)
Mutual labels:  serverless
Cirrus
Serverless ML Framework
Stars: ✭ 93 (-5.1%)
Mutual labels:  serverless
Github Codebuild Integration
Run and Integrate AWS CodeBuild with GitHub Push/Pull-Request webhook events.
Stars: ✭ 94 (-4.08%)
Mutual labels:  serverless
Wg Serverless
CNCF Serverless WG
Stars: ✭ 1,298 (+1224.49%)
Mutual labels:  serverless
Ops Aws Vpn
Serverless OpenVPN Certificate Authority running on AWS
Stars: ✭ 97 (-1.02%)
Mutual labels:  serverless
Jrestless
Run JAX-RS applications on AWS Lambda using Jersey. Supports Spring 4.x. The serverless framework can be used for deployment.
Stars: ✭ 93 (-5.1%)
Mutual labels:  serverless
Kinesis Streams Fan Out Kinesis Analytics
Amazon Kinesis Streams fan-out via Kinesis Analytics (powered by the Serverless Framework)
Stars: ✭ 95 (-3.06%)
Mutual labels:  serverless
Neardb
Simple document db made for infinitely scalable globally distributed reads.
Stars: ✭ 92 (-6.12%)
Mutual labels:  serverless
Coinboss
⚡️💸💰 A Serverless Coinbase tradingbot.
Stars: ✭ 92 (-6.12%)
Mutual labels:  serverless
Onemanager Php
An index & manager of Onedrive based on serverless. Can be deployed to Heroku/Glitch/SCF/FG/FC/CFC/PHP web hosting/VPS.
Stars: ✭ 1,313 (+1239.8%)
Mutual labels:  serverless
Daggy
Daggy - Data Aggregation Utility. Open source, free, cross-platform, server-less, useful utility for remote or local data aggregation and streaming
Stars: ✭ 91 (-7.14%)
Mutual labels:  serverless
Blurr
Data transformations for the ML era
Stars: ✭ 96 (-2.04%)
Mutual labels:  serverless
Cloud Run Button
See Other:
Stars: ✭ 91 (-7.14%)
Mutual labels:  serverless
Faast.js
Serverless batch computing made simple.
Stars: ✭ 1,323 (+1250%)
Mutual labels:  serverless
Agentframework
An elegant & efficient TypeScript metaprogramming API to build software agents
Stars: ✭ 97 (-1.02%)
Mutual labels:  serverless
Tencent Express
Easily deploy serverless Express.js applications to Tencent Cloud with the Serverless Framework
Stars: ✭ 96 (-2.04%)
Mutual labels:  serverless
S3 To Lambda Patterns
Example applications for the S3-to-Lambda patterns series in the AWS Compute Blog and learning path. Questions? @jbesw.
Stars: ✭ 95 (-3.06%)
Mutual labels:  serverless

CloudFunc

GoDoc

CloudFunc is a command line tool (cli) that deploys Google Cloud Functions with ease. It uses node.js shim to wrap the Go binary as the Cloud Functions only support Node at the moment.

Only us-central region is supported while Google Cloud Functions are in Beta

Installation

Tested on Golang 1.8

Please follow gcloud sdk installation notes in case you don't have the gcloud command.

You will also need to update and install beta features at the moment

gcloud components update &&
gcloud components install beta

Finally download the cloudfunc with its SDK

go get -u github.com/flowup/cloudfunc/...

Code Example

This code example shows a simple cloud function that sends back whatever JSON it receives.

package main

import (
	"github.com/flowup/cloudfunc/api"
)

func main() {
	var input map[string]interface{} = make(map[string]interface{})
	
	cloudFunction := api.NewCloudFunc()
	req, err := cloudFunction.GetRequest()
	if err != nil {
		panic(err)
	}
	
	err = req.BindBody(&input)
	if err != nil {
		panic(err)
	}

	cloudFunction.SendResponse(&input)
}

Usage

Single deploy command is exposed by the cloudfunc. This allows to target a folder with main package that will be deployed to cloud functions. Name of the function will be derived from the name of the folder.

You need to also target the storage bucket that will be used to store contents of your function

cloudfunc deploy myfunction --bucket mybucket

Where:

  • myfunction is the folder with your function
  • mybucket is the name of your gcloud bucket

Configuration

Additional configurations can be done using function.json file within your function main package (look at the /examples folder).

{
  "name": "myfunctionname",
  "bucket": "mybucketname",
  "memory": 128,
  "timeout": 3
}

In case your bucket is specified within the function.json file, you can simply deploy with:

cloudfunc deploy example # where example is your function folder

SDK

There are two IO functions provided by github.com/flowup/cloudfunc/api:

// GetInput accepts an interface and unmarshalls the function input using json.Unmarshal
func GetInput(i interface{}) error {}
// Send marshalls given interface using json.Marshal and sends it back as a function output
// If the interface can't be serialized, it will be returned as a pure string
func Send(i interface{}) error
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].