Skip to content

digitalocean/sample-functions-golang-helloworld

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample Function: Go "Hello World"

Introduction

This repository contains a sample "Hello World" function written in Go. You can deploy it on DigitalOcean's App Platform as a Serverless Function component. Documentation is available at https://docs.digitalocean.com/products/functions.

Requirements

Deploying the Function

# clone this repo
git clone git@github.com:digitalocean/sample-functions-golang-helloworld.git
# deploy the project, using a remote build so that compiled executable matched runtime environment
> doctl serverless deploy sample-functions-golang-helloworld --remote-build
Deploying 'sample-functions-golang-helloworld'
  to namespace 'fn-...'
  on host 'https://faas-...'
Submitted action 'hello' for remote building and deployment in runtime go:default (id: ...)

Deployed functions ('doctl sls fn get <funcName> --url' for URL):
  - sample/hello

Using the Function

doctl serverless functions invoke sample/hello
{
  "body": "Hello stranger!"
}
doctl serverless functions invoke sample/hello -p name:Sammy
{
  "body": "Hello Sammy!"
}

Learn More

You can learn more about Functions and App Platform integration in the official App Platform Documentation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages