kandi background
Explore Kits

go-cloud | Go Cloud Development Kit : A library and tools | GCP library

 by   google Go Version: v0.24.0 License: Apache-2.0

 by   google Go Version: v0.24.0 License: Apache-2.0

Download this library from

kandi X-RAY | go-cloud Summary

go-cloud is a Go library typically used in Cloud, GCP, Docker applications. go-cloud has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.
The Go Cloud Development Kit (Go CDK) allows Go application developers to seamlessly deploy cloud applications on any combination of cloud providers. It does this by providing stable, idiomatic interfaces for common uses like storage and databases. Think database/sql for cloud products.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • go-cloud has a medium active ecosystem.
  • It has 8273 star(s) with 706 fork(s). There are 227 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 20 open issues and 1078 have been closed. On average issues are closed in 506 days. There are 4 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of go-cloud is v0.24.0
go-cloud Support
Best in #GCP
Average in #GCP
go-cloud Support
Best in #GCP
Average in #GCP

quality kandi Quality

  • go-cloud has 0 bugs and 0 code smells.
go-cloud Quality
Best in #GCP
Average in #GCP
go-cloud Quality
Best in #GCP
Average in #GCP

securitySecurity

  • go-cloud has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • go-cloud code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
go-cloud Security
Best in #GCP
Average in #GCP
go-cloud Security
Best in #GCP
Average in #GCP

license License

  • go-cloud is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
go-cloud License
Best in #GCP
Average in #GCP
go-cloud License
Best in #GCP
Average in #GCP

buildReuse

  • go-cloud releases are available to install and integrate.
  • Installation instructions, examples and code snippets are available.
  • It has 50403 lines of code, 2831 functions and 329 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
go-cloud Reuse
Best in #GCP
Average in #GCP
go-cloud Reuse
Best in #GCP
Average in #GCP
Top functions reviewed by kandi - BETA

kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample Here

Get all kandi verified functions for this library.

Get all kandi verified functions for this library.

go-cloud Key Features

Unstructured binary (blob) storage

Publish/Subscribe (pubsub)

Variables that change at runtime (runtimevar)

Connecting to MySQL and PostgreSQL databases (mysql, postgres)

Server startup and diagnostics: request logging, tracing, and health checking (server)

The Go Cloud Development Kit (Go CDK)

copy iconCopydownload iconDownload
ctx := context.Background()
bucket, err := blob.OpenBucket(ctx, "s3://my-bucket")
if err != nil {
    return err
}
defer bucket.Close()
blobReader, err := bucket.NewReader(ctx, "my-blob", nil)
if err != nil {
    return err
}

Installation

copy iconCopydownload iconDownload
# First "cd" into your project directory if you have one to ensure "go get" uses
# Go modules (or not) appropriately. See "go help modules" for more info.
go get gocloud.dev

Go Stackdriver debugger error loading program

copy iconCopydownload iconDownload
FROM golang:alpine

RUN apk add git
RUN go get -u cloud.google.com/go/cmd/go-cloud-debug-agent

ADD main.go src
RUN CGO_ENABLED=0 go build -gcflags=all='-N -l' src/main.go

ADD source-context.json /

CMD ["bin/go-cloud-debug-agent","-sourcecontext=/source-context.json", "-appmodule=stackdriver-demo","-appversion=1.0","--","main"]

gcr.io/dazwilkin-190402-55473323/roberson34@sha256:17cb45f1320e2fe04e0681310506f4c229896429192b0d1c2c8dc20ed54adb0d
FROM golang:alpine

RUN apk add git
RUN go get -u cloud.google.com/go/cmd/go-cloud-debug-agent

ADD main.go src
RUN CGO_ENABLED=0 go build -gcflags=all='-N -l' src/main.go

ADD source-context.json /

CMD ["bin/go-cloud-debug-agent","-sourcecontext=/source-context.json", "-appmodule=stackdriver-demo","-appversion=1.0","--","main"]

gcr.io/dazwilkin-190402-55473323/roberson34@sha256:17cb45f1320e2fe04e0681310506f4c229896429192b0d1c2c8dc20ed54adb0d

gcloud credentials using wrong cluster

copy iconCopydownload iconDownload
PROJECT="$(gcloud projects describe \
    $(gcloud config get-value core/project -q) --format='get(projectNumber)')"

gcloud projects add-iam-policy-binding $PROJECT \
    --member=serviceAccount:$PROJECT@cloudbuild.gserviceaccount.com \
    --role=roles/container.developer

Shell script to ls and execute command on ls result

copy iconCopydownload iconDownload
for d in /home/user/data/*
do
rm -rf $d/content/*
python -m scripts.augmentation_keras --image_dir=$d --
 target_dir=$d/content --save_prefix=$(basename $d)
done

The proper way to store/load statics in Ember App

copy iconCopydownload iconDownload
import Ember from 'ember';
export default Ember.Service.extend({
  defaultHeaderModel:{},
  loadData(){
    var myServiceDataLoadPromise = Ember.RSVP.Promise.resolve({one:1});
    myServiceDataLoadPromise.then(result =>{
      this.set('defaultHeaderModel',result);
    });
    return myServiceDataLoadPromise;
  }
});
import Ember from 'ember';
export default Ember.Route.extend({
  myService: Ember.inject.service(),
  beforeModel()
  {
    return Ember.RSVP.all([this.get('myService').loadData()]);
  }    
});
import Ember from 'ember';
export default Ember.Controller.extend({
  myService: Ember.inject.service(),
  appName: 'Ember Twiddle'
});
{{myService.defaultHeaderModel.one}}
import Ember from 'ember';
export default Ember.Service.extend({
  defaultHeaderModel:{},
  loadData(){
    var myServiceDataLoadPromise = Ember.RSVP.Promise.resolve({one:1});
    myServiceDataLoadPromise.then(result =>{
      this.set('defaultHeaderModel',result);
    });
    return myServiceDataLoadPromise;
  }
});
import Ember from 'ember';
export default Ember.Route.extend({
  myService: Ember.inject.service(),
  beforeModel()
  {
    return Ember.RSVP.all([this.get('myService').loadData()]);
  }    
});
import Ember from 'ember';
export default Ember.Controller.extend({
  myService: Ember.inject.service(),
  appName: 'Ember Twiddle'
});
{{myService.defaultHeaderModel.one}}
import Ember from 'ember';
export default Ember.Service.extend({
  defaultHeaderModel:{},
  loadData(){
    var myServiceDataLoadPromise = Ember.RSVP.Promise.resolve({one:1});
    myServiceDataLoadPromise.then(result =>{
      this.set('defaultHeaderModel',result);
    });
    return myServiceDataLoadPromise;
  }
});
import Ember from 'ember';
export default Ember.Route.extend({
  myService: Ember.inject.service(),
  beforeModel()
  {
    return Ember.RSVP.all([this.get('myService').loadData()]);
  }    
});
import Ember from 'ember';
export default Ember.Controller.extend({
  myService: Ember.inject.service(),
  appName: 'Ember Twiddle'
});
{{myService.defaultHeaderModel.one}}
import Ember from 'ember';
export default Ember.Service.extend({
  defaultHeaderModel:{},
  loadData(){
    var myServiceDataLoadPromise = Ember.RSVP.Promise.resolve({one:1});
    myServiceDataLoadPromise.then(result =>{
      this.set('defaultHeaderModel',result);
    });
    return myServiceDataLoadPromise;
  }
});
import Ember from 'ember';
export default Ember.Route.extend({
  myService: Ember.inject.service(),
  beforeModel()
  {
    return Ember.RSVP.all([this.get('myService').loadData()]);
  }    
});
import Ember from 'ember';
export default Ember.Controller.extend({
  myService: Ember.inject.service(),
  appName: 'Ember Twiddle'
});
{{myService.defaultHeaderModel.one}}

Community Discussions

Trending Discussions on go-cloud
  • Go Stackdriver debugger error loading program
  • gcloud credentials using wrong cluster
  • Shell script to ls and execute command on ls result
  • The proper way to store/load statics in Ember App
Trending Discussions on go-cloud

QUESTION

Go Stackdriver debugger error loading program

Asked 2019-Apr-03 at 03:12

I am trying to set up Stackdriver debugging using Go. Using the article and this great medium post I came up with this solution.

Key parts, in cloudbuild.yaml

- name: gcr.io/cloud-builders/wget
  args: [
    "-O",
    "go-cloud-debug",
    "https://storage.googleapis.com/cloud-debugger/compute-go/go-cloud-debug"
  ]

...

Dockerfile I have

...

COPY gopath/bin/stackdriver-demo /stackdriver-demo

ADD go-cloud-debug /
ADD source-context.json /

CMD ["/go-cloud-debug","-sourcecontext=./source-context.json", "-appmodule=go-errrep","-appversion=1.0","--","/stackdriver-demo"]

...

However the pods keeps crashing, the container logs show this error:

Error loading program: decoding dwarf section info at offset 0x0: too short

EDIT: Using https://storage.googleapis.com/cloud-debugger/compute-go/go-cloud-debug may be outdated as I haven't seen it used outside Daz's medium post. The official docs uses the package cloud.google.com/go/cmd/go-cloud-debug-agent

I have update cloudbuild.yaml file to install this package:

- name: 'gcr.io/cloud-builders/go'
  args: ["get", "-u", "cloud.google.com/go/cmd/go-cloud-debug-agent"]
  env: ['PROJECT_ROOT=github.com/roberson34/stackdriver-demo', 'CGO_ENABLED=0', 'GOOS=linux']

- name: 'gcr.io/cloud-builders/go'
  args: ["install", "cloud.google.com/go/cmd/go-cloud-debug-agent"]
  env: ['PROJECT_ROOT=github.com/roberson34/stackdriver-demo', 'CGO_ENABLED=0', 'GOOS=linux']

And in the Dockerfile I can get access to the binary in gopath/bin/go-cloud-debug-agent

When I execute the gopath/bin/go-cloud-debug-agent with my own program as an argument:

/go-cloud-debug-agent -sourcecontext=./source-context.json -appmodule=go-errrep -appversion=1.0 -- /stackdriver-demo

I get another opaque error:

Error loading program: AttrStmtList not present or not int64 for unit 88

So basically using the cloud-debug binary from https://storage.googleapis.com/cloud-debugger/compute-go/go-cloud-debug and cloud-debug-agent binary from the package cloud.google.com/go/cmd/go-cloud-debug-agent both don't work and give different errors.

Would appreciate any tips on what I'm doing wrong and how to fix it.

ANSWER

Answered 2019-Apr-03 at 03:12

OK :-)

Yes, you should follow the current Stackdriver documentation, e.g. go-cloud-debug-agent

Unfortunately, there are now various issues with my post including a (currently broken) gcr.io/cloud-builders/kubectl for regions.

I think your issue pertains to your use of golang:alpine. Alpine uses musl rather than the glibc that you find on most other Linux distro's and so, you really must compile for Alpine to ensure your binaries reference the correct libc.

I'm able to get your solution working primarily by switching your Dockerfile to pull the Cloud Debug Agent while on Alpine and to compile your source on Alpine:

FROM golang:alpine

RUN apk add git
RUN go get -u cloud.google.com/go/cmd/go-cloud-debug-agent

ADD main.go src
RUN CGO_ENABLED=0 go build -gcflags=all='-N -l' src/main.go

ADD source-context.json /

CMD ["bin/go-cloud-debug-agent","-sourcecontext=/source-context.json", "-appmodule=stackdriver-demo","-appversion=1.0","--","main"]

I think that should get you beyond the errors that you documented and you should be able to deploy your container to Kubernetes.

I've made my version of your image publicly available (and will retain it for a few days for you):

gcr.io/dazwilkin-190402-55473323/roberson34@sha256:17cb45f1320e2fe04e0681310506f4c229896429192b0d1c2c8dc20ed54adb0d

You may wish to reference it (by that digest) in your deployment.yaml

NB For Error Reporting to be "interesting", your code needs to generate errors and, with your example, this is going to be challenging (usually a good thing). You may consider adding another errorful handler that always results in errors so that you may test the service.

Source https://stackoverflow.com/questions/55473323

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install go-cloud

The Go CDK builds at the latest stable release of Go. Previous Go versions may compile but are not supported.

Support

Documentation for the project lives primarily on https://gocloud.dev/, including tutorials. You can also browse Go package reference on pkg.go.dev.

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases
Explore Kits

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Consider Popular GCP Libraries
Try Top Libraries by google
Compare GCP Libraries with Highest Support
Compare GCP Libraries with Highest Quality
Compare GCP Libraries with Highest Security
Compare GCP Libraries with Permissive License
Compare GCP Libraries with Highest Reuse
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases
Explore Kits

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.