client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 23 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

Code generated generate_clients.go. DO NOT EDIT.

Index

Constants

View Source
const (
	TokenEnvName     = "FCO_APIV1_TOKEN"
	TokenFileEnvName = "FCO_APIV1_TOKEN_FILE"
	BaseURLEnvName   = "FCO_APIV1_URL"
)

Variables

This section is empty.

Functions

func IgnoreUnexported

func IgnoreUnexported() cmp.Option

Types

type Client

type Client interface {
	Apimvmv1() Apimvmv1
	Apiv1() Apiv1
}

func New

func New(config *DialConfig) (Client, error)

type ClientCall

type ClientCall struct {
	WantRequest  proto.Message
	WantResponse func() connect.AnyResponse
	WantError    *connect.Error
}

type DialConfig

type DialConfig struct {
	// BaseUrl points to the apiv1 url where the apiserver is reachable
	BaseURL string
	// Token to be used to talk to the apiserver, the string representation of the token.
	// If Token is specified, TokenFile cannot be specified.
	// It is possible to renew this token automatically, see TokenRenewal.
	Token string
	// Tokenfile path to a file containing the string representation of the token.
	// If Tokenfile is specified, Token cannot be specified.
	// Token renewal must be done from outside
	TokenFile string
	// Duration between token file re-reads, optional, defaults to 5min if not specified.
	TokenFileRereadDuration time.Duration

	// Optional client Interceptors
	Interceptors []connect.Interceptor

	UserAgent string
	// TokenRenewal defines if and how the token should be renewed
	TokenRenewal *TokenRenewal

	// Transport optional, can be used to configure how the http transport works.
	Transport http.RoundTripper

	Log *slog.Logger
	// contains filtered or unexported fields
}

DialConfig is the configuration to create a api-server connection

func (*DialConfig) HttpClient

func (d *DialConfig) HttpClient() *http.Client

type PersistTokenFn

type PersistTokenFn func(token string) error

func NewFilesystemTokenPersister

func NewFilesystemTokenPersister(tokenFile string) (PersistTokenFn, error)

type TestClientInterceptor

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

func NewTestInterceptor

func NewTestInterceptor(t *testing.T, calls []ClientCall) *TestClientInterceptor

func (*TestClientInterceptor) WrapStreamingClient

func (*TestClientInterceptor) WrapStreamingHandler

func (*TestClientInterceptor) WrapUnary

type TokenRenewal

type TokenRenewal struct {
	// PersistTokenFn is called to persist the newly fetched token
	// token will not be persisted if not specified
	PersistTokenFn PersistTokenFn
}

Jump to

Keyboard shortcuts

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