https://github.com/srl-labs/ndk-greeter-go
Greeter is a demo app showing how to build NDK app with Go for SR Linux
https://github.com/srl-labs/ndk-greeter-go
ndk nokia srlinux
Last synced: 8 months ago
JSON representation
Greeter is a demo app showing how to build NDK app with Go for SR Linux
- Host: GitHub
- URL: https://github.com/srl-labs/ndk-greeter-go
- Owner: srl-labs
- License: bsd-3-clause
- Created: 2023-11-24T23:19:29.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-06T12:21:23.000Z (12 months ago)
- Last Synced: 2025-02-13T15:14:01.542Z (8 months ago)
- Topics: ndk, nokia, srlinux
- Language: Shell
- Homepage: https://learn.srlinux.dev/ndk/guide/dev/go/with-bond/
- Size: 104 KB
- Stars: 0
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Greeter App in Go
Greeter is a demo Go application demonstrating the key principles of creating applications powered by the SR Linux's [NetOps Development Kit](https://learn.srlinux.dev/ndk/). Check [learn.srlinux.dev](https://learn.srlinux.dev/ndk/guide/dev/go/) for a complete code walkthrough.
## Quickstart
Clone and enter the repository:
```bash
git clone https://github.com/srl-labs/ndk-greeter-go.git && \
cd ndk-greeter-go
```Build the application and deploy it to the lab:
```
./run.sh deploy-all
```Once the lab is deployed, the application is automatically onboarded to SR Linux.
Enter the SR Linux CLI:
```
ssh greeter
```Once entered into the SR Linux CLI, you can finde `/greeter` context available that contains the application's configuration and operational data.
Configure the desired name:
```
--{ + running }--[ ]--
A:greeter# enter candidate--{ + candidate shared default }--[ ]--
A:greeter# greeter name srlinux-user
```Commit the configuration:
```
--{ +* candidate shared default }--[ ]--
A:greeter# commit now
All changes have been committed. Leaving candidate mode.
```The application will now greet you when you list its operational state:
```
--{ + running }--[ ]--
A:greeter# info from state greeter
greeter {
name srlinux-user
greeting "👋 Hello srlinux-user, I was last booted at 2023-11-26T10:24:27.374Z"
}
```## Shell autocompletions
To get bash autocompletions for `./run.sh` functions:
```bash
source ./run.sh
```