-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.go
More file actions
55 lines (45 loc) · 1.92 KB
/
Copy pathconfig.go
File metadata and controls
55 lines (45 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package client
import "time"
const (
// DefaultDockerImage is the default Docker image used for plate-solving
// Compatible images: "dm90/astrometry", "diarmuidk/astrometry-dockerised-solver", "ghcr.io/diarmuidkelly/astrometry-dockerised-solver"
DefaultDockerImage = "diarmuidk/astrometry-dockerised-solver"
)
// ClientConfig holds configuration for the Astrometry client.
type ClientConfig struct {
// DockerImage specifies the Docker image to use for solving.
// Compatible with dm90/astrometry, diarmuidk/astrometry-dockerised-solver, or ghcr.io/diarmuidkelly/astrometry-dockerised-solver
// Default: "diarmuidk/astrometry-dockerised-solver"
DockerImage string
// IndexPath is the host path to the astrometry index files.
// This directory will be mounted into the Docker container.
// Required.
IndexPath string
// TempDir is the working directory for images and output files.
// If empty, the system temporary directory will be used.
TempDir string
// Timeout is the maximum duration for the solve operation.
// Default: 5 minutes
Timeout time.Duration
// UseDockerExec enables using docker exec on an existing container
// instead of spawning new containers with docker run.
// When true, ContainerName must be specified.
// Default: false
UseDockerExec bool
// ContainerName is the name of the running container to exec commands in.
// Only used when UseDockerExec is true.
ContainerName string
// LocalExec runs the solve-field binary directly on PATH instead of via
// Docker. Intended for running inside an image built FROM the solver, where
// the astrometry binaries and index configuration are already present.
// Takes precedence over UseDockerExec when both are set.
// Default: false
LocalExec bool
}
// DefaultClientConfig returns a ClientConfig with sensible defaults.
func DefaultClientConfig() *ClientConfig {
return &ClientConfig{
DockerImage: DefaultDockerImage,
Timeout: 5 * time.Minute,
}
}