Skip to content
This repository has been archived by the owner on Jul 22, 2023. It is now read-only.

Commit

Permalink
Un-export kubeprobesOption type
Browse files Browse the repository at this point in the history
  • Loading branch information
Icikowski committed Mar 6, 2022
1 parent 45e840b commit ad80960
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The handler serves two endpoints, which are used to implement liveness and readi

Accessing any other endpoint will return `404` status. In order to provide maximum performance, no body is ever returned.

The `kubeprobes.NewKubeprobes` accepts following `KubeprobesOption` functions as arguments:
The `kubeprobes.NewKubeprobes` function accepts following options-applying functions as arguments:

- `kubeprobes.WithLivenessProbes(/* ... */)` - adds particular [probes](#probes) to the list of liveness probes;
- `kubeprobes.WithReadinessProbes(/* ... */)` - adds particular [probes](#probes) to the list of readiness probes.
Expand Down
9 changes: 4 additions & 5 deletions probes.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ func (kp *kubeprobes) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
}

// ProbeSetOptions function that configures the set of probes
type KubeprobesOption func(*kubeprobes)
type kubeprobesOption func(*kubeprobes)

// NewKubeprobes returns a new instance of a Kubernetes probes
func NewKubeprobes(options ...KubeprobesOption) *kubeprobes {
func NewKubeprobes(options ...kubeprobesOption) *kubeprobes {
kp := &kubeprobes{
livenessProbes: []ProbeFunction{},
readinessProbes: []ProbeFunction{},
Expand All @@ -49,14 +48,14 @@ func NewKubeprobes(options ...KubeprobesOption) *kubeprobes {
}

// WithLivenessProbes adds given liveness probes to the set of probes
func WithLivenessProbes(probes ...ProbeFunction) KubeprobesOption {
func WithLivenessProbes(probes ...ProbeFunction) kubeprobesOption {
return func(kp *kubeprobes) {
kp.livenessProbes = append(kp.livenessProbes, probes...)
}
}

// WithReadinessProbes adds given readiness probes to the set of probes
func WithReadinessProbes(probes ...ProbeFunction) KubeprobesOption {
func WithReadinessProbes(probes ...ProbeFunction) kubeprobesOption {
return func(kp *kubeprobes) {
kp.readinessProbes = append(kp.readinessProbes, probes...)
}
Expand Down

0 comments on commit ad80960

Please sign in to comment.