Update gce compute api godep.

This commit is contained in:
Prashanth Balasubramanian 2016-01-08 17:32:19 -08:00
parent cc09a603dd
commit f42aaefbdb
8 changed files with 24785 additions and 6795 deletions

8
Godeps/Godeps.json generated
View File

@ -925,19 +925,19 @@
},
{
"ImportPath": "google.golang.org/api/cloudmonitoring/v2beta2",
"Rev": "0c2979aeaa5b573e60d3ddffe5ce8dca8df309bd"
"Rev": "77e7d383beb96054547729f49c372b3d01e196ff"
},
{
"ImportPath": "google.golang.org/api/compute/v1",
"Rev": "0c2979aeaa5b573e60d3ddffe5ce8dca8df309bd"
"Rev": "77e7d383beb96054547729f49c372b3d01e196ff"
},
{
"ImportPath": "google.golang.org/api/container/v1",
"Rev": "0c2979aeaa5b573e60d3ddffe5ce8dca8df309bd"
"Rev": "77e7d383beb96054547729f49c372b3d01e196ff"
},
{
"ImportPath": "google.golang.org/api/googleapi",
"Rev": "0c2979aeaa5b573e60d3ddffe5ce8dca8df309bd"
"Rev": "77e7d383beb96054547729f49c372b3d01e196ff"
},
{
"ImportPath": "google.golang.org/cloud/compute/metadata",

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/6g1NnM2JgMMXgWbO_PX25Eu0zKs\"",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/FD4oCwspiZqN6eCjsBmxDzsj5B8\"",
"discoveryVersion": "v1",
"id": "container:v1",
"name": "container",
"version": "v1",
"revision": "20150605",
"revision": "20150603",
"title": "Google Container Engine API",
"description": "The Google Container Engine API is used for building and managing container based applications, powered by the open source Kubernetes technology.",
"ownerDomain": "google.com",
@ -17,7 +17,7 @@
"documentationLink": "https://cloud.google.com/container-engine/",
"protocol": "rest",
"baseUrl": "https://container.googleapis.com/",
"basePath": "",
"basePath": "/",
"rootUrl": "https://container.googleapis.com/",
"servicePath": "",
"batchPath": "batch",
@ -144,7 +144,7 @@
},
"nodeConfig": {
"$ref": "NodeConfig",
"description": "Parameters used in creating the cluster's nodes. See the descriptions of the child properties of `nodeConfig`."
"description": "Parameters used in creating the cluster's nodes. See the descriptions of the child properties of `nodeConfig`. If unspecified, the defaults for all child properties are used."
},
"masterAuth": {
"$ref": "MasterAuth",
@ -164,39 +164,39 @@
},
"clusterIpv4Cidr": {
"type": "string",
"description": "The IP address range of the container pods in this cluster, in [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) notation (e.g. `10.96.0.0/14`). Leave blank to have one automatically chosen or specify a `/14` block in `10.0.0.0/8` or `172.16.0.0/12`."
"description": "The IP address range of the container pods in this cluster, in [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) notation (e.g. `10.96.0.0/14`). Leave blank to have one automatically chosen or specify a `/14` block in `10.0.0.0/8`."
},
"selfLink": {
"type": "string",
"description": "[Output only] Server-defined URL for the resource. @OutputOnly."
"description": "[Output only] Server-defined URL for the resource."
},
"zone": {
"type": "string",
"description": "[Output only] The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. @OutputOnly."
"description": "[Output only] The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides."
},
"endpoint": {
"type": "string",
"description": "[Output only] The IP address of this cluster's Kubernetes master endpoint. The endpoint can be accessed from the internet at `https://username:password@endpoint/`. @OutputOnly. See the `masterAuth` property of this resource for username and password information."
"description": "[Output only] The IP address of this cluster's Kubernetes master endpoint. The endpoint can be accessed from the internet at `https://username:password@endpoint/`. See the `masterAuth` property of this resource for username and password information."
},
"initialClusterVersion": {
"type": "string",
"description": "[Output only] The software version of Kubernetes master and kubelets used in the cluster when it was first created. The version can be upgraded over time. @OutputOnly."
"description": "[Output only] The software version of Kubernetes master and kubelets used in the cluster when it was first created. The version can be upgraded over time."
},
"currentMasterVersion": {
"type": "string",
"description": "[Output only] The current software version of the master endpoint. @OutputOnly."
"description": "[Output only] The current software version of the master endpoint."
},
"currentNodeVersion": {
"type": "string",
"description": "[Output only] The current version of the node software components. If they are currently at different versions because they're in the process of being upgraded, this reflects the minimum version of any of them. @OutputOnly."
"description": "[Output only] The current version of the node software components. If they are currently at different versions because they're in the process of being upgraded, this reflects the minimum version of any of them."
},
"createTime": {
"type": "string",
"description": "[Output only] The time the cluster was created, in [RFC3339](href='https://www.ietf.org/rfc/rfc3339.txt) text format. @OutputOnly."
"description": "[Output only] The time the cluster was created, in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format."
},
"status": {
"type": "string",
"description": "[Output only] The current status of this cluster. @OutputOnly.",
"description": "[Output only] The current status of this cluster.",
"enum": [
"STATUS_UNSPECIFIED",
"PROVISIONING",
@ -208,20 +208,20 @@
},
"statusMessage": {
"type": "string",
"description": "[Output only] Additional information about the current status of this cluster, if available. @OutputOnly."
"description": "[Output only] Additional information about the current status of this cluster, if available."
},
"nodeIpv4CidrSize": {
"type": "integer",
"description": "[Output only] The size of the address space on each node for hosting containers. This is provisioned from within the container_ipv4_cidr range. @OutputOnly.",
"description": "[Output only] The size of the address space on each node for hosting containers. This is provisioned from within the container_ipv4_cidr range.",
"format": "int32"
},
"servicesIpv4Cidr": {
"type": "string",
"description": "[Output only] The IP address range of the Kubernetes services in this cluster, in [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) notation (e.g. `1.2.3.4/29`). Service addresses are typically put in the last /16 from the container CIDR. @OutputOnly."
"description": "[Output only] The IP address range of the Kubernetes services in this cluster, in [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) notation (e.g. `1.2.3.4/29`). Service addresses are typically put in the last /16 from the container CIDR."
},
"instanceGroupUrls": {
"type": "array",
"description": "[Output only] The resource URLs of [instance groups](/compute/docs/instance-groups/) associated with this cluster. @OutputOnly.",
"description": "[Output only] The resource URLs of [instance groups](/compute/docs/instance-groups/) associated with this cluster.",
"items": {
"type": "string"
}
@ -239,12 +239,12 @@
},
"diskSizeGb": {
"type": "integer",
"description": "Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB, and the default is 100GB.",
"description": "Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB. If unspecified, the default disk size is 100GB.",
"format": "int32"
},
"oauthScopes": {
"type": "array",
"description": "The set of Google API scopes to be made available on all of the node VMs under the \"default\" service account. Currently, the following scopes are necessary to ensure the correct functioning of the cluster: * \"https://www.googleapis.com/auth/compute\" * \"https://www.googleapis.com/auth/devstorage.read_only\"",
"description": "The set of Google API scopes to be made available on all of the node VMs under the \"default\" service account. The following scopes are recommended, but not required, and by default are not included: * `https://www.googleapis.com/auth/compute` is required for mounting persistent storage on your nodes. * `https://www.googleapis.com/auth/devstorage.read_only` is required for communicating with *gcr.io*. If unspecified, no scopes are added.",
"items": {
"type": "string"
}
@ -266,15 +266,15 @@
},
"clusterCaCertificate": {
"type": "string",
"description": "[Output only] Base64 encoded public certificate that is the root of trust for the cluster. @OutputOnly."
"description": "[Output only] Base64 encoded public certificate that is the root of trust for the cluster."
},
"clientCertificate": {
"type": "string",
"description": "[Output only] Base64 encoded public certificate used by clients to authenticate to the cluster endpoint. @OutputOnly."
"description": "[Output only] Base64 encoded public certificate used by clients to authenticate to the cluster endpoint."
},
"clientKey": {
"type": "string",
"description": "[Output only] Base64 encoded private key used by clients to authenticate to the cluster endpoint. @OutputOnly."
"description": "[Output only] Base64 encoded private key used by clients to authenticate to the cluster endpoint."
}
}
},
@ -285,7 +285,7 @@
"properties": {
"cluster": {
"$ref": "Cluster",
"description": "A [cluster resource](/container-engine/docs/v1/projects/zones/clusters)"
"description": "A [cluster resource](/container-engine/reference/rest/v1/projects.zones.clusters)"
}
}
},
@ -296,15 +296,15 @@
"properties": {
"name": {
"type": "string",
"description": "The server-assigned ID for the operation. @OutputOnly."
"description": "The server-assigned ID for the operation."
},
"zone": {
"type": "string",
"description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the operation is taking place. @OutputOnly."
"description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the operation is taking place."
},
"operationType": {
"type": "string",
"description": "The operation type. @OutputOnly.",
"description": "The operation type.",
"enum": [
"TYPE_UNSPECIFIED",
"CREATE_CLUSTER",
@ -316,7 +316,7 @@
},
"status": {
"type": "string",
"description": "The current status of the operation. @OutputOnly.",
"description": "The current status of the operation.",
"enum": [
"STATUS_UNSPECIFIED",
"PENDING",
@ -326,15 +326,15 @@
},
"statusMessage": {
"type": "string",
"description": "If an error has occurred, a textual description of the error. @OutputOnly."
"description": "If an error has occurred, a textual description of the error."
},
"selfLink": {
"type": "string",
"description": "Server-defined URL for the resource. @OutputOnly."
"description": "Server-defined URL for the resource."
},
"targetLink": {
"type": "string",
"description": "Server-defined URL for the target of the operation. @OutputOnly."
"description": "Server-defined URL for the target of the operation."
}
}
},
@ -373,12 +373,62 @@
}
}
}
},
"ServerConfig": {
"id": "ServerConfig",
"type": "object",
"description": "Container Engine Server configuration.",
"properties": {
"defaultClusterVersion": {
"type": "string",
"description": "What version this server deploys by default."
},
"validNodeVersions": {
"type": "array",
"description": "List of valid node upgrade target versions.",
"items": {
"type": "string"
}
}
}
}
},
"resources": {
"projects": {
"resources": {
"zones": {
"methods": {
"getServerconfig": {
"id": "container.projects.zones.getServerconfig",
"path": "v1/projects/{projectId}/zones/{zone}/serverconfig",
"httpMethod": "GET",
"description": "Returns configuration info about the Container Engine service.",
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"required": true,
"location": "path"
},
"zone": {
"type": "string",
"description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or \"-\" for all zones.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"projectId",
"zone"
],
"response": {
"$ref": "ServerConfig"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
},
"resources": {
"clusters": {
"methods": {
@ -390,7 +440,7 @@
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID](https://console.developers.google.com/project) or [project number](https://developers.google.com/console/help/project-number)",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"required": true,
"location": "path"
},
@ -420,7 +470,7 @@
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console A [project ID](https://console.developers.google.com/project) or [project number](https://developers.google.com/console/help/project-number)",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"required": true,
"location": "path"
},
@ -453,11 +503,11 @@
"id": "container.projects.zones.clusters.create",
"path": "v1/projects/{projectId}/zones/{zone}/clusters",
"httpMethod": "POST",
"description": "Creates a cluster, consisting of the specified number and type of Google Compute Engine instances, plus a Kubernetes master endpoint. By default, the cluster is created in the project's [default network]('/compute/docs/networking#networks_1'). One firewall is added for the cluster. After cluster creation, the cluster creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster. Finally, an entry is added to the project's global metadata indicating which CIDR range is being used by the cluster.",
"description": "Creates a cluster, consisting of the specified number and type of Google Compute Engine instances, plus a Kubernetes master endpoint. By default, the cluster is created in the project's [default network](/compute/docs/networking#networks_1). One firewall is added for the cluster. After cluster creation, the cluster creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster. Finally, an entry is added to the project's global metadata indicating which CIDR range is being used by the cluster.",
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID](https://console.developers.google.com/project) or [project number](https://developers.google.com/console/help/project-number)",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"required": true,
"location": "path"
},
@ -490,7 +540,7 @@
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID](https://console.developers.google.com/project) or [project number](https://developers.google.com/console/help/project-number)",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"required": true,
"location": "path"
},
@ -530,7 +580,7 @@
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID](https://console.developers.google.com/project) or [project number](https://developers.google.com/console/help/project-number)",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"required": true,
"location": "path"
},
@ -571,7 +621,7 @@
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID](https://console.developers.google.com/project) or [project number](https://developers.google.com/console/help/project-number)",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"required": true,
"location": "path"
},
@ -601,7 +651,7 @@
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID](https://console.developers.google.com/project) or [project number](https://developers.google.com/console/help/project-number)",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"required": true,
"location": "path"
},

File diff suppressed because it is too large Load Diff

View File

@ -9,13 +9,10 @@ package googleapi
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"mime/multipart"
"net/http"
"net/textproto"
"net/url"
"regexp"
"strconv"
@ -24,6 +21,7 @@ import (
"time"
"golang.org/x/net/context"
"golang.org/x/net/context/ctxhttp"
"google.golang.org/api/googleapi/internal/uritemplates"
)
@ -42,6 +40,16 @@ type SizeReaderAt interface {
Size() int64
}
// ServerResponse is embedded in each Do response and
// provides the HTTP status code and header sent by the server.
type ServerResponse struct {
// HTTPStatusCode is the server's response status code.
// When using a resource method's Do call, this will always be in the 2xx range.
HTTPStatusCode int
// Header contains the response header fields from the server.
Header http.Header
}
const (
Version = "0.5"
@ -65,6 +73,8 @@ type Error struct {
// Body is the raw response returned by the server.
// It is often but not always JSON, depending on how the request fails.
Body string
// Header contains the response header fields from the server.
Header http.Header
Errors []ErrorItem
}
@ -122,6 +132,34 @@ func CheckResponse(res *http.Response) error {
return jerr.Error
}
}
return &Error{
Code: res.StatusCode,
Body: string(slurp),
Header: res.Header,
}
}
// IsNotModified reports whether err is the result of the
// server replying with http.StatusNotModified.
// Such error values are sometimes returned by "Do" methods
// on calls when If-None-Match is used.
func IsNotModified(err error) bool {
if err == nil {
return false
}
ae, ok := err.(*Error)
return ok && ae.Code == http.StatusNotModified
}
// CheckMediaResponse returns an error (of type *Error) if the response
// status code is not 2xx. Unlike CheckResponse it does not assume the
// body is a JSON error document.
func CheckMediaResponse(res *http.Response) error {
if res.StatusCode >= 200 && res.StatusCode <= 299 {
return nil
}
slurp, _ := ioutil.ReadAll(io.LimitReader(res.Body, 1<<20))
res.Body.Close()
return &Error{
Code: res.StatusCode,
Body: string(slurp),
@ -148,52 +186,6 @@ func (wrap MarshalStyle) JSONReader(v interface{}) (io.Reader, error) {
return buf, nil
}
func getMediaType(media io.Reader) (io.Reader, string) {
if typer, ok := media.(ContentTyper); ok {
return media, typer.ContentType()
}
pr, pw := io.Pipe()
typ := "application/octet-stream"
buf, err := ioutil.ReadAll(io.LimitReader(media, 512))
if err != nil {
pw.CloseWithError(fmt.Errorf("error reading media: %v", err))
return pr, typ
}
typ = http.DetectContentType(buf)
mr := io.MultiReader(bytes.NewReader(buf), media)
go func() {
_, err = io.Copy(pw, mr)
if err != nil {
pw.CloseWithError(fmt.Errorf("error reading media: %v", err))
return
}
pw.Close()
}()
return pr, typ
}
// DetectMediaType detects and returns the content type of the provided media.
// If the type can not be determined, "application/octet-stream" is returned.
func DetectMediaType(media io.ReaderAt) string {
if typer, ok := media.(ContentTyper); ok {
return typer.ContentType()
}
typ := "application/octet-stream"
buf := make([]byte, 1024)
n, err := media.ReadAt(buf, 0)
buf = buf[:n]
if err == nil || err == io.EOF {
typ = http.DetectContentType(buf)
}
return typ
}
type Lengther interface {
Len() int
}
// endingWithErrorReader from r until it returns an error. If the
// final error from r is io.EOF and e is non-nil, e is used instead.
type endingWithErrorReader struct {
@ -209,12 +201,6 @@ func (er endingWithErrorReader) Read(p []byte) (n int, err error) {
return
}
func typeHeader(contentType string) textproto.MIMEHeader {
h := make(textproto.MIMEHeader)
h.Set("Content-Type", contentType)
return h
}
// countingWriter counts the number of bytes it receives to write, but
// discards them.
type countingWriter struct {
@ -226,66 +212,6 @@ func (w countingWriter) Write(p []byte) (int, error) {
return len(p), nil
}
// ConditionallyIncludeMedia does nothing if media is nil.
//
// bodyp is an in/out parameter. It should initially point to the
// reader of the application/json (or whatever) payload to send in the
// API request. It's updated to point to the multipart body reader.
//
// ctypep is an in/out parameter. It should initially point to the
// content type of the bodyp, usually "application/json". It's updated
// to the "multipart/related" content type, with random boundary.
//
// The return value is the content-length of the entire multpart body.
func ConditionallyIncludeMedia(media io.Reader, bodyp *io.Reader, ctypep *string) (cancel func(), ok bool) {
if media == nil {
return
}
// Get the media type, which might return a different reader instance.
var mediaType string
media, mediaType = getMediaType(media)
body, bodyType := *bodyp, *ctypep
pr, pw := io.Pipe()
mpw := multipart.NewWriter(pw)
*bodyp = pr
*ctypep = "multipart/related; boundary=" + mpw.Boundary()
go func() {
w, err := mpw.CreatePart(typeHeader(bodyType))
if err != nil {
mpw.Close()
pw.CloseWithError(fmt.Errorf("googleapi: body CreatePart failed: %v", err))
return
}
_, err = io.Copy(w, body)
if err != nil {
mpw.Close()
pw.CloseWithError(fmt.Errorf("googleapi: body Copy failed: %v", err))
return
}
w, err = mpw.CreatePart(typeHeader(mediaType))
if err != nil {
mpw.Close()
pw.CloseWithError(fmt.Errorf("googleapi: media CreatePart failed: %v", err))
return
}
_, err = io.Copy(w, media)
if err != nil {
mpw.Close()
pw.CloseWithError(fmt.Errorf("googleapi: media Copy failed: %v", err))
return
}
mpw.Close()
pw.Close()
}()
cancel = func() { pw.CloseWithError(errAborted) }
return cancel, true
}
var errAborted = errors.New("googleapi: upload aborted")
// ProgressUpdater is a function that is called upon every progress update of a resumable upload.
// This is the only part of a resumable upload (from googleapi) that is usable by the developer.
// The remaining usable pieces of resumable uploads is exposed in each auto-generated API.
@ -307,10 +233,9 @@ type ResumableUpload struct {
mu sync.Mutex // guards progress
progress int64 // number of bytes uploaded so far
started bool // whether the upload has been started
// Callback is an optional function that will be called upon every progress update.
Callback ProgressUpdater
// Callback is an optional function that will be periodically called with the cumulative number of bytes uploaded.
Callback func(int64)
}
var (
@ -328,12 +253,12 @@ func (rx *ResumableUpload) Progress() int64 {
return rx.progress
}
func (rx *ResumableUpload) transferStatus() (int64, *http.Response, error) {
func (rx *ResumableUpload) transferStatus(ctx context.Context) (int64, *http.Response, error) {
req, _ := http.NewRequest("POST", rx.URI, nil)
req.ContentLength = 0
req.Header.Set("User-Agent", rx.UserAgent)
req.Header.Set("Content-Range", fmt.Sprintf("bytes */%v", rx.ContentLength))
res, err := rx.Client.Do(req)
res, err := ctxhttp.Do(ctx, rx.Client, req)
if err != nil || res.StatusCode != statusResumeIncomplete {
return 0, res, err
}
@ -355,16 +280,13 @@ type chunk struct {
}
func (rx *ResumableUpload) transferChunks(ctx context.Context) (*http.Response, error) {
var start int64
var err error
res := &http.Response{}
if rx.started {
start, res, err = rx.transferStatus()
if err != nil || res.StatusCode != statusResumeIncomplete {
return res, err
start, res, err := rx.transferStatus(ctx)
if err != nil || res.StatusCode != statusResumeIncomplete {
if err == context.Canceled {
return &http.Response{StatusCode: http.StatusRequestTimeout}, err
}
return res, err
}
rx.started = true
for {
select { // Check for cancellation
@ -383,14 +305,14 @@ func (rx *ResumableUpload) transferChunks(ctx context.Context) (*http.Response,
req.Header.Set("Content-Range", fmt.Sprintf("bytes %v-%v/%v", start, start+reqSize-1, rx.ContentLength))
req.Header.Set("Content-Type", rx.MediaType)
req.Header.Set("User-Agent", rx.UserAgent)
res, err = rx.Client.Do(req)
res, err = ctxhttp.Do(ctx, rx.Client, req)
start += reqSize
if err == nil && (res.StatusCode == statusResumeIncomplete || res.StatusCode == http.StatusOK) {
rx.mu.Lock()
rx.progress = start // keep track of number of bytes sent so far
rx.mu.Unlock()
if rx.Callback != nil {
rx.Callback(start, rx.ContentLength)
rx.Callback(start)
}
}
if err != nil || res.StatusCode != statusResumeIncomplete {

View File

@ -148,3 +148,35 @@ func (s Float64s) MarshalJSON() ([]byte, error) {
return strconv.AppendFloat(dst, s[i], 'g', -1, 64)
})
}
/*
* Helper routines for simplifying the creation of optional fields of basic type.
*/
// Bool is a helper routine that allocates a new bool value
// to store v and returns a pointer to it.
func Bool(v bool) *bool { return &v }
// Int32 is a helper routine that allocates a new int32 value
// to store v and returns a pointer to it.
func Int32(v int32) *int32 { return &v }
// Int64 is a helper routine that allocates a new int64 value
// to store v and returns a pointer to it.
func Int64(v int64) *int64 { return &v }
// Float64 is a helper routine that allocates a new float64 value
// to store v and returns a pointer to it.
func Float64(v float64) *float64 { return &v }
// Uint32 is a helper routine that allocates a new uint32 value
// to store v and returns a pointer to it.
func Uint32(v uint32) *uint32 { return &v }
// Uint64 is a helper routine that allocates a new uint64 value
// to store v and returns a pointer to it.
func Uint64(v uint64) *uint64 { return &v }
// String is a helper routine that allocates a new string value
// to store v and returns a pointer to it.
func String(v string) *string { return &v }