Documentation
¶
Index ¶
- Variables
- func MakeClient(envUI env_ui.Env, transport http.RoundTripper, repo *local_working_copy.Repo, ...) *client
- func MakeStdioListener() net.Listener
- func ReadErrorFromBody(response *http.Response) (err error)
- func ReadErrorFromBodyOnGreaterOrEqual(response *http.Response, status int) (err error)
- func ReadErrorFromBodyOnNot(response *http.Response, statuses ...int) (err error)
- type HTTPPort
- type KeySource
- type MethodPath
- type Request
- type Response
- type RoundTripperBufioHost
- type RoundTripperBufioWrappedSigner
- type RoundTripperHost
- type RoundTripperRetry
- type RoundTripperStdio
- type RoundTripperUnixSocket
- type Server
- func (server *Server) InitializeHTTP(config net.ListenConfig, port int) (httpPort HTTPPort, err error)
- func (server *Server) InitializeListener(network, address string) (listener net.Listener, err error)
- func (server *Server) InitializeUnixSocket(config net.ListenConfig, path string) (sock repo.UnixSocket, err error)
- func (server *Server) Serve(listener net.Listener) (err error)
- func (server *Server) ServeStdio()
- type StdioConn
- func (conn *StdioConn) Close() error
- func (conn *StdioConn) LocalAddr() net.Addr
- func (conn *StdioConn) Read(b []byte) (n int, err error)
- func (conn *StdioConn) RemoteAddr() net.Addr
- func (conn *StdioConn) SetDeadline(t time.Time) error
- func (conn *StdioConn) SetReadDeadline(t time.Time) error
- func (conn *StdioConn) SetWriteDeadline(t time.Time) error
- func (conn *StdioConn) Write(b []byte) (n int, err error)
- type StdioListener
- type UrlData
Constants ¶
This section is empty.
Variables ¶
var DefaultRoundTripper http.RoundTripper
Functions ¶
func MakeClient ¶
func MakeClient( envUI env_ui.Env, transport http.RoundTripper, repo *local_working_copy.Repo, typedBlobStore inventory_list_coders.Closet, ) *client
func MakeStdioListener ¶
func ReadErrorFromBody ¶
Types ¶
type KeySource ¶ added in v0.1.7
type KeySource interface {
GetPublicKey() mad_domain_interfaces.MarklId
GetPrivateKey() mad_domain_interfaces.MarklId
}
KeySource provides the keypair the signing middleware uses to authenticate requests and sign response trailers. Lifting the key access off the concrete *local_working_copy.Repo lets tests supply a fake source without standing up a real repo on disk.
type MethodPath ¶
type Request ¶
type Request struct {
MethodPath
Headers http.Header
Body io.ReadCloser
// contains filtered or unexported fields
}
type Response ¶
type Response struct {
StatusCode int
Body io.ReadCloser
// contains filtered or unexported fields
}
func (*Response) ErrorWithStatus ¶
type RoundTripperBufioHost ¶ added in v0.1.7
type RoundTripperBufioHost struct {
net.Conn
RoundTripperBufioWrappedSigner
}
RoundTripperBufioHost dials a remote host:port over TCP and runs requests through the embedded signer. Holds a single net.Conn for its lifetime and runs requests sequentially — no connection pooling.
func (*RoundTripperBufioHost) Initialize ¶ added in v0.1.7
func (roundTripper *RoundTripperBufioHost) Initialize( uri values.Uri, hashFormat mad_domain_interfaces.FormatHash, ) (err error)
type RoundTripperBufioWrappedSigner ¶
type RoundTripperBufioWrappedSigner struct {
PublicKey mad_domain_interfaces.MarklId
HashFormat mad_domain_interfaces.FormatHash
// contains filtered or unexported fields
}
type RoundTripperHost ¶
type RoundTripperHost struct {
UrlData
http.RoundTripper
}
A round tripper that decorates another round tripper and always populates the http requests with given UrlData template.
type RoundTripperRetry ¶
type RoundTripperRetry struct {
RetryFunc func(error) bool
RetryCount int
http.RoundTripper
}
func MakeRoundTripperRetry ¶
func MakeRoundTripperRetry( inner http.RoundTripper, count int, retryFunc func(error) bool, ) RoundTripperRetry
func MakeRoundTripperRetryTimeouts ¶
func MakeRoundTripperRetryTimeouts( inner http.RoundTripper, count int, ) RoundTripperRetry
type RoundTripperStdio ¶
type RoundTripperStdio struct {
exec.Cmd
io.WriteCloser
io.ReadCloser
RoundTripperBufioWrappedSigner
}
func (*RoundTripperStdio) InitializeWithLocal ¶
func (roundTripper *RoundTripperStdio) InitializeWithLocal( envRepo env_repo.Env, config store_config.Config, pubkey mad_domain_interfaces.MarklId, ) (err error)
func (*RoundTripperStdio) InitializeWithSSH ¶
func (roundTripper *RoundTripperStdio) InitializeWithSSH( envUI env_ui.Env, arg string, ) (err error)
type RoundTripperUnixSocket ¶
type RoundTripperUnixSocket struct {
repo.UnixSocket
net.Conn
RoundTripperBufioWrappedSigner
}
func (*RoundTripperUnixSocket) Initialize ¶
func (roundTripper *RoundTripperUnixSocket) Initialize( remote *Server, pubkey markl.Id, ) (err error)
TODO add public key
type Server ¶
type Server struct {
EnvLocal env_local.Env
Repo *local_working_copy.Repo
// KeySource overrides the default Repo-backed key source used by
// the signing middleware. Leave nil in production; tests inject
// an in-memory keypair so the sign/verify round trip can be
// exercised without standing up a real Repo on disk.
KeySource KeySource
GetCertificate func(*tls.ClientHelloInfo) (*tls.Certificate, error)
// contains filtered or unexported fields
}
func (*Server) InitializeHTTP ¶
func (*Server) InitializeListener ¶
func (server *Server) InitializeListener( network, address string, ) (listener net.Listener, err error)
TODO https://github.com/amarbel-llc/dodder/issues/27 Remove error return, use context cancellation
func (*Server) InitializeUnixSocket ¶
func (server *Server) InitializeUnixSocket( config net.ListenConfig, path string, ) (sock repo.UnixSocket, err error)
func (*Server) Serve ¶
TODO https://github.com/amarbel-llc/dodder/issues/27 Remove error return, use context cancellation
func (*Server) ServeStdio ¶
func (server *Server) ServeStdio()
type StdioConn ¶
type StdioConn struct {
// contains filtered or unexported fields
}
func (*StdioConn) RemoteAddr ¶
type StdioListener ¶
type StdioListener struct {
// contains filtered or unexported fields
}
func (*StdioListener) Addr ¶
func (listener *StdioListener) Addr() net.Addr
func (*StdioListener) Close ¶
func (listener *StdioListener) Close() error
Source Files
¶
- client.go
- client_blob_store.go
- client_closet.go
- client_inventory_list_store.go
- http_remote_object_store.go
- listener_stdio.go
- request_response.go
- round_tripper_bufio.go
- round_tripper_bufio_host.go
- round_tripper_host.go
- round_tripper_retry.go
- round_tripper_stdio.go
- round_tripper_unix_socket.go
- round_tripper_wrapped_signer.go
- server.go
- server_blob_cache.go
- server_key_source.go
- server_mcp.go
- server_working_copy.go