dto

package
v0.0.0-...-adf2868 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package dto provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0 DO NOT EDIT.

Index

Constants

View Source
const (
	AccessTokenScopes = "AccessToken.Scopes"
)

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

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 Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

Types

type ApiError

type ApiError struct {
	// ErrorCode Error unique code
	ErrorCode int `json:"error_code"`

	// ErrorMessage Error description
	ErrorMessage string `json:"error_message"`
}

ApiError defines model for ApiError.

type AuthRefreshTokenParams

type AuthRefreshTokenParams struct {
	XLLMCheckerRefreshToken RefreshToken `json:"X-LLM-Checker-Refresh-Token"`
}

AuthRefreshTokenParams defines parameters for AuthRefreshToken.

type AuthSignInJSONRequestBody

type AuthSignInJSONRequestBody = SignInRequest

AuthSignInJSONRequestBody defines body for AuthSignIn for application/json ContentType.

type AuthSignUpJSONRequestBody

type AuthSignUpJSONRequestBody = SignUpRequest

AuthSignUpJSONRequestBody defines body for AuthSignUp for application/json ContentType.

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL          string
	BaseRouter       chi.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type CreateTestQuestionAnswerPayload

type CreateTestQuestionAnswerPayload struct {
	// IsCorrect Is answer correct
	IsCorrect bool `json:"is_correct"`

	// Number Answer number in the list
	Number int `json:"number"`

	// Text Answer text
	Text string `json:"text"`
}

CreateTestQuestionAnswerPayload defines model for CreateTestQuestionAnswerPayload.

type CreateTestQuestionPayload

type CreateTestQuestionPayload struct {
	// Answers Question answers
	Answers []CreateTestQuestionAnswerPayload `json:"answers"`

	// Number Question number in the list
	Number int `json:"number"`

	// Text Question text
	Text string `json:"text"`
}

CreateTestQuestionPayload defines model for CreateTestQuestionPayload.

type CreateTestRequest

type CreateTestRequest struct {
	// Description Test description
	Description *string `json:"description,omitempty"`

	// Name Test unique name
	Name string `json:"name"`

	// Questions Test questions
	Questions []CreateTestQuestionPayload `json:"questions"`
}

CreateTestRequest defines model for CreateTestRequest.

type GetLLMCheckResultLLMAnswer

type GetLLMCheckResultLLMAnswer struct {
	// QuestionNumber Question number in test
	QuestionNumber int `json:"question_number"`

	// SelectedAnswerNumber LLM selected answer number in questions list
	SelectedAnswerNumber int `json:"selected_answer_number"`
}

GetLLMCheckResultLLMAnswer defines model for GetLLMCheckResultLLMAnswer.

type GetLLMCheckResultResponse

type GetLLMCheckResultResponse struct {
	// Results Results of all LLM analyses
	Results []GetLLMCheckResultValue `json:"results"`
}

GetLLMCheckResultResponse defines model for GetLLMCheckResultResponse.

type GetLLMCheckResultValue

type GetLLMCheckResultValue struct {
	// Answers LLM answers of the test questions
	Answers []GetLLMCheckResultLLMAnswer `json:"answers"`

	// LlmSlug Large language model unique name
	LlmSlug string `json:"llm_slug"`
}

GetLLMCheckResultValue defines model for GetLLMCheckResultValue.

type GetLLMCheckStatusResponse

type GetLLMCheckStatusResponse struct {
	// Statuses Statuses of all LLM analyses
	Statuses []GetLLMCheckStatusValue `json:"statuses"`
}

GetLLMCheckStatusResponse defines model for GetLLMCheckStatusResponse.

type GetLLMCheckStatusValue

type GetLLMCheckStatusValue struct {
	// LlmSlug Large language model unique name
	LlmSlug string `json:"llm_slug"`

	// Status LLM analysis status
	Status GetLLMCheckStatusValueStatus `json:"status"`
}

GetLLMCheckStatusValue defines model for GetLLMCheckStatusValue.

type GetLLMCheckStatusValueStatus

type GetLLMCheckStatusValueStatus string

GetLLMCheckStatusValueStatus LLM analysis status

const (
	COMPLETED  GetLLMCheckStatusValueStatus = "COMPLETED"
	ERROR      GetLLMCheckStatusValueStatus = "ERROR"
	INPROGRESS GetLLMCheckStatusValueStatus = "IN_PROGRESS"
	NOTSTARTED GetLLMCheckStatusValueStatus = "NOT_STARTED"
	UNDEFINED  GetLLMCheckStatusValueStatus = "UNDEFINED"
)

Defines values for GetLLMCheckStatusValueStatus.

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type LaunchLLMCheckRequest

type LaunchLLMCheckRequest struct {
	// LlmSlug Large language model unique name
	LlmSlug LaunchLLMCheckRequestLlmSlug `json:"llm_slug"`
}

LaunchLLMCheckRequest defines model for LaunchLLMCheckRequest.

type LaunchLLMCheckRequestLlmSlug

type LaunchLLMCheckRequestLlmSlug string

LaunchLLMCheckRequestLlmSlug Large language model unique name

const (
	Dummy    LaunchLLMCheckRequestLlmSlug = "dummy"
	Gigachat LaunchLLMCheckRequestLlmSlug = "gigachat"
	Gpt4     LaunchLLMCheckRequestLlmSlug = "gpt4"
)

Defines values for LaunchLLMCheckRequestLlmSlug.

type LaunchLLMCheckResponse

type LaunchLLMCheckResponse struct {
	// LaunchIdentifier Launch identifier UUID v4
	LaunchIdentifier openapi_types.UUID `json:"launch_identifier"`
}

LaunchLLMCheckResponse defines model for LaunchLLMCheckResponse.

type LlmLaunchJSONRequestBody

type LlmLaunchJSONRequestBody = LaunchLLMCheckRequest

LlmLaunchJSONRequestBody defines body for LlmLaunch for application/json ContentType.

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type QuestionAnswer

type QuestionAnswer struct {
	// IsCorrect Is answer correct
	IsCorrect bool `json:"is_correct"`

	// Number Answer number in the list
	Number int `json:"number"`

	// Text Answer text
	Text string `json:"text"`
}

QuestionAnswer defines model for QuestionAnswer.

type RefreshToken

type RefreshToken = string

RefreshToken defines model for RefreshToken.

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type ServerInterface

type ServerInterface interface {
	// Updating system access token using refresh token
	// (POST /api/v1/auth/refresh-token)
	AuthRefreshToken(w http.ResponseWriter, r *http.Request, params AuthRefreshTokenParams)
	// User login to the system with login and password
	// (POST /api/v1/auth/sign-in)
	AuthSignIn(w http.ResponseWriter, r *http.Request)
	// User registration in the system
	// (POST /api/v1/auth/sign-up)
	AuthSignUp(w http.ResponseWriter, r *http.Request)
	// Creating a new test
	// (PUT /api/v1/test/create)
	TestCreate(w http.ResponseWriter, r *http.Request)
	// Deleting an existing test
	// (DELETE /api/v1/test/{testId}/delete)
	TestDelete(w http.ResponseWriter, r *http.Request, testId TestId)
	// Getting complete information of a specific test
	// (GET /api/v1/test/{testId}/get)
	TestById(w http.ResponseWriter, r *http.Request, testId TestId)
	// Launching test analysis using a generative language model
	// (POST /api/v1/test/{testId}/llm/launch)
	LlmLaunch(w http.ResponseWriter, r *http.Request, testId TestId)
	// Getting all the test analysis results
	// (GET /api/v1/test/{testId}/llm/result)
	LlmResult(w http.ResponseWriter, r *http.Request, testId TestId)
	// Getting the current status of test analysis
	// (GET /api/v1/test/{testId}/llm/status)
	LlmStatus(w http.ResponseWriter, r *http.Request, testId TestId)
	// Getting "my" created tests
	// (GET /api/v1/tests/my)
	TestsMy(w http.ResponseWriter, r *http.Request, params TestsMyParams)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) AuthRefreshToken

func (siw *ServerInterfaceWrapper) AuthRefreshToken(w http.ResponseWriter, r *http.Request)

AuthRefreshToken operation middleware

func (*ServerInterfaceWrapper) AuthSignIn

func (siw *ServerInterfaceWrapper) AuthSignIn(w http.ResponseWriter, r *http.Request)

AuthSignIn operation middleware

func (*ServerInterfaceWrapper) AuthSignUp

func (siw *ServerInterfaceWrapper) AuthSignUp(w http.ResponseWriter, r *http.Request)

AuthSignUp operation middleware

func (*ServerInterfaceWrapper) LlmLaunch

func (siw *ServerInterfaceWrapper) LlmLaunch(w http.ResponseWriter, r *http.Request)

LlmLaunch operation middleware

func (*ServerInterfaceWrapper) LlmResult

func (siw *ServerInterfaceWrapper) LlmResult(w http.ResponseWriter, r *http.Request)

LlmResult operation middleware

func (*ServerInterfaceWrapper) LlmStatus

func (siw *ServerInterfaceWrapper) LlmStatus(w http.ResponseWriter, r *http.Request)

LlmStatus operation middleware

func (*ServerInterfaceWrapper) TestById

func (siw *ServerInterfaceWrapper) TestById(w http.ResponseWriter, r *http.Request)

TestById operation middleware

func (*ServerInterfaceWrapper) TestCreate

func (siw *ServerInterfaceWrapper) TestCreate(w http.ResponseWriter, r *http.Request)

TestCreate operation middleware

func (*ServerInterfaceWrapper) TestDelete

func (siw *ServerInterfaceWrapper) TestDelete(w http.ResponseWriter, r *http.Request)

TestDelete operation middleware

func (*ServerInterfaceWrapper) TestsMy

TestsMy operation middleware

type SignInRequest

type SignInRequest struct {
	// UserLogin User unique login
	UserLogin string `json:"user_login"`

	// UserPasswordHash User password hash in SHA512
	UserPasswordHash string `json:"user_password_hash"`
}

SignInRequest defines model for SignInRequest.

type SignUpRequest

type SignUpRequest struct {
	// UserLogin User unique login
	UserLogin string `json:"user_login"`

	// UserPasswordHash User password hash in SHA512
	UserPasswordHash string `json:"user_password_hash"`
}

SignUpRequest defines model for SignUpRequest.

type Test

type Test struct {
	// Description Test description
	Description *string `json:"description,omitempty"`

	// Identifier Test identifier UUID v4
	Identifier openapi_types.UUID `json:"identifier"`

	// Name Test unique name
	Name string `json:"name"`

	// Questions Test questions
	Questions []TestQuestion `json:"questions"`
}

Test defines model for Test.

type TestCreateJSONRequestBody

type TestCreateJSONRequestBody = CreateTestRequest

TestCreateJSONRequestBody defines body for TestCreate for application/json ContentType.

type TestId

type TestId = openapi_types.UUID

TestId defines model for TestId.

type TestQuestion

type TestQuestion struct {
	// Answers Question answers
	Answers []QuestionAnswer `json:"answers"`

	// Number Question number in the list
	Number int `json:"number"`

	// Text Question text
	Text string `json:"text"`
}

TestQuestion defines model for TestQuestion.

type TestsMyParams

type TestsMyParams struct {
	// PageNumber Pagination page number
	PageNumber *int `form:"page-number,omitempty" json:"page-number,omitempty"`

	// PageSize Pagination page size
	PageSize *int `form:"page-size,omitempty" json:"page-size,omitempty"`
}

TestsMyParams defines parameters for TestsMy.

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type Unimplemented

type Unimplemented struct{}

func (Unimplemented) AuthRefreshToken

func (_ Unimplemented) AuthRefreshToken(w http.ResponseWriter, r *http.Request, params AuthRefreshTokenParams)

Updating system access token using refresh token (POST /api/v1/auth/refresh-token)

func (Unimplemented) AuthSignIn

func (_ Unimplemented) AuthSignIn(w http.ResponseWriter, r *http.Request)

User login to the system with login and password (POST /api/v1/auth/sign-in)

func (Unimplemented) AuthSignUp

func (_ Unimplemented) AuthSignUp(w http.ResponseWriter, r *http.Request)

User registration in the system (POST /api/v1/auth/sign-up)

func (Unimplemented) LlmLaunch

func (_ Unimplemented) LlmLaunch(w http.ResponseWriter, r *http.Request, testId TestId)

Launching test analysis using a generative language model (POST /api/v1/test/{testId}/llm/launch)

func (Unimplemented) LlmResult

func (_ Unimplemented) LlmResult(w http.ResponseWriter, r *http.Request, testId TestId)

Getting all the test analysis results (GET /api/v1/test/{testId}/llm/result)

func (Unimplemented) LlmStatus

func (_ Unimplemented) LlmStatus(w http.ResponseWriter, r *http.Request, testId TestId)

Getting the current status of test analysis (GET /api/v1/test/{testId}/llm/status)

func (Unimplemented) TestById

func (_ Unimplemented) TestById(w http.ResponseWriter, r *http.Request, testId TestId)

Getting complete information of a specific test (GET /api/v1/test/{testId}/get)

func (Unimplemented) TestCreate

func (_ Unimplemented) TestCreate(w http.ResponseWriter, r *http.Request)

Creating a new test (PUT /api/v1/test/create)

func (Unimplemented) TestDelete

func (_ Unimplemented) TestDelete(w http.ResponseWriter, r *http.Request, testId TestId)

Deleting an existing test (DELETE /api/v1/test/{testId}/delete)

func (Unimplemented) TestsMy

func (_ Unimplemented) TestsMy(w http.ResponseWriter, r *http.Request, params TestsMyParams)

Getting "my" created tests (GET /api/v1/tests/my)

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL