Categorygithub.com/omegaup/gitserver
modulepackage
1.9.17
Repository: https://github.com/omegaup/gitserver.git
Documentation: pkg.go.dev

# README

gitserver

Documentation Go Report Card

The omegaUp Git server for problems.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

ConvertMarkdownToUTF8 performs a best-effort detection of the encoding of the supplied reader and returns a Reader that is UTF-8 encoded.
ConvertZipToPackfile receives a .zip file from the caller and converts it into a git packfile that can be used to update the repository.
CreatePackfile creates a packfile that contains a commit that contains the specified contents plus a subset of the parent commit's tree, depending of the value of zipMergeStrategy.
GetUpdatedFiles returns the files that were updated in the master branch.
HealthHandler is an implementation of k8s readiness and liveness checks.
InitRepository is a wrapper around git.CreateRepository() that also adds omegaUp-specific files to the repository.
NewGitHandler is the HTTP handler for the omegaUp git server.
NewGitProtocol creates a new GitProtocol with the provided authorization callback.
NewLineEndingNormalizer returns a LineEndingNormalizer from the provided io.Reader.
NewZipHandler is the HTTP handler that allows uploading .zip files.
NormalizeCase performs a best-effort conversion to UTF-8 and normalizes the end-of-line characters.
ParseZipMergeStrategy returns the corresponding ZipMergeStrategy for the provided name.
PushZip reads the contents of the .zip file pointed at to by problemFiles, creates a packfile out of it, and pushes it to the master branch of the repository.
SetupMetrics sets up the metrics for the gitserver.

# Constants

GitAttributesContents is what the .gitattributes and info/attributes files contain.
OverallWallTimeHardLimit is the absolute maximum wall time that problems are allowed to have.
ZipMergeStrategyOurs will use the parent commit's tree as-is without even looking at the contents of the .zip or doing any kind of merge.
ZipMergeStrategyRecursiveTheirs will merge the contents of the .zip file with the parent commit's tree, preferring whatever is present in the .zip file.
ZipMergeStrategyStatementsOurs will keep the statements/ subtree from the parent commit as-is, and replace the rest of the tree with the contents of the .zip file.
ZipMergeStrategyTheirs will use the tree that was contained in the .zip as-is without even looking at the parent tree or doing any kind of merge.

# Variables

DefaultCommitDescriptions describes which files go to which branches.
ErrChangeMissingSettingsJSON is returned if the settings.json file is missing.
ErrConfigBadLayout is returned if the refs/meta/config structure does not contain the correct layout.
ErrConfigInvalidPublishingMode is returned if a publishing config is not 'subdirectory' or 'mirror'.
ErrConfigRepositoryNotAbsoluteURL is returned if a publishing config does not have a valid, absolute URL for 'repository'.
ErrConfigSubdirectoryMissingTarget is returned if a 'subdirectory' publishing config is missing a 'target' entry.
ErrInteractiveBadLayout is returned if the interactive/ directory does not contain the correct layout.
ErrInternal is returned if there is an internal error.
ErrInternalGit is returned if there is a problem with the git structure.
ErrInvalidMarkup is returned if the markup file is not valid.
ErrInvalidTestplan is returned if the testplan file is not valid.
ErrInvalidZipFilename is returned if a path in the .zip is invalid.
ErrJSONParseError is returned if one of the JSON files fails to be parsed.
ErrMismatchedInputFile is returned if there is an .in without an .out.
ErrNoEsStatement is returned if the problem does not have the default Spanish statement.
ErrNoStatements is returned if the problem does not have any statements.
ErrNotAReview is returned if a merge to master is attempted and does not come from a review commit.
ErrProblemBadLayout is returned if the problem structure does not contain the correct layout.
ErrPublishedNotFromMaster is returned if an update to the published branch is attempted and the new reference does not point to a commit in the master branch.
ErrReviewBadLayout is returned if the review structure does not contain the correct layout.
ErrSlowRejected is returned if the maximum runtime would exceed the hard limit.
ErrTestsBadLayout is returned if the tests/ directory does not contain the correct layout.
ErrTooManyObjects is returned if the packfile has too many objects.
UTF16BEBOM is the UTF-16 (BE) Byte order mark.
UTF16LEBOM is the UTF-16 (LE) Byte order mark.
UTF32BEBOM is the UTF-16 (BE) Byte order mark.
UTF32LEBOM is the UTF-16 (LE) Byte order mark.
UTF8BOM is the UTF-8 Byte order mark.

# Structs

Comment is a comment in the code review.
FakeInteractiveSettingsCompiler is an implementation of InteractiveSettingsCompiler that just returns pre-specified settings.
GitHandlerOpts contains all the possible options to initialize the git Server.
GitProtocolOpts contains all the possible options to initialize the git protocol.
LedgerIteration is an entry in the iteration ledger.
LibinteractiveCompiler is an implementation of InteractiveSettingsCompiler that uses the real libinteractive.jar to convert the .idl file.
LineEndingNormalizer is an io.Reader that trims trailing whitespace and converts line endings to \n.
MetaConfig represents the contents of config.json in refs/meta/config.
PublishingConfig represents the publishing section of config.json in refs/meta/config.
Range is a range in the source code that is associated with a Comment.
UpdatedFile represents an updated file.
UpdateResult represents the result of running this command.
ZipHandlerOpts contains all the possible options to initialize the zip handler.

# Interfaces

InteractiveSettingsCompiler converts the .idl file contents and the module name + parent language pair into a common.InteractiveSettings object.

# Type aliases

A ZipMergeStrategy represents the strategy to use when merging the trees of a .zip upload and its parent.