utils

package
v0.0.0-...-e1250bb Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commit string = "unknown"
View Source
var Version string = "0"

Functions

func VersionString

func VersionString() string

Types

type CodecraftersClient

type CodecraftersClient struct {
	ServerUrl string
}

func NewCodecraftersClient

func NewCodecraftersClient(serverUrl string) CodecraftersClient

func (CodecraftersClient) CreateSubmission

func (c CodecraftersClient) CreateSubmission(repositoryId string, commitSha string) (CreateSubmissionResponse, error)

func (CodecraftersClient) FetchBuild

func (c CodecraftersClient) FetchBuild(buildId string) (FetchBuildStatusResponse, error)

func (CodecraftersClient) FetchSubmission

func (c CodecraftersClient) FetchSubmission(submissionId string) (FetchSubmissionResponse, error)

type CreateSubmissionResponse

type CreateSubmissionResponse struct {
	Id string `json:"id"`

	// BuildLogstreamURL is returned when the submission is waiting on a build
	BuildID           string `json:"build_id"`
	BuildLogstreamURL string `json:"build_logstream_url"`

	CommitSHA string `json:"commit_sha"`

	// LogstreamURL contains test logs.
	LogstreamURL string `json:"logstream_url"`

	// Messages to be displayed to the user
	OnSuccessMessage     string `json:"on_success_message"`
	OnFailureMessage     string `json:"on_failure_message"`
	OnInitSuccessMessage string `json:"on_init_success_message"`
	OnInitWarningMessage string `json:"on_init_warning_message"`

	// IsError is true when the submission failed to be created, and ErrorMessage is the human-friendly error message
	IsError      bool   `json:"is_error"`
	ErrorMessage string `json:"error_message"`
}

type FetchBuildStatusResponse

type FetchBuildStatusResponse struct {
	Status string `json:"status"`

	ErrorMessage string `json:"error_message"`
	IsError      bool   `json:"is_error"`
}

type FetchSubmissionResponse

type FetchSubmissionResponse struct {
	ErrorMessage string `json:"error_message"`
	IsError      bool   `json:"is_error"`
	Status       string `json:"status"`
}

type GitRemote

type GitRemote struct {
	Url  string
	Name string
}

func IdentifyGitRemote

func IdentifyGitRemote(repositoryDir string) (GitRemote, error)

func (GitRemote) CodecraftersRepositoryId

func (r GitRemote) CodecraftersRepositoryId() string

func (GitRemote) CodecraftersServerURL

func (r GitRemote) CodecraftersServerURL() string

func (GitRemote) IsCodecrafters

func (r GitRemote) IsCodecrafters() bool

type MultipleCodecraftersRemotesFoundError

type MultipleCodecraftersRemotesFoundError struct {
	Remotes []GitRemote
}

func (MultipleCodecraftersRemotesFoundError) Error

type NoCodecraftersRemoteFoundError

type NoCodecraftersRemoteFoundError struct {
	Remotes []GitRemote
	// contains filtered or unexported fields
}

func (NoCodecraftersRemoteFoundError) Error

Jump to

Keyboard shortcuts

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