tokman

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package tokman implements an OAuth access token file manager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Renewer

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

Renewer is used to renew an access token file.

func Make

func Make(a *auth.Authenticator, path string, lifetime time.Duration) (Renewer, error)

Make makes an access token file and returns a Renewer for renewing the token.

func (Renewer) KeepNew

func (r Renewer) KeepNew(ctx context.Context)

KeepNew keeps the access token valid until the context is canceled. This function blocks until canceled.

func (Renewer) RenewOnce

func (r Renewer) RenewOnce(lifetime time.Duration) (*oauth2.Token, error)

RenewOnce renews the access token file once.

Jump to

Keyboard shortcuts

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