Skip to content

alma-oss/fapplicationStatus

Repository files navigation

Application Status

NuGet NuGet Downloads Tests

Types for an common Application status representation.

Install

Add following into paket.references

Alma.ApplicationStatus

Use

First of all you need to implement your CurrentApplication class/type.

type CurrentApplication = {
    Instance: Instance
    Environment: Environment
    Dependencies: Dependencies
    ServiceStatus: ServiceStatus
    LoggerFactory: ILoggerFactory
    DockerImageVersion: DockerImageVersion
}

and Dependencies = {
    ConsentsRouter: ConsentsRouter
}

This type can either implement ApplicationStatusFeature interfaces right away or just in the createStatus function

let createStatus (currentApplication: CurrentApplication) =
    ApplicationStatus.create {
        new ApplicationStatusFeature.ICurrentApplication with
            member __.Instance = currentApplication.Instance
            member __.Environment = currentApplication.Environment

        interface ApplicationStatusFeature.IAssemblyInformation with
            member __.GitBranch = GitBranch AssemblyVersionInformation.AssemblyMetadata_gitbranch
            member __.GitCommit = GitCommit AssemblyVersionInformation.AssemblyMetadata_gitcommit
            member __.GitRepository = GitRepository.empty

        interface ApplicationStatusFeature.IDockerApplication with
            member __.DockerImageVersion = currentApplication.DockerImageVersion
    }

NOTE: You can implement as many interfaces as you can. You can skip the rest if you don't provide the functionality.

Release

  1. Increment version in ApplicationStatus.fsproj
  2. Update CHANGELOG.md
  3. Commit new version and tag it

Development

Requirements

Build

./build.sh build

Tests

./build.sh -t tests

About

Types for an common Application status representation used in LMC.

Resources

License

Stars

Watchers

Forks

Packages

No packages published