tokens

package
v3.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package tokens defines interface to access GitHub PATs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token struct {
	Value string
	ID    uint64
}

Token is used for GitHub token server RPC request/response.

type TokenAccessor

type TokenAccessor interface {
	Next() (uint64, string)
	Release(uint64)
}

TokenAccessor interface defines a `retrieve-once` data structure. Implementations of this interface must be thread-safe.

func MakeTokenAccessor

func MakeTokenAccessor() TokenAccessor

MakeTokenAccessor is a factory function of TokenAccessor.

type TokenOverRPC

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

TokenOverRPC is an RPC handler implementation for Golang RPCs.

func NewTokenOverRPC

func NewTokenOverRPC(client TokenAccessor) *TokenOverRPC

NewTokenOverRPC creates a new instance of TokenOverRPC.

func (*TokenOverRPC) Next

func (accessor *TokenOverRPC) Next(args struct{}, token *Token) error

Next requests for the next available GitHub token. Server blocks the call until a token becomes available.

func (*TokenOverRPC) Release

func (accessor *TokenOverRPC) Release(id uint64, reply *struct{}) error

Release inserts the token at `index` back into the token pool to be used by another client.

Directories

Path Synopsis
Package main implements the GitHub token server.
Package main implements the GitHub token server.

Jump to

Keyboard shortcuts

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