skabandclient

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultKeyPath

func DefaultKeyPath(skabandAddr string) string

func DialAndServe

func DialAndServe(ctx context.Context, hostURL, sessionID, clientPubKey string, sessionSecret string, h http.Handler) (err error)

func LoadOrCreatePrivateKey

func LoadOrCreatePrivateKey(path string) (ed25519.PrivateKey, error)

func LocalhostToDockerInternal

func LocalhostToDockerInternal(skabandURL string) (string, error)

func Login

func Login(stdout io.Writer, privKey ed25519.PrivateKey, skabandAddr, sessionID, model string) (pubKey, apiURL, oaiModelName, apiKey string, err error)

Login connects to skaband and authenticates the user. If skabandAddr is empty, it returns the public key without contacting a server. It is the caller's responsibility to set the API URL and key in this case.

func NewSessionID

func NewSessionID() string

NewSessionID generates a new 10-byte random Session ID.

func ValidateSessionID

func ValidateSessionID(sessionID string) bool

Types

type SkabandClient

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

SkabandClient provides HTTP client functionality for skaband server

func NewSkabandClient

func NewSkabandClient(addr, publicKey string) *SkabandClient

NewSkabandClient creates a new skaband client

func (*SkabandClient) Addr

func (c *SkabandClient) Addr() string

Addr returns the skaband server address

func (*SkabandClient) DialAndServeLoop

func (c *SkabandClient) DialAndServeLoop(ctx context.Context, sessionID string, sessionSecret string, srv http.Handler, connectFn func(connected bool))

DialAndServeLoop is a redial loop around DialAndServe.

Jump to

Keyboard shortcuts

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