Documentation
¶
Overview ¶
Package gitrest is the write half of the API. It hands a fully rendered file to the vault's git-rest service, which commits and pushes it as the vault's own git identity. The API never touches git itself and the vault volume stays mounted read-only.
Index ¶
Constants ¶
const HeaderGatewaySecret = "X-Gateway-Secret"
HeaderGatewaySecret is the header git-rest reads the shared secret from.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
// WriteFile replaces path with content. git-rest answers {"ok":true} and no
// SHA, so the resulting commit is identified afterwards from git log, never
// from this call's response.
WriteFile(ctx context.Context, path string, content []byte) error
}
Client writes one complete file through git-rest.
type StatusError ¶
StatusError is a non-2xx answer from git-rest. The handler maps it to the status the caller should see, so a refusal upstream is not reported as a failure of this API.
func (*StatusError) Error ¶
func (e *StatusError) Error() string
Error returns the git-rest status and the body it answered with.