World Conquest Chronicles

World Conquest Chronicles

go-exercises-worker, v1.1.4

Background worker of the service for solving programming exercises.

Add the API description in the AsyncAPI format.

Change Log

  • API description in the AsyncAPI format:
    • describe the API:
      • for consuming of the solutions;
      • for producing of the solution results;
    • add the Docker Compose configuration:
      • for generating of the API description;
      • for displaying of the API description.

API Description

API description in the AsyncAPI format:

asyncapi: 2.1.0
info:
  title: go-exercises-worker API
  version: 1.1.4
  license:
    name: MIT
channels:
  solution_queue:
    publish:
      message:
        $ref: "#/components/messages/Solution"
  solution_result_queue:
    subscribe:
      message:
        $ref: "#/components/messages/SolutionResult"
components:
  messages:
    Solution:
      contentType: application/json
      payload:
        $ref: "#/components/schemas/entities.Solution"
    SolutionResult:
      contentType: application/json
      payload:
        $ref: "#/components/schemas/entities.SolutionResult"
  schemas:
    entities.Solution:
      type: object
      properties:
        ID:
          type: integer
        Task:
          $ref: "#/components/schemas/entities.Task"
        Code:
          type: string
    entities.Task:
      type: object
      properties:
        TestCases:
          type: array
          items:
            $ref: "#/components/schemas/testrunner.TestCase"
    testrunner.TestCase:
      type: object
      properties:
        Input:
          type: string
        ExpectedOutput:
          type: string
    entities.SolutionResult:
      type: object
      properties:
        ID:
          type: integer
        IsCorrect:
          type: boolean
        Result:
          oneOf:
            - type: object
            - $ref: "#/components/schemas/runners.ErrFailedCompiling"
            - $ref: "#/components/schemas/testrunner.ErrFailedRunning"
            - $ref: "#/components/schemas/testrunner.ErrUnexpectedOutput"
    runners.ErrFailedCompiling:
      type: object
      properties:
        ErrMessage:
          type: string
    testrunner.ErrFailedRunning:
      type: object
      properties:
        Input:
          type: string
        ExpectedOutput:
          type: string
        ErrMessage:
          type: string
    testrunner.ErrUnexpectedOutput:
      type: object
      properties:
        Input:
          type: string
        ExpectedOutput:
          type: string
        ActualOutput:
          type: string

Repository

Link: https://github.com/thewizardplusplus/go-exercises-worker/tree/v1.1.4.

Content: code.

License: MIT.

Screenshots

Description of the API for producing of the solution results