http

package
v0.0.0-...-6905244 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AuthError = errors.New("Authentication error")
)

Functions

func GetConsoleApiToken

func GetConsoleApiToken(console, port string) (string, error)

func IsConsoleAgent

func IsConsoleAgent(url string) bool

func NewInjectorTransport

func NewInjectorTransport[T AccessInjectorTransport | RefreshInjectorTransport](shared_header *ThreadSafeTokens, org *http.Transport) *T

func StartStreamingDelta

func StartStreamingDelta(ctx context.Context, cfg StreamingConfig,
	url, port, apiToken string,
	callback func(bool, []openapi.ModelNodeIdentifier),
	onErrorCallback func(error)) error

Types

type AccessInjectorTransport

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

func (*AccessInjectorTransport) RoundTrip

func (c *AccessInjectorTransport) RoundTrip(r *http.Request) (*http.Response, error)

type OpenapiHttpClient

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

func NewHttpsConsoleClient

func NewHttpsConsoleClient(url, port string) *OpenapiHttpClient

Client is not thread safe.

func (*OpenapiHttpClient) APITokenAuthenticate

func (cl *OpenapiHttpClient) APITokenAuthenticate(api_token string) error

func (*OpenapiHttpClient) Client

func (client *OpenapiHttpClient) Client() *openapi.APIClient

func (*OpenapiHttpClient) Close

func (ohc *OpenapiHttpClient) Close()

func (*OpenapiHttpClient) DumpTokens

func (cl *OpenapiHttpClient) DumpTokens() (access string, refresh string)

func (*OpenapiHttpClient) SetTokens

func (cl *OpenapiHttpClient) SetTokens(access string, refresh string)

type RefreshInjectorTransport

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

func (*RefreshInjectorTransport) RoundTrip

func (c *RefreshInjectorTransport) RoundTrip(r *http.Request) (*http.Response, error)

type StreamingConfig

type StreamingConfig struct {
	Addition    bool
	Deletion    bool
	EntityTypes []string //Supported types: Node, Container, ContainerImage
}

type ThreadSafeTokens

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

func NewThreadSafeTokens

func NewThreadSafeTokens() *ThreadSafeTokens

func (*ThreadSafeTokens) HasExpired

func (tst *ThreadSafeTokens) HasExpired() bool

Jump to

Keyboard shortcuts

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