greeter

package
v0.0.0-...-4a0130b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2023 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

--8<-- [start:pkg-greeter]

Index

Constants

View Source
const (
	AppName = "greeter"
)

--8<-- [start:pkg-greeter-const].

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Name  string
	AppID uint32

	// NDK Service clients
	SDKMgrServiceClient       ndk.SdkMgrServiceClient
	NotificationServiceClient ndk.SdkNotificationServiceClient
	TelemetryServiceClient    ndk.SdkMgrTelemetryServiceClient
	// contains filtered or unexported fields
}

App is the greeter application struct. --8<-- [start:app-struct].

func NewApp

func NewApp(ctx context.Context, logger *zerolog.Logger) *App

NewApp creates a new Greeter App instance and connects to NDK socket. It also creates the NDK service clients and registers the agent with NDK. --8<-- [start:new-app].

func (*App) Start

func (a *App) Start(ctx context.Context)

Start starts the application. --8<-- [start:app-start].

func (*App) StartConfigNotificationStream

func (a *App) StartConfigNotificationStream(ctx context.Context) chan *ndk.NotificationStreamResponse

StartConfigNotificationStream starts a notification stream for Config service notifications. --8<-- [start:start-cfg-notif-stream].

type CommitSeq

type CommitSeq struct {
	CommitSeq int `json:"commit_seq"`
}

type ConfigState

type ConfigState struct {
	// Name is the name to use in the greeting.
	Name string `json:"name,omitempty"`
	// Greeting is the greeting message to be displayed.
	Greeting string `json:"greeting,omitempty"`
}

ConfigState holds the application configuration and state. --8<-- [start:configstate-struct].

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL