Documentation
¶
Overview ¶
Package client provides a docreader gRPC client and the shared TLS / token authentication helpers used by both the standalone Go SDK in this package and the internal docparser wrapper. Keep all auth/TLS construction here so the two call sites cannot drift on security defaults.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Logger = log.New(os.Stdout, "[DocReader] ", log.LstdFlags|log.Lmicroseconds)
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type AuthConfig struct {
TLSEnabled bool
CertFile string
KeyFile string
CAFile string
// ServerName overrides the SNI / certificate-host check on the client.
// When empty, the address passed to Dial is used by Go's TLS stack.
ServerName string
AuthToken string
}
AuthConfig holds the docreader gRPC client TLS / token configuration.
func LoadAuthConfigFromEnv ¶
func LoadAuthConfigFromEnv() *AuthConfig
LoadAuthConfigFromEnv reads docreader gRPC auth knobs from the process environment. The caller must pass the result to BuildDialOptions to apply them to a gRPC connection.
func (*AuthConfig) BuildDialOptions ¶
func (c *AuthConfig) BuildDialOptions(maxMsgSize int) ([]grpc.DialOption, error)
BuildDialOptions returns the gRPC DialOptions that apply the configured transport credentials and per-RPC token. Callers should append their own per-call options (load balancer, message size, etc.).
type Client ¶
type Client struct {
proto.DocReaderClient
// contains filtered or unexported fields
}
Client represents a DocReader service client.
func NewClientWithAuth ¶
func NewClientWithAuth(addr string, authConfig *AuthConfig) (*Client, error)
type ImageRefInfo ¶
ImageRefInfo represents an image reference from a converted document.
func GetImageRefsFromResponse ¶
func GetImageRefsFromResponse(resp *proto.ReadResponse) []ImageRefInfo
GetImageRefsFromResponse extracts image references from a ReadResponse.