profile
viewpoint

jdbaldry/aws_tags_exporter 1

A Prometheus exporter to expose AWS tags as Prometheus metrics

departureboard-io/departureboard-io-datasource 0

Grafana datasource for departureboard.io

jdbaldry/ansible-grafana 0

Platform for analytics and monitoring

jdbaldry/ansible-node-exporter 0

Provision basic metrics exporter for prometheus monitoring tool

jdbaldry/ansible-prometheus 0

Deploy Prometheus monitoring system

jdbaldry/beats 0

:tropical_fish: Beats - Lightweight shippers for Elasticsearch & Logstash

jdbaldry/cortex 0

A multitenant, horizontally scalable Prometheus as a Service

jdbaldry/distributed-load-testing-using-kubernetes 0

Distributed load testing using Kubernetes on Google Container Engine

jdbaldry/dyn-python 0

Dyn SDK for Python

jdbaldry/etcd 0

Distributed reliable key-value store for the most critical data of a distributed system

delete branch departureboard-io/departureboard-io-datasource

delete branch : blog

delete time in 4 days

push eventdepartureboard-io/departureboard-io-datasource

jdb

commit sha 14a3cc4100faac0cfbfaed5c3a6a1c2e1bb35f46

add TODO

view details

push time in 7 days

push eventdepartureboard-io/departureboard-io-datasource

jdb

commit sha e9df0d9cc15c383e90aecd149e4a85847cbb894a

Update the blog

view details

push time in 7 days

push eventjdbaldry/quiz

jdb

commit sha fad624a4c590965c33410833b37ba6c471eff83c

Baldry Boys Quiz

view details

push time in 8 days

create barnchdepartureboard-io/departureboard-io-datasource

branch : blog

created branch time in 10 days

push eventdepartureboard-io/departureboard-io-datasource

jdb

commit sha bf4963f4f533e140c7dab15658ee6709cefa7bed

Fix typo

view details

push time in 10 days

push eventdepartureboard-io/departureboard-io-datasource

jdb

commit sha d9f4b4ad179b77a011a3f818402bf7eddf67d109

Remove nginject

view details

push time in 11 days

created tagdepartureboard-io/departureboard-io-datasource

tagv0.1.7

Grafana datasource for departureboard.io

created time in 11 days

push eventdepartureboard-io/departureboard-io-datasource

jdb

commit sha 6813149f21160d802ec6b4a452b914ffbc34c228

Add FakeClient fake for DepartureBoardIOClient interface

view details

jdb

commit sha 930dd29b2e48375623bb8c561b223e8a9e19cd81

Fix typo

view details

jdb

commit sha 6f5e95797a970582edaf7863c83ab710b28969a2

Move APIEndpoint and APIKey out of the departureboardio.Client struct to facilitate testing with a fake

view details

jdb

commit sha d0c3f75014f2e086c170ec6e539cac9b257f469b

Add some iffy unit tests to facilitate QueryData refactor

view details

jdb

commit sha d25b5175e51c60ab70cafece00af6b165153df0a

Refactor for testing

view details

push time in 11 days

PR opened grafana/grafana-plugin-sdk-go

Fix typos

What this PR does / why we need it: Fixes some minor typos the improve doc readability

+4 -4

0 comment

1 changed file

pr created time in 12 days

push eventjdbaldry/grafana-plugin-sdk-go

jdb

commit sha 4701420983cbe416f637c07da1a6c0a49c361dac

Fix typos

view details

push time in 12 days

fork jdbaldry/grafana-plugin-sdk-go

A Go SDK for building backend plugins for Grafana

fork in 12 days

push eventjdbaldry/nixpkgs

push time in 13 days

create barnchjdbaldry/nixpkgs

branch : jdbaldry

created branch time in 13 days

push eventjdbaldry/nixpkgs

jdb

commit sha db18650ddfb3cae14186e8de2d55fb7ed0547fcb

tanka: init at 0.10.0

view details

push time in 13 days

push eventdepartureboard-io/departureboard-io-datasource

jdb

commit sha 70f3f569880162c55f78d3ce1dc010189f3e8681

Update golangci-lint version

view details

jdb

commit sha f050df0d3658df9df9992dd3ff3154e6574f256f

Refactor calling point structures for better typing

view details

jdb

commit sha 7f84f3943f6f4e3828e23c356c8ab0882aa08808

Refactor board models for better typing

view details

jdb

commit sha 5908fed70667cc152d5ac304ecff933e82680ad3

Linting

view details

push time in 14 days

push eventdepartureboard-io/departureboard-io-datasource

jdb

commit sha 7760245dabda5f12f438f802750c5ed7f3a7e7f3

Use grafana timeRange to configure departureboard.io API requests

view details

push time in 16 days

created tagdepartureboard-io/departureboard-io-datasource

tagv0.1.6

Grafana datasource for departureboard.io

created time in 16 days

push eventdepartureboard-io/departureboard-io-datasource

Jack Baldry

commit sha bf04588e41f35938cf8c0e9e3f5dd4ffe8abc724

Update README.md

view details

push time in 16 days

issue commentgrafana/grafana

Support for future relative time ranges

Awesome! Thanks for the help :) Let me know if there's anything I can do to assist.

jdbaldry

comment created time in 16 days

issue commentgrafana/grafana

Support for future relative time ranges

Sorry for the lack of useful information on the original post.

  • I'm running Grafana v7.0.0-beta3 (2169fc1a3f)

Steps to reproduce:

  1. Create a new dashboard
  2. Enter an absolute time range of now -> now+1h in the time picker
  3. Set to refresh.every 10s

The dashboard refreshes every 10s but the time window displayed remains absolute.

Since playing around some more, I've managed to configure a relative future time range using the dashboard JSON but not through interaction with the time picker UI element.

jdbaldry

comment created time in 16 days

issue openedgrafana/grafana

Support for future relative time ranges

<!-- Please only use this template for submitting feature requests -->

What would you like to be added: The ability to configure a relative time range that extends into the future.

Why is this needed: Over the weekend, I put together a Grafana data source using the building a data source plugin tutorial (which is great by the way!). The data source I built uses the https://api.departureboard.io JSON API to draw a table of train schedule boards in Grafana. I was hoping to use the Grafana time picker to control how far into the future to request data (something like now -> now+1h) and use the auto-refresh functionality.

Though I haven't yet tested it, I believe I can use absolute time ranges for queries into the future but since they are absolute, they do not auto-refresh.

created time in 16 days

push eventdepartureboard-io/departureboard-io-datasource

jdb

commit sha 83c3dccc2d376a601da291655a4b07ee80d928be

Add limited support for service details

view details

jdb

commit sha 79798f762fbd3622af19c3fe7c6b5684cdf203cc

Add filterCRS option

view details

push time in 16 days

created tagdepartureboard-io/departureboard-io-datasource

tagv0.1.5

Grafana datasource for departureboard.io

created time in 16 days

created tagdepartureboard-io/departureboard-io-datasource

tagv0.1.4

Grafana datasource for departureboard.io

created time in 17 days

push eventdepartureboard-io/departureboard-io-datasource

jdb

commit sha fe94ecbe2ffda705319649fb11503f7e7b192219

Refactor to support arrivals and departures

view details

push time in 17 days

push eventdepartureboard-io/departureboard-io-datasource

jdb

commit sha 0d19fadf9045e49fa0944dbf715600d247a76f50

Set useful default API endpoint in configeditor

view details

jdb

commit sha 04340afdcd07373a0b50abf4aa5804ef18f90861

Add telemetry header to backend plugin requests

view details

push time in 18 days

created tagdepartureboard-io/departureboard-io-datasource

tagv0.1.2

Grafana datasource for departureboard.io

created time in 18 days

created tagdepartureboard-io/departureboard-io-datasource

tagv0.1.3

Grafana datasource for departureboard.io

created time in 18 days

push eventdepartureboard-io/departureboard-io-datasource

jdb

commit sha 1bc220f8846de450bb342b42497479c74e60da7a

Update README

view details

push time in 18 days

push eventdepartureboard-io/departureboard-io-datasource

jdb

commit sha 81b8a947fc285f78a36f11db8ebdf5e15e5e2fbc

Update dev image to beta3

view details

push time in 18 days

push eventdepartureboard-io/departureboard-io-datasource

jdb

commit sha d79f3cf2fe2224bbe9d97c6aaf6157db01af5823

Update logo

view details

push time in 18 days

created tagdepartureboard-io/departureboard-io-datasource

tagv0.1.1

Grafana datasource for departureboard.io

created time in 18 days

push eventdepartureboard-io/departureboard-io-datasource

jdb

commit sha 9113c020e2cf91049dce277ca70d14f2efab109a

Add license to package.json

view details

push time in 18 days

push eventdepartureboard-io/departureboard-io-datasource

jdb

commit sha b5c0dda7b504fdb79977222f9c753e30a67a1eba

Add proof of concept implementation

view details

jdb

commit sha b1b6c188640df7fbfdbec0032c313eeeea6cb795

Release v0.1.0

view details

push time in 18 days

create barnchdepartureboard-io/departureboard-io-datasource

branch : master

created branch time in 18 days

created repositorydepartureboard-io/departureboard-io-datasource

Grafana datasource for departureboard.io

created time in 18 days

PR opened NixOS/nixpkgs

vpn-slice: init at 0.14

As a NixOS beginner, I would appreciate any guidance on the following:

In order to work, vpn-slice edits the systems /etc/hosts file which is read-only by default on NixOS. As the changes are temporary (only needed during operation of the split tunnel), I was happy to add write permissions to the host file using environment.etc.hosts.mode = "0644"; as I feel like it wasn't against the spirit of declarative system configuration.

Would you recommend a different approach?

Motivation for this change

Python tool for convenient configuration of a split tunnel VPN

Things done

<!-- Please check what applies. Note that these are not hard requirements but merely serve as information for reviewers. -->

  • [x] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • [x] NixOS
    • [ ] macOS
    • [ ] other Linux distributions
  • [ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • [ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • [x] Tested execution of all binary files (usually in ./result/bin/)
  • [ ] Determined the impact on package closure size (by running nix path-info -S before and after)
  • [ ] Ensured that relevant documentation is up to date
  • [x] Fits CONTRIBUTING.md.
+33 -0

0 comment

3 changed files

pr created time in 19 days

push eventjdbaldry/nixpkgs

jdb

commit sha 7fc7c07413af765ba946d97595038d287699b192

vpn-slice: init at 0.14 Python tool for convenient configuration of a split tunnel VPN

view details

push time in 19 days

push eventjdbaldry/nixpkgs

jdb

commit sha 8fa96a5a929a6159426cbe228c3522d7a2122312

vpn-slice: init at 0.14 vpn-slice is a python tool for convenient configuration of a split tunnel VPN

view details

push time in 19 days

push eventjdbaldry/quiz

jdb

commit sha c529a8833bc6e2588a1300bf36a94771d29449ce

Use blood theme

view details

push time in 21 days

push eventjdbaldry/quiz

jdb

commit sha bcaa142fe17043ce64ea986e8c40c19aadbe8244

Baldry family quiz

view details

push time in 22 days

push eventjdbaldry/nixpkgs

jdb

commit sha 26b393f603cc0956a354d3ea36801b4b22ae6322

Add vpn-slice python tool for convenient configuration of a split tunnel VPN

view details

push time in 22 days

push eventjdbaldry/nixpkgs

jdb

commit sha e2eb9ee39e58ec2e73815b7de27c587f6aebb3b6

Add vpn-slice python tool for convenient configuration of a split tunnel VPN

view details

push time in 22 days

push eventjdbaldry/nixpkgs

jdb

commit sha 3e617eebcd0f912722fd4d1a8ee429a7473c9df4

Add vpn-slice python tool for convenient configuration of a split tunnel VPN

view details

push time in 22 days

push eventjdbaldry/nixpkgs

jdb

commit sha 3531800b90e349b4f682f0d091bc3fc732262b6c

Add vpn-slice python tool for convenient configuration of a split tunnel VPN

view details

push time in 22 days

fork jdbaldry/nixpkgs

Nix Packages collection

fork in 22 days

push eventjdbaldry/home

jdb

commit sha 73c7528c0f34f961aeb2ac1b6e524083da3d0e7f

Replace umatrix rules with full configuration

view details

jdb

commit sha 554486eb2c5507d0ddc46ec2cddeab0fb4a788d7

Add work markdown templates

view details

jdb

commit sha 01ed0ed5a8b908cae390f86bc2d27d8f8d38d30b

Configure system for steam Steam requires 32 bit libraries, erroring with 'glXChooseVisual' failed. https://nixos.wiki/wiki/Steam has more information for the configuration changes.

view details

jdb

commit sha e751f12069b65ddd0574688b98bde0748fea0cc0

Install more common system packages

view details

jdb

commit sha e7f48638f73250685ef44877af0f963068b16af2

Install vimium chromium extension

view details

push time in 24 days

push eventjdbaldry/home

jdb

commit sha 2396c75f018c0c9f529292697109af8ea4de5756

Add work markdown templates

view details

push time in 24 days

push eventjdbaldry/home

jdb

commit sha 0704727b5210c4d4766fa1d9d639ca7fc4b448e6

Add vscode extensions

view details

jdb

commit sha 4e5f8f7f0bcff0b53413ee5bfd04c30795945a01

Add install of chromium extensions and bash completion

view details

jdb

commit sha ef77997ee8e58b18c5d1092b60fd6e8dd98d7113

Clean up style

view details

jdb

commit sha 5cc9746331934d060b04c3f7602957d98e8ec3ba

Add umatrix rules

view details

jdb

commit sha fb608caf056dc673bff32670ab7f149b198c34e1

Replace umatrix rules with full configuration

view details

push time in 24 days

push eventjdbaldry/home

jdb

commit sha 50fb22715bd68cbb8fbaa5273521ea0ad80ee612

Add home specific vscode workspace settings

view details

push time in 24 days

push eventjdbaldry/home

jdb

commit sha 9d5718961c84b542ea39f0dcc529a0f5761bf36c

Fix fzf for NixOS

view details

jdb

commit sha c42b4a03dda8d883277bd8f172602cc64061c534

Add GIT_ROOT variable evaluated during prompt evaluation

view details

jdb

commit sha 3a5ac344d815bac4562e2b3b64b406852e2844aa

Use ~/.bashrc for setting PATH

view details

jdb

commit sha 44bd86725abb98040a2f2eda521e933a5adc52d2

Use rg for fzf if available

view details

push time in 24 days

push eventjdbaldry/quiz

jdb

commit sha 27cb2519a61c8f5e1bc8de16e6a9e88184f43525

Generate index.html from Jsonnet

view details

push time in 25 days

push eventjdbaldry/quiz

jdb

commit sha 8a014bd69129b9e08b584b26c854dab3153af869

Add aside

view details

push time in 25 days

push eventjdbaldry/quiz

Jack Baldry

commit sha a2deddf2d33f6fc44a16226d425118f3f6b67e05

Update CNAME

view details

push time in 25 days

push eventjdbaldry/quiz

Jack Baldry

commit sha ff6779fcd2ec87032667b2771915163e95e4c9c6

Update CNAME

view details

push time in 25 days

push eventjdbaldry/quiz

Jack Baldry

commit sha b5ed38c4dc3f29829e4ef6f89322866060186514

Update CNAME

view details

push time in 25 days

push eventjdbaldry/quiz

Jack Baldry

commit sha cd15d16152c8234569343dafb59896428eab9105

Create CNAME

view details

push time in 25 days

push eventjdbaldry/quiz

jdb

commit sha bdda471d81772a9bbcbb8440ff0fd203c07b5b71

Manually build markdown for now

view details

push time in 25 days

push eventjdbaldry/quiz

jdb

commit sha 39b8fefa1f4cbe3be57a179605eeb6bbd10a4d92

Use revealjs

view details

push time in 25 days

push eventjdbaldry/quiz

jdb

commit sha 48e0257515b7f87e75bd2e7632b1be8c63855c90

Generate slidy slides

view details

push time in 25 days

push eventjdbaldry/quiz

jdb

commit sha 828b99dbfdd76d20ab33f3c1f9261f6567acd03f

Use bootstrap stylesheet

view details

push time in a month

push eventjdbaldry/quiz

jdb

commit sha 36a829e044438d7e8edd631abed342b1ff336f5e

Add songs round

view details

jdb

commit sha aefbae6f2a538a2d2e4760100e85e0d321d59da0

WIP: fiddling with jsonnet

view details

jdb

commit sha 69fffde9b3d4648472b09e05ec53e9a2f033ad41

Build quiz using Jsonnet

view details

push time in a month

push eventjdbaldry/quiz

jdb

commit sha b59a02c559d60027494aa684c12a327183b62428

Update footer

view details

push time in a month

push eventjdbaldry/quiz

jdb

commit sha b383ccafba3c4bc092f22ad17dc97feb4ad33bca

Add General Knowledge round

view details

push time in a month

push eventjdbaldry/quiz

jdb

commit sha d96d3bedbc5844e7d7a91486d62ed3316b44d4a5

Add General Knowledge round

view details

push time in a month

push eventjdbaldry/quiz

jdb

commit sha fffa44ad70f0cf637638cbd2fcac84f66d07052b

Add General Knowledge round

view details

push time in a month

push eventjdbaldry/quiz

jdb

commit sha 8d0bd8643a7660e90f88fadc68b8cdc70d11db86

Add links for navigation

view details

push time in a month

push eventjdbaldry/quiz

jdb

commit sha 2ad2937cb0ee5ea37d6ae44e4ca0a1b31cb48bfe

Add palindromes round

view details

push time in a month

push eventjdbaldry/quiz

jdb

commit sha 3b572ceea8f5d9d20ef0da777dfa7d43aef82f53

Move questions to subdirectory

view details

jdb

commit sha 90ebd47256a9d81763404adbca617a57b5ffb43c

Add index page

view details

push time in a month

push eventjdbaldry/quiz

jdb

commit sha a55c1f5fb3ab43486fb530af3bdd98ade09a4eb8

Use headers for question numbers

view details

push time in a month

push eventjdbaldry/quiz

Jack Baldry

commit sha 2451ae0e4228a9e9e1ba758e962b89ea9451f0f9

Set theme jekyll-theme-cayman

view details

push time in a month

create barnchjdbaldry/jdbaldry

branch : master

created branch time in a month

created repositoryjdbaldry/jdbaldry

Temporary GitHub pages for family quiz.

created time in a month

push eventjdbaldry/home

jdb

commit sha ff09029ff4bd9312de4510f03efe0b28b50a1bf7

Add alacritty configuration

view details

jdb

commit sha 3d010a3108e2e7ff34ee1403ae7bef56c24afc74

Use JetBrains Mono font

view details

jdb

commit sha e9ce1a57ce23331fce84e09b9ef38495d54c9142

Use bool to suppress coercion warning

view details

push time in a month

push eventjdbaldry/home

jdb

commit sha 0ed85a2b97fa0d1345c918a1f4789c264dda924f

Install the correct Zoom package for video conferencing

view details

jdb

commit sha 3e1e9143b38da327e392290c8d7d21996b9a5879

Tee xcc output to the user TTY for better command feedback

view details

jdb

commit sha 1a0f6812b9aea8ed372a865967c4483808ab0790

Add nixos configuration

view details

jdb

commit sha 06d08e3b34a6b44ed68276f801c33c2a5eeca705

Move compton configuration into nixos

view details

jdb

commit sha d573108b08c4ff7052b78364b61a9014c3a0eea4

Clean up i3 config

view details

jdb

commit sha ac1046afefa5d9507bd79336e58a89b1f6878659

Remove unused packages.list

view details

jdb

commit sha 46572ceaf7e1f6a518de128090e0a426c0e69e43

Remove broken MANPATH

view details

jdb

commit sha 9d368abcf540eee2ab8fb76ed31a136b445c17a3

Clean up userPackages

view details

jdb

commit sha e0732069b3f83fcc1cf5f274c3ffa9a0b79828c1

Remove bash-my-aws as it is not used

view details

jdb

commit sha b97814eb610a6846f83d35631aaf3e22fd0df56c

Use powerline-go for prompt

view details

jdb

commit sha 60d473f6f8565a9bf774e3fcb93fbb2cdd0ba396

Use personal fork of powerline-go that ignores the kubernetes context namespace

view details

jdb

commit sha ecb052f04c8762e91ea978d7ab479ea9ecb4645d

Use powerline-go with yadm git support

view details

push time in a month

push eventjdbaldry/powerline-go

jdb

commit sha 21d2b69a10d29e09f0c836ac086b4cd689bd7fb3

Use "yadm" instead of "git" for home directory

view details

push time in a month

push eventjdbaldry/powerline-go

jdb

commit sha 731179742f730fc1b4ae5620ff8470d5ca11be70

Add flag to ignore Kubernetes context namespace

view details

push time in a month

fork jdbaldry/powerline-go

A beautiful and useful low-latency prompt for your shell, written in go

fork in a month

push eventjdbaldry/home

jdb

commit sha 633f388bc58772d645b64256d7434d2a561aef48

Add user config.nix

view details

jdb

commit sha 1bf4fd8c249b6ff8ad612e7691a41614ec0b24c1

Use system pinentry pacakge

view details

jdb

commit sha 939355f7e15fc3b8efc2b315de6e1534995f7643

Remove ANSI escape codes

view details

push time in a month

push eventjdbaldry/home

jdb

commit sha 26c4d51f9d3f0568fc998137788d926a64251aba

Remove PATH export that prepends ~/bin/ It should go in ~/bashrc.d/variables and it should append ~/bin/ not prepend it in order to work with NixOS.

view details

jdb

commit sha 9ce913b97bebbd47fcc68898e6b7c1df9da23c45

Remove oci cli completion

view details

push time in a month

push eventjdbaldry/home

jdb

commit sha a097cf21ef5d4fcf1fd214dd80a967896b5dc844

Add gpg-agent configuration to enable pinentry on nixos

view details

jdb

commit sha d81ed36411341ac03f7cd072b1a12b5f41e8a8c5

Fix kubectl and gopass completion for nixos

view details

push time in a month

push eventjdbaldry/home

jdb

commit sha c2c651a35a1dede8ce78104157c24501547f393a

Remove PATH variable that interferes with NixOS

view details

jdb

commit sha f443a0c89fa64581c31e8259a83be80a23ec03bc

Set general email to personal address

view details

jdb

commit sha 31d996cbeb19a02de7103f9cd4f9aa837aede4e6

Clean up ssh-agent function to work with NixOS PATHs

view details

push time in a month

push eventjdbaldry/home

jdb

commit sha ffb52fb7fa872c295b325066ae6b6da63788f646

Shellcheck cleanups

view details

push time in a month

push eventjdbaldry/home

jdb

commit sha 4474f2cffabc5a0c1a9feeaf178b1151ad58ab46

Switch to alacritty from st

view details

jdb

commit sha 177f6fc3908e1d2458d384f0fa2f978208886d00

Update aws autocomplete path broken by fedora upgrade

view details

jdb

commit sha 2d0e1b6b703b870b830aca2ac8ea3767e9f2e5e5

Add GIT_ROOT env variable evaluated every time the PS1 prompt is updated

view details

jdb

commit sha f60b18aeb6fe41ae9bc36426e46648a0f2524d75

Add jqc and xcc functions

view details

push time in a month

startedanguslees/kustomize-libsonnet

started time in a month

push eventjdbaldry/tanka

Jack Baldry

commit sha 3b6715e3d948bb0bff60bebe63ca654ef2b12aa6

Fix vendor patching example - use parentheses to evaluate the relative path, without which Jsonnet thinks the import is computed - fix the relative path to the vendored library

view details

push time in a month

PR opened grafana/tanka

Fix vendor patching example
  • use parentheses to evaluate the relative path, without which Jsonnet thinks the import is computed
  • fix the relative path to the vendored library
+1 -1

0 comment

1 changed file

pr created time in a month

startedmavam/abstract-algebra-cheatsheet

started time in a month

pull request commentgrafana/tanka

Update Native Functions documentation

Okay dokey :) thanks for taking the time to review this again. I'm more than happy with all the suggested changes and have committed them but let me know if there is anything else you would like added. I am really thankful for the Tanka tool and especially value how much time you have already put into useful (and pretty!) user friendly documentation.

jdbaldry

comment created time in 2 months

push eventjdbaldry/tanka

Jack Baldry

commit sha 93bc780013e1d7a13db02e4874b6896fa2c3d126

Update docs/docs/jsonnet/native-functions.md Co-Authored-By: sh0rez <me@shorez.de>

view details

push time in 2 months

Pull request review commentgrafana/tanka

Update Native Functions documentation

 menu: "Writing Jsonnet"  # Native Functions -Tanka extends the Jsonnet standard library with some common helper utilities.+Tanka extends Jsonnet using _native functions_, offering additional functionality not yet available in the standard library. -## parseJSON+To use them in your code, you need to access them using `std.native` from the standard library:++```jsonnet+{+  deployment:  std.native('<name>')('<arguments>'),

Good catch

jdbaldry

comment created time in 2 months

push eventjdbaldry/tanka

Jack Baldry

commit sha a31f22c913f102974ab1c6a061c850ac2747a9da

Update docs/docs/jsonnet/native-functions.md Co-Authored-By: sh0rez <me@shorez.de>

view details

push time in 2 months

Pull request review commentgrafana/tanka

Update Native Functions documentation

 menu: "Writing Jsonnet"  # Native Functions -Tanka extends the Jsonnet standard library with some common helper utilities.+Tanka extends Jsonnet using _native functions_, offering additional functionality not yet available in the standard library. -## parseJSON+To use them in your code, you need to access them using `std.native` from the standard library:++```jsonnet+{+  deployment:  std.native('<name>')('<arguments>'),+}+```++`std.native` takes the native function's name as a `string` argument and returns a `function`, which is called using the second set of parentheses.++## parseJson++### Signature  ```ts parseJSON(string json) Object ``` -`parseJSON` wraps `json.Unmarshal` to convert a json string into a dict+`parseJSON` wraps `json.Unmarshal` to convert a json string into a dict.

Agreed

jdbaldry

comment created time in 2 months

push eventjdbaldry/tanka

Jack Baldry

commit sha f5a4c68c85fd277fd2afbff6e97e921d6cd2df95

Update docs/docs/jsonnet/native-functions.md Co-Authored-By: sh0rez <me@shorez.de>

view details

push time in 2 months

push eventjdbaldry/tanka

Jack Baldry

commit sha 42761c94d5e85470a475ca64d900ad0b2e6d27eb

Update docs/docs/jsonnet/native-functions.md Co-Authored-By: sh0rez <me@shorez.de>

view details

push time in 2 months

push eventjdbaldry/tanka

jdb

commit sha 4721595d668ee0cf89344139413a2d370ac3000d

Replace documentation of Go functions with documentation of Jsonnet functions Aimed at new users of Tanka or Jsonnet, so this page tries not to assume more knowledge than explained in the previous Jsonnet docs. Documents: - what a native function is - how to use native functions in Jsonnet code - usage and examples of Tanka native functions

view details

push time in 2 months

Pull request review commentgrafana/tanka

Update Native Functions documentation

 menu: "Writing Jsonnet"  # Native Functions -Tanka extends the Jsonnet standard library with some common helper utilities.+Native functions are Jsonnet functions implemented in Go rather than Jsonnet itself. Tanka extends the Jsonnet native functions with some common helper utilities. -## parseJSON+To use a native function in your Jsonnet code, you need to use the `native` function from the Jsonnet standard library. For example, to parse a Kubernetes deployment YAML file into a Jsonnet object: -```ts-parseJSON(string json) Object+```jsonnet+{+  deployment:  std.native('parseYaml')(importstr 'deployment.yaml'),+} ``` -`parseJSON` wraps `json.Unmarshal` to convert a json string into a dict+The argument to `std.native` is the name of the native function to lookup. In this case, it is `parseYaml`. The returned function is then evaluated with the arguments in the second set of parentheses. This is the `deployment.yaml` file imported as a string using the Jsonnet keyword `importstr`. -## parseYAML+## parseJson -```ts-parseYAML(string yaml) []Object+### Usage++```jsonnet+std.native('parseJson')(json)+```++`parseJson` parses a JSON string and returns the JSON element.++### Examples++```jsonnet+{+  parseJsonArray: std.native('parseJson')('[0, 1, 2]'),+  parseJsonObject: std.native('parseJson')('{ "foo": "bar" }'),+}+```++Evaluating with Tanka results in the JSON:++```json+{+  "parseJsonArray": [0, 1, 2],+  "parseJsonObject": {+    "foo": "bar"+  }+}+```++## parseYaml++### Usage++```jsonnet+std.native('parseYaml')(yaml)+```++`parseYaml` parses a string of YAML document(s) and returns an array of JSON objects. If `yaml` contains only a single document, a single value array will be returned.++### Examples++```jsonnet+{+  parseYaml: std.native('parseYaml')(|||

That's true, and your suggestion for the renames will make that a lot clearer and understandable for sure.

jdbaldry

comment created time in 2 months

Pull request review commentgrafana/tanka

Update Native Functions documentation

 menu: "Writing Jsonnet"  # Native Functions -Tanka extends the Jsonnet standard library with some common helper utilities.+Native functions are Jsonnet functions implemented in Go rather than Jsonnet itself. Tanka extends the Jsonnet native functions with some common helper utilities. -## parseJSON+To use a native function in your Jsonnet code, you need to use the `native` function from the Jsonnet standard library. For example, to parse a Kubernetes deployment YAML file into a Jsonnet object: -```ts-parseJSON(string json) Object+```jsonnet+{+  deployment:  std.native('parseYaml')(importstr 'deployment.yaml'),+} ``` -`parseJSON` wraps `json.Unmarshal` to convert a json string into a dict+The argument to `std.native` is the name of the native function to lookup. In this case, it is `parseYaml`. The returned function is then evaluated with the arguments in the second set of parentheses. This is the `deployment.yaml` file imported as a string using the Jsonnet keyword `importstr`. -## parseYAML+## parseJson -```ts-parseYAML(string yaml) []Object+### Usage++```jsonnet+std.native('parseJson')(json)

That's true, I did hesitate when replacing the signature with the usage because losing the typing did make the native functions arguments less clear and the workaround of mentioning the types in the subsequent comment felt a bit clunky. Like in the regexSubst comment:

regexSubst` replaces all matches of the re2 regular expression `regex` in the `src` string with the `repl` string.

I'll make the switch back to Signature and revert the associated comments too.

jdbaldry

comment created time in 2 months

push eventjdbaldry/tanka

Jack Baldry

commit sha ff58a4fcaf0a276309716212dd01d7ee822b12d4

Update docs/docs/jsonnet/native-functions.md Co-Authored-By: sh0rez <me@shorez.de>

view details

push time in 2 months

more