resolver

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package resolver tries to provide the environment specific Git reference for the release source repository. This Git reference tells us which version of our service releases to consider, based on the environment Kayron is running in.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsReleaseNotFound

func IsReleaseNotFound(err error) bool
func Search(res Interface, env string) (string, error)

Search determines the Git ref to use for the given environment. Search will never return an empty ref, but instead resolve the SHA of the Git commit at HEAD of the default branch.

production    resolve the latest release tag

staging       resolve the latest commit sha of the default branch

testing       resolve the latest commit sha of the branch matching the test
              environment, if such a branch exists, otherwise fall back to
              the commit sha of the default branch

Types

type Config

type Config struct {
	Git *github.Client
	Own string
	Rep string
}

type Interface

type Interface interface {
	// Commit returns the most recent Git commit at the given ref for the
	// underlying Github repository.
	Commit(string) (string, error)

	// Latest returns the most recent Git tag for the latest release of the
	// underlying Github repository.
	Latest() (string, error)
}

Interface defines a network abstraction that we want to control in order to verify the business logic of resolver.Search during unit tests.

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

func New

func New(c Config) *Resolver

func (*Resolver) Commit

func (r *Resolver) Commit(ref string) (string, error)

func (*Resolver) Latest

func (r *Resolver) Latest() (string, error)

Jump to

Keyboard shortcuts

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