Documentation
¶
Index ¶
- Variables
- type Client
- type Enclave
- type GroundTruth
- type LoadBalancer
- type Response
- type SecureClient
- func (s *SecureClient) AddHeader(requestID int64, key string, value string) error
- func (s *SecureClient) ExecuteRequest(requestID int64) (*Response, error)
- func (s *SecureClient) Get(url string, headers map[string]string) (*Response, error)
- func (s *SecureClient) GroundTruth() *GroundTruth
- func (s *SecureClient) HTTPClient() (*http.Client, error)
- func (s *SecureClient) InitGetRequest(url string) (int64, error)
- func (s *SecureClient) InitPostRequest(url string, body []byte) (int64, error)
- func (s *SecureClient) Post(url string, headers map[string]string, body []byte) (*Response, error)
- func (s *SecureClient) Verify() (*GroundTruth, error)
- type TLSBoundRoundTripper
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { *openai.Client // contains filtered or unexported fields }
Client wraps the OpenAI client to provide secure inference through Tinfoil
func NewClient ¶
func NewClient(openaiOpts ...option.RequestOption) (*Client, error)
NewClient creates a new secure OpenAI client using default parameters
func NewClientWithParams ¶
func NewClientWithParams(enclave, repo string, openaiOpts ...option.RequestOption) (*Client, error)
NewClientWithParams creates a new secure OpenAI client with explicit enclave and repo parameters
type GroundTruth ¶
GroundTruth represents the "known good" verified state of the enclave
type LoadBalancer ¶ added in v0.0.5
type LoadBalancer struct {
// contains filtered or unexported fields
}
func NewLoadBalancer ¶ added in v0.0.5
func NewLoadBalancer(enclaves []Enclave, openaiOpts ...option.RequestOption) (*LoadBalancer, error)
func (*LoadBalancer) NextClient ¶ added in v0.0.5
func (lb *LoadBalancer) NextClient() *Client
NextClient returns the next client in round robin fashion using atomic operations
type SecureClient ¶
type SecureClient struct {
// contains filtered or unexported fields
}
SecureClient provides a way to securely communicate with a verified enclave
func NewSecureClient ¶
func NewSecureClient() *SecureClient
NewSecureClient creates a new client for secure communications with the enclave using default parameters
func NewSecureClientWithParams ¶ added in v0.0.6
func NewSecureClientWithParams(enclave, repo string) *SecureClient
NewSecureClientWithParams creates a new client for secure communications with the enclave using custom parameters
func (*SecureClient) AddHeader ¶
func (s *SecureClient) AddHeader(requestID int64, key string, value string) error
AddHeader adds a header to a pending request
func (*SecureClient) ExecuteRequest ¶
func (s *SecureClient) ExecuteRequest(requestID int64) (*Response, error)
ExecuteRequest executes a pending request and returns the response
func (*SecureClient) GroundTruth ¶
func (s *SecureClient) GroundTruth() *GroundTruth
GroundTruth returns the last verified enclave state
func (*SecureClient) HTTPClient ¶
func (s *SecureClient) HTTPClient() (*http.Client, error)
HTTPClient returns an HTTP client that only accepts TLS connections to the verified enclave
func (*SecureClient) InitGetRequest ¶
func (s *SecureClient) InitGetRequest(url string) (int64, error)
InitGetRequest initializes a new GET request and returns a unique request ID
func (*SecureClient) InitPostRequest ¶
func (s *SecureClient) InitPostRequest(url string, body []byte) (int64, error)
InitPostRequest initializes a new POST request and returns a unique request ID
func (*SecureClient) Verify ¶
func (s *SecureClient) Verify() (*GroundTruth, error)
Verify fetches the latest verification information from GitHub and Sigstore and stores the ground truth results in the client