token

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package token supplies Slurm authentication tokens to clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileProvider

type FileProvider struct {
	Path string
}

FileProvider opens and reads Path for every request.

func (FileProvider) Token

func (p FileProvider) Token(ctx context.Context) (string, error)

Token implements Provider.

type Provider

type Provider interface {
	Token(ctx context.Context) (string, error)
}

Provider returns the authentication token to add to a request. It is called for every request and must be safe for concurrent use.

func StaticProvider

func StaticProvider(token string) Provider

StaticProvider returns a provider that always supplies token.

type ProviderFunc

type ProviderFunc func(ctx context.Context) (string, error)

ProviderFunc adapts a function to a Provider.

func (ProviderFunc) Token

func (f ProviderFunc) Token(ctx context.Context) (string, error)

Token implements Provider.

Jump to

Keyboard shortcuts

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