Documentation
¶
Index ¶
- Variables
- type API
- func (a *API) GetOpenapiJson(ctx context.Context, params openapi.GetOpenapiJsonRequestObject) (openapi.GetOpenapiJsonResponseObject, error)
- func (a API) GetProjectId(ctx context.Context, params openapi.GetProjectIdRequestObject) (openapi.GetProjectIdResponseObject, error)
- func (a API) GetProjectProjectIdClassificationTaskId(ctx context.Context, ...) (openapi.GetProjectProjectIdClassificationTaskIdResponseObject, error)
- func (a API) GetProjectProjectIdClassificationTaskLabelId(ctx context.Context, ...) (openapi.GetProjectProjectIdClassificationTaskLabelIdResponseObject, error)
- func (a *API) GetProjectProjectIdClassificationTasks(ctx context.Context, ...) (openapi.GetProjectProjectIdClassificationTasksResponseObject, error)
- func (a *API) GetProjectProjectIdPendingClassificationTasks(ctx context.Context, ...) (openapi.GetProjectProjectIdPendingClassificationTasksResponseObject, error)
- func (a *API) GetProjects(ctx context.Context, request openapi.GetProjectsRequestObject) (openapi.GetProjectsResponseObject, error)
- func (a API) PostProject(ctx context.Context, params openapi.PostProjectRequestObject) (openapi.PostProjectResponseObject, error)
- func (a API) PostProjectProjectIdClassificationTask(ctx context.Context, ...) (openapi.PostProjectProjectIdClassificationTaskResponseObject, error)
- func (a *API) PostProjectProjectIdClassificationTaskIdLabel(ctx context.Context, ...) (openapi.PostProjectProjectIdClassificationTaskIdLabelResponseObject, error)
- func (a API) PostProjectProjectIdClassificationTaskLabel(ctx context.Context, ...) (openapi.PostProjectProjectIdClassificationTaskLabelResponseObject, error)
- func (a *API) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type Option
Constants ¶
This section is empty.
Variables ¶
var ErrUnableToGetURL = errors.New("unable to get URL from context")
ErrUnableToGetURL is returned when the URL cannot be retrieved from the context.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API represents an API with a handler.
func New ¶
New creates a new instance of the API. It returns a pointer to the API and an error, if any.
func (*API) GetOpenapiJson ¶
func (a *API) GetOpenapiJson( ctx context.Context, params openapi.GetOpenapiJsonRequestObject, ) (openapi.GetOpenapiJsonResponseObject, error)
GetOpenapiJSON returns the OpenAPI schema as JSON.
func (API) GetProjectId ¶
func (a API) GetProjectId(ctx context.Context, params openapi.GetProjectIdRequestObject) (openapi.GetProjectIdResponseObject, error)
GetProjectId retrieves a project by its ID. It takes a context.Context and a GetProjectIdRequestObject as input parameters. It returns a GetProjectIdResponseObject and an error. The error will be non-nil if there was an error retrieving the project.
func (API) GetProjectProjectIdClassificationTaskId ¶
func (a API) GetProjectProjectIdClassificationTaskId( ctx context.Context, params openapi.GetProjectProjectIdClassificationTaskIdRequestObject, ) (openapi.GetProjectProjectIdClassificationTaskIdResponseObject, error)
GetProjectProjectIdClassificationTaskId retrieves a classification task by its ID for a specific project.
func (API) GetProjectProjectIdClassificationTaskLabelId ¶
func (a API) GetProjectProjectIdClassificationTaskLabelId( ctx context.Context, params openapi.GetProjectProjectIdClassificationTaskLabelIdRequestObject, ) (openapi.GetProjectProjectIdClassificationTaskLabelIdResponseObject, error)
GetProjectProjectIdClassificationTaskLabelId retrieves a classification task label by its ID for a specific project.
func (*API) GetProjectProjectIdClassificationTasks ¶
func (a *API) GetProjectProjectIdClassificationTasks( ctx context.Context, request openapi.GetProjectProjectIdClassificationTasksRequestObject, ) (openapi.GetProjectProjectIdClassificationTasksResponseObject, error)
GetProjectProjectIdClassificationTasks gets the project classification tasks for the given project, optionally filtered by whether they've been completed.
func (*API) GetProjectProjectIdPendingClassificationTasks ¶
func (a *API) GetProjectProjectIdPendingClassificationTasks( ctx context.Context, request openapi.GetProjectProjectIdPendingClassificationTasksRequestObject, ) (openapi.GetProjectProjectIdPendingClassificationTasksResponseObject, error)
GetProjectProjectIdPendingClassificationTasks gets the pending classification tasks for the given project.
func (*API) GetProjects ¶
func (a *API) GetProjects( ctx context.Context, request openapi.GetProjectsRequestObject, ) (openapi.GetProjectsResponseObject, error)
GetProjects retrieves a list of all projects.
func (API) PostProject ¶
func (a API) PostProject(ctx context.Context, params openapi.PostProjectRequestObject) (openapi.PostProjectResponseObject, error)
PostProject creates a new project in the database based on the provided parameters. It returns the created project details in the form of a PostProjectResponseObject. If an error occurs during project creation or retrieval, it returns an error.
func (API) PostProjectProjectIdClassificationTask ¶
func (a API) PostProjectProjectIdClassificationTask( ctx context.Context, params openapi.PostProjectProjectIdClassificationTaskRequestObject, ) (openapi.PostProjectProjectIdClassificationTaskResponseObject, error)
PostProjectProjectIdClassificationTask creates a new classification task for a specific project.
func (*API) PostProjectProjectIdClassificationTaskIdLabel ¶
func (a *API) PostProjectProjectIdClassificationTaskIdLabel( ctx context.Context, request openapi.PostProjectProjectIdClassificationTaskIdLabelRequestObject, ) (openapi.PostProjectProjectIdClassificationTaskIdLabelResponseObject, error)
PostProjectProjectIdClassificationTaskIdLabel allows a task to be labelled with the given task.
func (API) PostProjectProjectIdClassificationTaskLabel ¶
func (a API) PostProjectProjectIdClassificationTaskLabel( ctx context.Context, params openapi.PostProjectProjectIdClassificationTaskLabelRequestObject, ) (openapi.PostProjectProjectIdClassificationTaskLabelResponseObject, error)
PostProjectProjectIdClassificationTaskLabel is a function that handles the creation of a classification task label for a specific project. The function creates a classification task label in the database using the provided parameters and returns the created label. If an error occurs during the creation or retrieval of the label, an error is returned.
type Option ¶
type Option = func(a *API)
Option represents a function that can be used to configure an API instance.
func WithConfig ¶
WithConfig sets the configuration on the API.
func WithDatabase ¶
WithDatabase sets the database on the API.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package headers provides utilities for storing and retrieving HTTP headers from a context.
|
Package headers provides utilities for storing and retrieving HTTP headers from a context. |
Package origin provides utilities for determining the origin of a request.
|
Package origin provides utilities for determining the origin of a request. |
Package redirect provides utilities for redirecting requests depending upon the origin.
|
Package redirect provides utilities for redirecting requests depending upon the origin. |
Package URL allows for storing and retrieving request URL details in the strict server endpoints.
|
Package URL allows for storing and retrieving request URL details in the strict server endpoints. |