Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## (next)

- Support if-none-match for the extension list endpoint

## v1.0.15

- Update alpine packages in Docker image to address CVEs
Expand Down
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
package main

import (
"time"

_ "github.com/KimMachineGun/automemlimit" // By default, it sets `GOMEMLIMIT` to 90% of cgroup's memory limit.
"github.com/rs/zerolog"
"github.com/steadybit/action-kit/go/action_kit_api/v2"
Expand All @@ -21,6 +23,8 @@ import (
"github.com/steadybit/extension-kit/extsignals"
)

var startedAt = time.Now().Format(time.RFC3339)

func main() {
// Most Steadybit extensions leverage zerolog. To encourage persistent logging setups across extensions,
// you may leverage the extlogging package to initialize zerolog. Among others, this package supports
Expand Down Expand Up @@ -48,13 +52,13 @@ func main() {

// This call registers a handler for the extension's root path. This is the path initially accessed
// by the Steadybit agent to obtain the extension's capabilities.
exthttp.RegisterHttpHandler("/", exthttp.GetterAsHandler(getExtensionList))

// This is a section you will most likely want to change: The registration of HTTP handlers
// for your extension. You might want to change these because the names do not fit, or because
// you do not have a need for all of them.
action_kit_sdk.RegisterAction(extdebug.NewDebugAction())

exthttp.RegisterHttpHandler("/", exthttp.IfNoneMatchHandler(func() string { return startedAt }, exthttp.GetterAsHandler(getExtensionList)))

//This will install a signal handlder, that will stop active actions when receiving a SIGURS1, SIGTERM or SIGINT
extsignals.ActivateSignalHandlers()

Expand Down
Loading