Documentation ¶
Index ¶
- Constants
- type BuildId
- type CacheBaseDir
- type CheckMode
- type CodePosition
- type CodePositions
- type CommandLine
- type CommandOptions
- type CommandOutputFiles
- type CommonRequestOptions
- type CompileBaseDir
- type CompileDir
- type CompileError
- type CompileOptions
- type CompileOptionsHash
- type CompileOutputDir
- type CompileRequest
- type CompileResponse
- type CompileStatus
- type ContentDir
- type DockerContainerOptions
- type DownloadPath
- type DraftModeFlag
- type Environment
- type ExecAgentRequestOptions
- type ExecAgentResponseBody
- type ExitCode
- type Namespace
- type Options
- type OutputBaseDir
- type OutputDir
- type OutputFile
- type OutputFiles
- type PDFCachingRange
- type PDFPosition
- type PDFPositions
- type Paths
- type ProjectCacheDir
- type Resource
- type Resources
- type StartInBackgroundRequest
- type SyncFromCodeRequest
- type SyncFromCodeResponse
- type SyncFromPDFRequest
- type SyncFromPDFResponse
- type SyncState
- type SyncTexOptions
- type SyncTexRequestCommon
- type SyncType
- type Timings
- type WordCountRequest
- type WordCountResponse
- type Words
Constants ¶
View Source
const ( NoCheck = CheckMode("") SilentCheck = CheckMode("silent") ErrorCheck = CheckMode("error") ValidateCheck = CheckMode("validate") )
View Source
const ( SyncTypeFullIncremental = SyncType("full") SyncTypeIncremental = SyncType("incremental") )
View Source
const SyncStateCleared = SyncState("")
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildId ¶
type BuildId string
func GenerateBuildId ¶
GenerateBuildId yields a secure unique id It contains a 16 hex char long timestamp in ns precision, a hyphen and another 16 hex char long random string.
type CacheBaseDir ¶
type CacheBaseDir string
func (CacheBaseDir) ProjectCacheDir ¶
func (d CacheBaseDir) ProjectCacheDir(namespace Namespace) ProjectCacheDir
func (CacheBaseDir) StateFile ¶
func (d CacheBaseDir) StateFile(namespace Namespace) string
type CodePosition ¶
type CodePosition struct { FileName sharedTypes.PathName `json:"file"` Row int64 `json:"line"` Column int64 `json:"column"` }
type CodePositions ¶
type CodePositions []CodePosition
type CommandLine ¶
type CommandLine []string
type CommandOptions ¶
type CommandOptions struct { CommandLine Environment sharedTypes.ComputeTimeout sharedTypes.ImageName sharedTypes.CompileGroup CommandOutputFiles *sharedTypes.Timed }
type CommandOutputFiles ¶
type CommandOutputFiles struct { StdErr sharedTypes.PathName `json:"stdErr"` StdOut sharedTypes.PathName `json:"stdOut"` }
func (*CommandOutputFiles) Cleanup ¶
func (f *CommandOutputFiles) Cleanup(dir CompileDir)
type CommonRequestOptions ¶
type CommonRequestOptions struct { CompileGroup sharedTypes.CompileGroup `json:"compileGroup"` ImageName sharedTypes.ImageName `json:"imageName"` }
func (*CommonRequestOptions) GetImageName ¶
func (o *CommonRequestOptions) GetImageName() sharedTypes.ImageName
func (*CommonRequestOptions) SetCompileGroup ¶
func (o *CommonRequestOptions) SetCompileGroup(cg sharedTypes.CompileGroup)
func (*CommonRequestOptions) SetImageName ¶
func (o *CommonRequestOptions) SetImageName(i sharedTypes.ImageName)
func (*CommonRequestOptions) Validate ¶
func (o *CommonRequestOptions) Validate() error
type CompileBaseDir ¶
type CompileBaseDir string
func (CompileBaseDir) CompileDir ¶
func (d CompileBaseDir) CompileDir(namespace Namespace) CompileDir
type CompileDir ¶
type CompileDir string
func (CompileDir) Join ¶
func (d CompileDir) Join(name sharedTypes.DirEntry) string
type CompileError ¶
type CompileError string
type CompileOptions ¶
type CompileOptions struct { Check CheckMode `json:"check"` Compiler sharedTypes.Compiler `json:"compiler"` CompileGroup sharedTypes.CompileGroup `json:"compileGroup"` Draft DraftModeFlag `json:"draft"` ImageName sharedTypes.ImageName `json:"imageName"` RootResourcePath sharedTypes.PathName `json:"rootResourcePath"` SyncState SyncState `json:"syncState"` SyncType SyncType `json:"syncType"` Timeout sharedTypes.ComputeTimeout `json:"timeout"` }
func (CompileOptions) Hash ¶
func (c CompileOptions) Hash() CompileOptionsHash
func (CompileOptions) Validate ¶
func (c CompileOptions) Validate() error
type CompileOptionsHash ¶
type CompileOptionsHash string
type CompileOutputDir ¶
type CompileOutputDir string
func (CompileOutputDir) Join ¶
func (d CompileOutputDir) Join(name sharedTypes.PathName) string
func (CompileOutputDir) JoinDir ¶
func (d CompileOutputDir) JoinDir(name sharedTypes.DirName) string
type CompileRequest ¶
type CompileRequest struct { Options CompileOptions `json:"options"` Resources Resources `json:"resources"` // Internal fields. RootDoc *Resource `json:"-"` RootDocAliasResource *Resource `json:"-"` }
func (*CompileRequest) Preprocess ¶
func (c *CompileRequest) Preprocess() error
func (*CompileRequest) Validate ¶
func (c *CompileRequest) Validate() error
type CompileResponse ¶
type CompileResponse struct { Status CompileStatus `json:"status,omitempty"` Error CompileError `json:"error,omitempty"` OutputFiles OutputFiles `json:"outputFiles"` Timings Timings `json:"timings"` }
type CompileStatus ¶
type CompileStatus string
type ContentDir ¶
type ContentDir string
func (ContentDir) Join ¶
func (d ContentDir) Join(hash sharedTypes.Hash) string
type DockerContainerOptions ¶
type DockerContainerOptions struct { User string `json:"user"` Env Environment `json:"env"` AgentPathContainer string `json:"agent_path_container"` AgentPathHost string `json:"agent_path_host"` AgentContainerLifeSpan time.Duration `json:"agent_container_life_span_ns"` AgentRestartAttempts int64 `json:"agent_restart_attempts"` Runtime string `json:"runtime"` SeccompPolicyPath string `json:"seccomp_policy_path"` CompileBaseDir CompileBaseDir `json:"compile_base_dir"` OutputBaseDir OutputBaseDir `json:"output_base_dir"` }
type DownloadPath ¶
type DownloadPath string
func BuildDownloadPath ¶
func BuildDownloadPath(projectId, userId sharedTypes.UUID, buildId BuildId, name sharedTypes.PathName) DownloadPath
func BuildDownloadPathFromNamespace ¶
func BuildDownloadPathFromNamespace(namespace Namespace, buildId BuildId, name sharedTypes.PathName) DownloadPath
type DraftModeFlag ¶
type DraftModeFlag bool
func (DraftModeFlag) Validate ¶
func (d DraftModeFlag) Validate() error
type Environment ¶
type Environment []string
type ExecAgentRequestOptions ¶
type ExecAgentRequestOptions struct { CommandLine `json:"command_line"` Environment `json:"environment,omitempty"` sharedTypes.ImageName `json:"imageName"` sharedTypes.ComputeTimeout `json:"timeout"` CommandOutputFiles `json:"command_output_files"` }
type ExecAgentResponseBody ¶
type ExecAgentResponseBody struct { ExitCode ExitCode `json:"exitCode,omitempty"` ErrorMessage string `json:"error_message,omitempty"` Timed sharedTypes.Timed `json:"timed"` }
type Options ¶
type Options struct { AllowedImages []sharedTypes.ImageName `json:"allowed_images"` CopyExecAgentSrc string `json:"copy_exec_agent_src"` CopyExecAgentDst string `json:"copy_exec_agent_dst"` ProjectCacheDuration time.Duration `json:"project_cache_duration_ns"` RefreshHealthCheckEvery time.Duration `json:"health_check_refresh_every_ns"` ParallelOutputWrite int64 `json:"parallel_output_write"` ParallelResourceWrite int64 `json:"parallel_resource_write"` MaxFilesAndDirsPerProject int64 `json:"max_files_and_dirs_per_project"` URLDownloadRetries int64 `json:"url_download_retries"` URLDownloadTimeout time.Duration `json:"url_download_timeout_ns"` Paths LatexBaseEnv Environment `json:"latex_base_env"` Runner string `json:"runner"` DockerContainerOptions DockerContainerOptions `json:"docker_container_options"` }
func (*Options) FillFromEnv ¶
func (o *Options) FillFromEnv()
type OutputBaseDir ¶
type OutputBaseDir string
func (OutputBaseDir) OutputDir ¶
func (d OutputBaseDir) OutputDir(namespace Namespace) OutputDir
type OutputDir ¶
type OutputDir string
func (OutputDir) CompileOutput ¶
func (OutputDir) CompileOutputDir ¶
func (d OutputDir) CompileOutputDir(id BuildId) CompileOutputDir
func (OutputDir) ContentDir ¶
func (d OutputDir) ContentDir(id BuildId) ContentDir
func (OutputDir) ContentDirBase ¶
type OutputFile ¶
type OutputFile struct { Build BuildId `json:"build"` DownloadPath DownloadPath `json:"url"` Path sharedTypes.PathName `json:"path"` Size int64 `json:"size,omitempty"` Type sharedTypes.FileType `json:"type"` Ranges []PDFCachingRange `json:"ranges,omitempty"` ContentId BuildId `json:"contentId,omitempty"` }
type OutputFiles ¶
type OutputFiles []OutputFile
func (OutputFiles) AddRanges ¶
func (o OutputFiles) AddRanges(ranges []PDFCachingRange, contentId BuildId)
type PDFCachingRange ¶
type PDFCachingRange struct { ObjectId string `json:"objectId"` Start uint64 `json:"start"` End uint64 `json:"end"` Hash sharedTypes.Hash `json:"hash"` }
type PDFPosition ¶
type PDFPositions ¶
type PDFPositions []PDFPosition
type Paths ¶
type Paths struct { CacheBaseDir CacheBaseDir `json:"cache_base_dir"` CompileBaseDir CompileBaseDir `json:"compile_base_dir"` OutputBaseDir OutputBaseDir `json:"output_base_dir"` }
type ProjectCacheDir ¶
type ProjectCacheDir string
func (ProjectCacheDir) Join ¶
func (d ProjectCacheDir) Join(name sharedTypes.PathName) string
type Resource ¶
type Resource struct { Path sharedTypes.PathName `json:"path"` Content string `json:"content,omitempty"` URL *sharedTypes.URL `json:"url,omitempty"` Version sharedTypes.Version `json:"v"` }
The Resource is either the inline doc Content, or a file with download URL.
type StartInBackgroundRequest ¶
type StartInBackgroundRequest struct {
ImageName sharedTypes.ImageName `json:"imageName"`
}
func (*StartInBackgroundRequest) Validate ¶
func (r *StartInBackgroundRequest) Validate() error
type SyncFromCodeRequest ¶
type SyncFromCodeRequest struct { SyncTexOptions FileName sharedTypes.PathName `json:"fileName"` Row int64 `json:"line"` Column int64 `json:"column"` }
func (*SyncFromCodeRequest) CommandLine ¶
func (r *SyncFromCodeRequest) CommandLine() CommandLine
func (*SyncFromCodeRequest) Options ¶
func (r *SyncFromCodeRequest) Options() *SyncTexOptions
func (*SyncFromCodeRequest) Validate ¶
func (r *SyncFromCodeRequest) Validate() error
type SyncFromCodeResponse ¶
type SyncFromCodeResponse struct {
PDF PDFPositions `json:"pdf"`
}
type SyncFromPDFRequest ¶
type SyncFromPDFRequest struct { SyncTexOptions Page int64 `json:"page"` Horizontal float64 `json:"horizontal"` Vertical float64 `json:"vertical"` }
func (*SyncFromPDFRequest) CommandLine ¶
func (r *SyncFromPDFRequest) CommandLine() CommandLine
func (*SyncFromPDFRequest) Options ¶
func (r *SyncFromPDFRequest) Options() *SyncTexOptions
func (*SyncFromPDFRequest) Validate ¶
func (r *SyncFromPDFRequest) Validate() error
type SyncFromPDFResponse ¶
type SyncFromPDFResponse struct {
Code CodePositions `json:"code"`
}
type SyncTexOptions ¶
type SyncTexOptions struct { CommonRequestOptions BuildId BuildId `json:"buildId"` }
func (SyncTexOptions) OutputPDFPath ¶
func (o SyncTexOptions) OutputPDFPath() string
func (SyncTexOptions) OutputSyncTexGzPath ¶
func (o SyncTexOptions) OutputSyncTexGzPath() string
func (*SyncTexOptions) Validate ¶
func (o *SyncTexOptions) Validate() error
type SyncTexRequestCommon ¶
type SyncTexRequestCommon interface { Options() *SyncTexOptions CommandLine() CommandLine }
type Timings ¶
type Timings struct { FetchContent sharedTypes.Timed `json:"fetchContent"` Compile sharedTypes.Timed `json:"compile"` CompileE2E sharedTypes.Timed `json:"compileE2E"` Output sharedTypes.Timed `json:"output"` Sync sharedTypes.Timed `json:"sync"` }
type WordCountRequest ¶
type WordCountRequest struct { CommonRequestOptions FileName sharedTypes.PathName `json:"fileName"` }
func (*WordCountRequest) Preprocess ¶
func (r *WordCountRequest) Preprocess() error
func (*WordCountRequest) Validate ¶
func (r *WordCountRequest) Validate() error
type WordCountResponse ¶
type WordCountResponse struct {
TexCount Words `json:"texcount"`
}
type Words ¶
type Words struct { Encode string `json:"encode"` TextWords int64 `json:"textWords"` HeadWords int64 `json:"headWords"` Outside int64 `json:"outside"` Headers int64 `json:"headers"` Elements int64 `json:"elements"` MathInline int64 `json:"mathInline"` MathDisplay int64 `json:"mathDisplay"` Errors int64 `json:"errors"` Messages string `json:"messages"` }
Click to show internal directories.
Click to hide internal directories.