- learn go with tests: https://quii.gitbook.io/learn-go-with-tests/
- prometheus go client: https://prometheus.io/docs/guides/go-application/
- example of test for k8s client: https://github.com/profefe/kube-profefe/blob/master/pkg/kubeutil/kube_test.go
- brigade (k8s events): https://github.com/brigadecore/brigade
- structuring go applications: https://medium.com/@benbjohnson/structuring-applications-in-go-3b04be4ff091
- tests for admission webhooks: https://github.com/elithrar/admission-control/blob/master/admit_funcs_test.go
- node exporter prometheus logic: https://github.com/prometheus/node_exporter/blob/master/node_exporter.go
kubectl run -n example-node-helm --rm -it api-test --image=ubuntu -- /bin/bash
wget --debug --header="Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" --ca-certificate=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt -O - https://kubernetes.default.svc/api/v1/namespaces/example-node-helm/pods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vsphere_user="user" | |
vsphere_password="pass" | |
vsphere_host = "127.0.0.1:8989" | |
datacenter = "DC0" | |
cluster = "DC0_H0" | |
datastore = "datastore/LocalDS_0" | |
clustered_datastore = "" | |
network = "network/VM Network" | |
gateway = "192.168.1.1" | |
vm_folder = "vcsim-test-folder" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @jsx React.DOM | |
*/ | |
'use strict'; | |
var OverlayFactory = require('async-google-maps').BaseOverlayFactory, | |
React = require('react'); | |
module.exports = React.createClass({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var google = global.google; | |
module.exports = { | |
create: function (mapContainer, options) { | |
return new Promise(function (resolve) { | |
var mapInstance = new google.maps.Map(mapContainer, options); | |
google.maps.event.addListenerOnce(mapInstance, 'idle', function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var BaseOverlay = require('./base-overlay'); | |
module.exports = { | |
create: function (options) { | |
var overlayInstance = new BaseOverlay(options); | |
overlayInstance.setMap(options.map); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var google = global.google; | |
function positionOverlayByDimensions(projectedLatLng) { | |
var offsetHeight = this.el.offsetHeight, | |
offsetWidth = this.el.offsetWidth; | |
this.el.style.top = projectedLatLng.y - offsetHeight + 'px'; | |
this.el.style.left = projectedLatLng.x - Math.floor(offsetWidth / 2) + 'px'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BaseOverlay.prototype.onAdd = function () { | |
var panes = this.getPanes(); | |
panes.overlayLayer.appendChild(this.el); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function positionOverlayByDimensions(projectedLatLng) { | |
var offsetHeight = this.el.offsetHeight, | |
offsetWidth = this.el.offsetWidth; | |
this.el.style.top = projectedLatLng.y - offsetHeight + 'px'; | |
this.el.style.left = projectedLatLng.x - Math.floor(offsetWidth / 2) + 'px'; | |
} | |
BaseOverlay.prototype.draw = function () { | |
var projection = this.getProjection(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function BaseOverlay(options) { | |
var point = options.point; | |
this.el = options.el; | |
this.point = new google.maps.LatLng(point.lat, point.lng); | |
this.el.style.position = 'absolute'; | |
} | |
BaseOverlay.prototype = Object.create(google.maps.OverlayView.prototype); |
NewerOlder