Here's the simplest example showing how to do functional options in Golang.
They're a great way to enable users to set options and ease adding new options later.
package main
import (
"flag"
"fmt"
protoPackageName = "si.account" | |
service.Account.CreateAccount.skipauth = true | |
service.Account.CreateAccount.mutation = true | |
service.Account.GetBillingAccount.query = true | |
service.Account.CreateUser.mutation = true | |
service.Account.GetUser.query = true | |
service.Account.ListUsers.query = true | |
service.Account.ListWorkspaces.query = true | |
service.Account.ListOrganizations.query = true |
Here's the simplest example showing how to do functional options in Golang.
They're a great way to enable users to set options and ease adding new options later.
package main
import (
"flag"
"fmt"
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); |