agent

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package agent GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE

Index

Constants

View Source
const ENDPOINT_ROLE = "agent-registry"

Variables

This section is empty.

Functions

func WithContext

func WithContext(ctx context.Context, a *Agent) context.Context

Types

type AccessTokenOptionFunc

type AccessTokenOptionFunc = func(o *accessTokenOptions)

func AsRegistryEndpoint

func AsRegistryEndpoint(b bool) AccessTokenOptionFunc

type Agent

type Agent struct {
	Name     string `json:"name"`
	Endpoint string `json:"endpoint"`

	Token     string `json:"token,omitempty"`
	OtpKeyURL string `json:"otpKeyURL,omitempty"`

	Time   datatypes.Datetime `json:"time,omitempty"`
	Labels map[string]string  `json:"labels,omitempty"`
}

func FromContext

func FromContext(ctx context.Context) *Agent

func ParseAgentToken

func ParseAgentToken(token string, salt ...string) (*Agent, error)

func (*Agent) AuthRoundTripper

func (a *Agent) AuthRoundTripper() client.HttpTransport

func (*Agent) GenerateOtp

func (a *Agent) GenerateOtp() (string, time.Time, error)

func (*Agent) Qrcode

func (a *Agent) Qrcode() (image.Image, error)

func (Agent) RuntimeDoc

func (v Agent) RuntimeDoc(names ...string) ([]string, bool)

func (*Agent) ValidateOtp

func (a *Agent) ValidateOtp(passcode string, t time.Time) error

type Registry

type Registry interface {
	NewAccessToken(ctx context.Context, name string, optFns ...AccessTokenOptionFunc) (string, error)
	Validate(ctx context.Context, agent *Agent) error
}

func NewRegister

func NewRegister() Registry

Directories

Path Synopsis
Package remote GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE
Package remote GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE

Jump to

Keyboard shortcuts

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