Sha256: 27bb093a8db42a32506d8356904796996c363cb5d8c1a1a821d10c5b67c8425d

Contents?: true

Size: 1.21 KB

Versions: 30

Compression:

Stored size: 1.21 KB

Contents

Jsonnet is a domain specific configuration language that helps you define JSON data.
http://jsonnet.org/

In hako, you can use Jsonnet format for defining applications.

# External variables
Jsonnet provide a way to refer external variables by `std.extVar(x)`.
http://jsonnet.org/docs/stdlib.html#ext_vars

## appId
`std.extVar('appId')` returns application id of the definition.

### Example
```
% cat awesome-app.jsonnet
{
  id: std.extVar('appId'),
}
% hako show-definition awesome-app.jsonnet
---
id: awesome-app
```

# Native functions
Jsonnet provide a way to refer native functions by `std.native(x)`.

## provide.$NAME
`std.native('provide.$NAME')` returns a function which returns a corresponding EnvProvider.

### Example
```
% cat awesome-app.env
username=eagletmt
% cat awesome-app.yml
password: hako
% cat awesome-app.jsonnet
local provideFromFile(name) = std.native('provide.file')(std.toString({ path: 'awesome-app.env' }), name);
local provideFromYaml(name) = std.native('provide.yaml')(std.toString({ path: 'awesome-app.yml' }), name);

{
  username: provideFromFile('username'),
  password: provideFromYaml('password'),
}
% hako show-definition --expand awesome-app.jsonnet
---
password: hako
username: eagletmt
```

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
hako-2.17.0 docs/jsonnet.md
hako-2.16.0 docs/jsonnet.md
hako-2.15.1 docs/jsonnet.md
hako-2.15.0 docs/jsonnet.md
hako-2.14.0 docs/jsonnet.md
hako-2.13.0 docs/jsonnet.md
hako-2.12.0 docs/jsonnet.md
hako-2.11.1 docs/jsonnet.md
hako-2.11.0 docs/jsonnet.md
hako-2.10.0 docs/jsonnet.md
hako-2.9.2 docs/jsonnet.md
hako-2.9.1 docs/jsonnet.md
hako-2.9.0 docs/jsonnet.md
hako-2.8.0 docs/jsonnet.md
hako-2.7.0 docs/jsonnet.md
hako-2.6.2 docs/jsonnet.md
hako-2.6.1 docs/jsonnet.md
hako-2.6.0 docs/jsonnet.md
hako-2.5.1 docs/jsonnet.md
hako-2.5.0 docs/jsonnet.md