Documentation
¶
Index ¶
- func DefaultKeyPath(skabandAddr string) string
- func DialAndServe(ctx context.Context, hostURL, sessionID, clientPubKey string, ...) (err error)
- func LoadOrCreatePrivateKey(path string) (ed25519.PrivateKey, error)
- func LocalhostToDockerInternal(skabandURL string) (string, error)
- func Login(stdout io.Writer, privKey ed25519.PrivateKey, ...) (pubKey, apiURL, oaiModelName, apiKey string, err error)
- func NewSessionID() string
- func ValidateSessionID(sessionID string) bool
- type SkabandClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultKeyPath ¶
func DialAndServe ¶
func LoadOrCreatePrivateKey ¶
func LoadOrCreatePrivateKey(path string) (ed25519.PrivateKey, 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 ¶
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.
Click to show internal directories.
Click to hide internal directories.