auth

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: MIT Imports: 5 Imported by: 25

Documentation

Overview

Package auth is a set of functions for retrieving authentication tokens and authenticated hosts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultHost

func DefaultHost() (string, string)

DefaultHost retrieves an authenticated host and the source of host. The source can be either an environment variable or from the configuration file. Returns "github.com", "default" if no viable host is found.

func KnownHosts

func KnownHosts() []string

KnownHosts retrieves a list of hosts that have corresponding authentication tokens, either from environment variables or from the configuration file. Returns an empty string slice if no hosts are found.

func TokenForHost

func TokenForHost(host string) (string, string)

TokenForHost retrieves an authentication token and the source of that token for the specified host. The source can be either an environment variable or from the configuration file. Returns "", "default" if no applicable token is found.

Types

This section is empty.

Jump to

Keyboard shortcuts

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