Documentation ¶
Overview ¶
Package similapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router *gin.Engine, si ServerInterface) *gin.Engine
- func RegisterHandlersWithOptions(router *gin.Engine, si ServerInterface, options GinServerOptions) *gin.Engine
- type CreateFormatJSONRequestBody
- type CreateIndexJSONRequestBody
- type CreateIndexMultipartBody
- type CreateIndexMultipartRequestBody
- type CreateIndexRequest
- type CreatedAfter
- type CreatedBefore
- type Format
- type FormatId
- type FormatParam
- type Formats
- type GetIndexRecordsParams
- type GetIndexesParams
- type GinServerOptions
- type Index
- type IndexId
- type Indexes
- type Limit
- type MiddlewareFunc
- type PageId
- type PatchIndexRecordsJSONRequestBody
- type PatchRecordsRequest
- type PatchRecordsResult
- type PutIndexJSONRequestBody
- type Record
- type RecordsResult
- type SearchJSONRequestBody
- type SearchRecord
- type SearchRequest
- type SearchResult
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) CreateFormat(c *gin.Context)
- func (siw *ServerInterfaceWrapper) CreateIndex(c *gin.Context)
- func (siw *ServerInterfaceWrapper) DeleteFormat(c *gin.Context)
- func (siw *ServerInterfaceWrapper) DeleteIndex(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetFormat(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetFormats(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetIndex(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetIndexRecords(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetIndexes(c *gin.Context)
- func (siw *ServerInterfaceWrapper) PatchIndexRecords(c *gin.Context)
- func (siw *ServerInterfaceWrapper) Ping(c *gin.Context)
- func (siw *ServerInterfaceWrapper) PutIndex(c *gin.Context)
- func (siw *ServerInterfaceWrapper) Search(c *gin.Context)
- type StartIndexId
- type Tags
- type TagsParam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func RegisterHandlers ¶
func RegisterHandlers(router *gin.Engine, si ServerInterface) *gin.Engine
RegisterHandlers creates http.Handler with routing matching OpenAPI spec.
func RegisterHandlersWithOptions ¶
func RegisterHandlersWithOptions(router *gin.Engine, si ServerInterface, options GinServerOptions) *gin.Engine
RegisterHandlersWithOptions creates http.Handler with additional options
Types ¶
type CreateFormatJSONRequestBody ¶
type CreateFormatJSONRequestBody = Format
CreateFormatJSONRequestBody defines body for CreateFormat for application/json ContentType.
type CreateIndexJSONRequestBody ¶
type CreateIndexJSONRequestBody = CreateIndexRequest
CreateIndexJSONRequestBody defines body for CreateIndex for application/json ContentType.
type CreateIndexMultipartBody ¶
type CreateIndexMultipartBody struct { // File contains the binary data for the document of the specified format File *openapi_types.File `json:"file,omitempty"` // Meta The object describes a new index request. Meta *CreateIndexRequest `json:"meta,omitempty"` }
CreateIndexMultipartBody defines parameters for CreateIndex.
type CreateIndexMultipartRequestBody ¶
type CreateIndexMultipartRequestBody CreateIndexMultipartBody
CreateIndexMultipartRequestBody defines body for CreateIndex for multipart/form-data ContentType.
type CreateIndexRequest ¶
type CreateIndexRequest struct { // Document contains the binary data for the document of the specified format Document []byte `json:"document"` // Format the index format name Format string `json:"format"` // Id the new index identifier. It must not be more than 64 bytes long Id string `json:"id"` // Records the list of records that must be added to the new index. Records []Record `json:"records"` Tags Tags `json:"tags"` }
CreateIndexRequest The object describes a new index request.
type Format ¶
type Format struct { // Name The format name. It is used as the format identifier Name string `json:"name"` }
Format The object describes a data format.
type FormatParam ¶ added in v0.50.0
type FormatParam = string
FormatParam defines model for FormatParam.
type Formats ¶
type Formats struct { // Formats The list of all known formats Formats []Format `json:"formats"` }
Formats The object is used as response of contact objects query request.
type GetIndexRecordsParams ¶
type GetIndexRecordsParams struct { // PageId The pageId for the paging request PageId *PageId `form:"pageId,omitempty" json:"pageId,omitempty"` // Limit The limit defines the max number of objects returned per page. Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` }
GetIndexRecordsParams defines parameters for GetIndexRecords.
type GetIndexesParams ¶
type GetIndexesParams struct { // CreatedAfter start of time interval in which items are queried CreatedAfter *CreatedAfter `form:"createdAfter,omitempty" json:"createdAfter,omitempty"` // CreatedBefore end of time interval in which items are queried CreatedBefore *CreatedBefore `form:"createdBefore,omitempty" json:"createdBefore,omitempty"` // StartIndexId The indexId for the first record StartIndexId *StartIndexId `form:"startIndexId,omitempty" json:"startIndexId,omitempty"` Format *FormatParam `form:"format,omitempty" json:"format,omitempty"` Tags *TagsParam `form:"tags,omitempty" json:"tags,omitempty"` // Limit The limit defines the max number of objects returned per page. Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` }
GetIndexesParams defines parameters for GetIndexes.
type GinServerOptions ¶
type GinServerOptions struct { BaseURL string Middlewares []MiddlewareFunc ErrorHandler func(*gin.Context, error, int) }
GinServerOptions provides options for the Gin server.
type Index ¶
type Index struct { CreatedAt time.Time `json:"createdAt"` Format string `json:"format"` Id string `json:"id"` Tags Tags `json:"tags"` }
Index An index description
type Indexes ¶
type Indexes struct { // Indexes The list of indexes Indexes []Index `json:"indexes"` // NextPageId the index Id for the next page, if presents NextPageId *string `json:"nextPageId,omitempty"` // Total total number of indexes that match the initial criteria Total int `json:"total"` }
Indexes The object contains information about an index record.
type MiddlewareFunc ¶
type PatchIndexRecordsJSONRequestBody ¶
type PatchIndexRecordsJSONRequestBody = PatchRecordsRequest
PatchIndexRecordsJSONRequestBody defines body for PatchIndexRecords for application/json ContentType.
type PatchRecordsRequest ¶
type PatchRecordsRequest struct { DeleteRecords []Record `json:"deleteRecords"` Id string `json:"id"` UpsertRecords []Record `json:"upsertRecords"` }
PatchRecordsRequest defines model for PatchRecordsRequest.
type PatchRecordsResult ¶
PatchRecordsResult defines model for PatchRecordsResult.
type PutIndexJSONRequestBody ¶
type PutIndexJSONRequestBody = Index
PutIndexJSONRequestBody defines body for PutIndex for application/json ContentType.
type Record ¶
type Record struct { // Id the record identifier within the index. The value must be unique for the index and it is defined by the format parser. Id string `json:"id"` // Segment contains the searchable text for the record. Segment string `json:"segment"` // Vector contains the vector data for the record in the format basis. The format parser defines the basis and the field structure. Vector []byte `json:"vector"` }
Record The object contains information about an index record.
type RecordsResult ¶
type RecordsResult struct { NextPageId *string `json:"nextPageId,omitempty"` Records []Record `json:"records"` Total int `json:"total"` }
RecordsResult defines model for RecordsResult.
type SearchJSONRequestBody ¶
type SearchJSONRequestBody = SearchRequest
SearchJSONRequestBody defines body for Search for application/json ContentType.
type SearchRecord ¶ added in v0.50.0
type SearchRecord struct { IndexId string `json:"indexId"` // IndexRecord The object contains information about an index record. IndexRecord Record `json:"indexRecord"` MatchedKeywords []string `json:"matchedKeywords"` Score float32 `json:"score"` }
SearchRecord defines model for SearchRecord.
type SearchRequest ¶ added in v0.50.0
type SearchRequest struct { Distinct bool `json:"distinct"` IndexIDs []string `json:"indexIDs"` Limit int `json:"limit"` Offset int `json:"offset"` OrderByScore bool `json:"orderByScore"` PageId string `json:"pageId"` Tags Tags `json:"tags"` Text string `json:"text"` }
SearchRequest defines model for SearchRequest.
type SearchResult ¶ added in v0.50.0
type SearchResult struct { NextPageId *string `json:"nextPageId,omitempty"` Records []SearchRecord `json:"records"` Total int `json:"total"` }
SearchResult defines model for SearchResult.
type ServerInterface ¶
type ServerInterface interface { // Retreive all known formats // (GET /formats) GetFormats(c *gin.Context) // Create new format // (POST /formats) CreateFormat(c *gin.Context) // (DELETE /formats/{formatId}) DeleteFormat(c *gin.Context, formatId FormatId) // (GET /formats/{formatId}) GetFormat(c *gin.Context, formatId FormatId) // Retreive indexes // (GET /indexes) GetIndexes(c *gin.Context, params GetIndexesParams) // Create new index // (POST /indexes) CreateIndex(c *gin.Context) // (DELETE /indexes/{indexId}) DeleteIndex(c *gin.Context, indexId IndexId) // (GET /indexes/{indexId}) GetIndex(c *gin.Context, indexId IndexId) // (PUT /indexes/{indexId}) PutIndex(c *gin.Context, indexId IndexId) // (GET /indexes/{indexId}/records) GetIndexRecords(c *gin.Context, indexId IndexId, params GetIndexRecordsParams) // (PATCH /indexes/{indexId}/records) PatchIndexRecords(c *gin.Context, indexId IndexId) // (GET /ping) Ping(c *gin.Context) // (POST /search) Search(c *gin.Context) }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct { Handler ServerInterface HandlerMiddlewares []MiddlewareFunc ErrorHandler func(*gin.Context, error, int) }
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) CreateFormat ¶
func (siw *ServerInterfaceWrapper) CreateFormat(c *gin.Context)
CreateFormat operation middleware
func (*ServerInterfaceWrapper) CreateIndex ¶
func (siw *ServerInterfaceWrapper) CreateIndex(c *gin.Context)
CreateIndex operation middleware
func (*ServerInterfaceWrapper) DeleteFormat ¶
func (siw *ServerInterfaceWrapper) DeleteFormat(c *gin.Context)
DeleteFormat operation middleware
func (*ServerInterfaceWrapper) DeleteIndex ¶
func (siw *ServerInterfaceWrapper) DeleteIndex(c *gin.Context)
DeleteIndex operation middleware
func (*ServerInterfaceWrapper) GetFormat ¶
func (siw *ServerInterfaceWrapper) GetFormat(c *gin.Context)
GetFormat operation middleware
func (*ServerInterfaceWrapper) GetFormats ¶
func (siw *ServerInterfaceWrapper) GetFormats(c *gin.Context)
GetFormats operation middleware
func (*ServerInterfaceWrapper) GetIndex ¶
func (siw *ServerInterfaceWrapper) GetIndex(c *gin.Context)
GetIndex operation middleware
func (*ServerInterfaceWrapper) GetIndexRecords ¶
func (siw *ServerInterfaceWrapper) GetIndexRecords(c *gin.Context)
GetIndexRecords operation middleware
func (*ServerInterfaceWrapper) GetIndexes ¶
func (siw *ServerInterfaceWrapper) GetIndexes(c *gin.Context)
GetIndexes operation middleware
func (*ServerInterfaceWrapper) PatchIndexRecords ¶
func (siw *ServerInterfaceWrapper) PatchIndexRecords(c *gin.Context)
PatchIndexRecords operation middleware
func (*ServerInterfaceWrapper) Ping ¶
func (siw *ServerInterfaceWrapper) Ping(c *gin.Context)
Ping operation middleware
func (*ServerInterfaceWrapper) PutIndex ¶
func (siw *ServerInterfaceWrapper) PutIndex(c *gin.Context)
PutIndex operation middleware
func (*ServerInterfaceWrapper) Search ¶
func (siw *ServerInterfaceWrapper) Search(c *gin.Context)
Search operation middleware