Documentation
¶
Index ¶
- Constants
- func FetchOwner(ctx context.Context, port int) (string, error)
- func GetPort() (int, error)
- func LoopbackHTTPClient() *http.Client
- func PingURL(ctx context.Context, url string) error
- func PostWithRetry(port int, endpoint string, body io.Reader) ([]byte, error)
- func RunCredentialsServer(ctx context.Context, port int, client CredentialsClient, owner string) error
- func RunCredentialsServerWithListener(ctx context.Context, ln net.Listener, client CredentialsClient, owner string) error
- func RunPreparedCredentialsServer(ctx context.Context, ln net.Listener, client CredentialsClient, ...) error
- func StartCredentialsServer(ctx context.Context, client CredentialsClient) (int, error)
- type CredentialsClient
- type Readiness
Constants ¶
View Source
const ( // #nosec G101 -- Public HTTP header carrying a nonsecret relay identifier. HeaderCredentialsInstance = "X-Devsy-Credentials-Instance" // #nosec G101 -- Public HTTP header carrying a nonsecret host identifier. HeaderCredentialsHostOwner = "X-Devsy-Credentials-Host-Owner" )
View Source
const DefaultPort = "12049"
View Source
const ReadinessVersion = 1
Variables ¶
This section is empty.
Functions ¶
func FetchOwner ¶ added in v1.16.0
FetchOwner returns "" without error if owner is unset or ownerPath is missing.
func LoopbackHTTPClient ¶
func RunCredentialsServer ¶
func RunCredentialsServerWithListener ¶ added in v1.13.0
func RunCredentialsServerWithListener( ctx context.Context, ln net.Listener, client CredentialsClient, owner string, ) error
RunCredentialsServerWithListener is like RunCredentialsServer, but takes an already-bound listener. Use this when the caller must hold the port exclusively (via net.Listen) from before startup through to serving, so no other process can bind the same port in between.
func StartCredentialsServer ¶
func StartCredentialsServer( ctx context.Context, client CredentialsClient, ) (int, error)
Types ¶
type CredentialsClient ¶ added in v1.10.0
type CredentialsClient interface {
GitCredentials(
ctx context.Context, in *tunnel.Message, opts ...grpc.CallOption,
) (*tunnel.Message, error)
DockerCredentials(
ctx context.Context, in *tunnel.Message, opts ...grpc.CallOption,
) (*tunnel.Message, error)
GitSSHSignature(
ctx context.Context, in *tunnel.Message, opts ...grpc.CallOption,
) (*tunnel.Message, error)
GPGPublicKeys(
ctx context.Context, in *tunnel.Message, opts ...grpc.CallOption,
) (*tunnel.Message, error)
DevsyConfig(
ctx context.Context, in *tunnel.Message, opts ...grpc.CallOption,
) (*tunnel.Message, error)
}
type Readiness ¶
type Readiness struct {
Version int `json:"version"`
Owner string `json:"owner"`
HostOwner string `json:"host_owner"`
Instance string `json:"instance"`
GitHubAllowed bool `json:"github_allowed"`
GitHubState string `json:"github_state"`
Address string `json:"-"`
}
func ProbeReadiness ¶
Click to show internal directories.
Click to hide internal directories.