// Package appversion exposes build-time version information for the discovery service.
package appversion

import (
	"github.com/tech/sendico/pkg/version"
	vf "github.com/tech/sendico/pkg/version/factory"
)

// Build information. Populated at build-time.
var (
	Version   string
	Revision  string
	Branch    string
	BuildUser string
	BuildDate string
)

// Create returns a version printer populated with the compile-time build metadata.
func Create() version.Printer { //nolint:ireturn // factory returns interface by design
	info := version.Info{
		Program:   "Sendico Discovery Service",
		Revision:  Revision,
		Branch:    Branch,
		BuildUser: BuildUser,
		BuildDate: BuildDate,
		Version:   Version,
	}

	return vf.Create(&info)
}
