Documentation ¶
Index ¶
- type Connection
- func (con *Connection) RunREST(ctx context.Context, path string, restMethod string, requestBody interface{}) (*ResponseData, error)
- func (con *Connection) RunRESTExternal(ctx context.Context, hostAndPath string, restMethod string, ...) (*ResponseData, error)
- func (con *Connection) WaitForWeaviate(startupTimeout time.Duration) error
- type GrpcClient
- type ResponseData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection networking layer accessing weaviate using http requests
func NewConnection ¶
func NewConnection(scheme string, host string, httpClient *http.Client, headers map[string]string) *Connection
NewConnection based on scheme://host if httpClient is nil a default client will be used
func (*Connection) RunREST ¶
func (con *Connection) RunREST(ctx context.Context, path string, restMethod string, requestBody interface{}, ) (*ResponseData, error)
RunREST executes a http request path: expects a resource path e.g. `/schema/things` restMethod: as they are defined in constants in the *http* package Returns:
a response that may be parsed into a struct after the fact error if there was a network issue
func (*Connection) RunRESTExternal ¶
func (con *Connection) RunRESTExternal(ctx context.Context, hostAndPath string, restMethod string, requestBody interface{}) (*ResponseData, error)
func (*Connection) WaitForWeaviate ¶
func (con *Connection) WaitForWeaviate(startupTimeout time.Duration) error
WaitForWeaviate waits until weaviate is started up and ready
type GrpcClient ¶
type GrpcClient struct {
// contains filtered or unexported fields
}
func NewGrpcClient ¶
func NewGrpcClient(host string, secured bool, headers map[string]string, gRPCVersionSupport *db.GRPCVersionSupport, ) (*GrpcClient, error)
func (*GrpcClient) BatchObjects ¶
func (c *GrpcClient) BatchObjects(ctx context.Context, objects []*models.Object, consistencyLevel string, ) ([]models.ObjectsGetResponse, error)
type ResponseData ¶
ResponseData encapsulation of the http request body and status
func (*ResponseData) DecodeBodyIntoTarget ¶
func (rd *ResponseData) DecodeBodyIntoTarget(target interface{}) error
DecodeBodyIntoTarget unmarshall body into target var successful if err is nil
Click to show internal directories.
Click to hide internal directories.