Skip to content

Commit

Permalink
review: address various spelling issues
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Auernhammer <[email protected]>
  • Loading branch information
aead committed Oct 24, 2023
1 parent 8166d7e commit 8bbfc5a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type AuditHandler interface {
// decision.
Enabled(context.Context, slog.Level) bool

// Handle handles the AuditRecord. It will only called when
// Handle handles the AuditRecord. It will only be called when
// Enabled returns true.
//
// The context is present for providing AuditHandlers access
Expand Down
8 changes: 4 additions & 4 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ type CacheConfig struct {
Expiry time.Duration

// ExpiryUnused is the interval in which a particular
// must be accessed to remain in the cache. Keys that
// haven't been accessed get evicted from the cache.
// The general cache expiry still applies.
// key must be accessed to remain in the cache. Keys
// that haven't been accessed get evicted from the
// cache. The general cache expiry still applies.
//
// ExpiryUnused does nothing if <= 0 or greater than
// Expiry.
Expand Down Expand Up @@ -117,7 +117,7 @@ type RouteConfig struct {
// If <= 0, timeouts are disabled for the API route.
//
// Disabling timeouts may leave client/server connections
// hang or allow certain types of denial-of-service (DOS)
// hung or allow certain types of denial-of-service (DOS)
// attacks.
Timeout time.Duration

Expand Down
8 changes: 4 additions & 4 deletions internal/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (ro Route) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// A Handler responds to an API request.
//
// ServeAPI should either reply to the client or fail the request and
// then return.The Response type provides methods to do so. Returning
// then return. The Response type provides methods to do so. Returning
// signals that the request is finished; it is not valid to send a
// Response or read from the Request.Body after or concurrently with
// the completion of the ServeAPI call.
Expand Down Expand Up @@ -210,8 +210,8 @@ type Response struct {
http.ResponseWriter
}

// Reply is a shorthand for api.Reply. It sends just sends an
// HTTP status code to the client. The response body is empty.
// Reply is a shorthand for api.Reply. It sends just an HTTP
// status code to the client. The response body is empty.
func (r *Response) Reply(code int) { Reply(r, code) }

// Fail is a shorthand for api.Fail. It responds to the client
Expand All @@ -228,7 +228,7 @@ func (r *Response) Failf(code int, format string, v ...any) error {
// client with err.
func (r *Response) Failr(err Error) error { return Failr(r, err) }

// Reply sends just sends an HTTP status code to the client.
// Reply sends just an HTTP status code to the client.
// The response body is empty.
func Reply(r *Response, code int) {
r.Header().Set(headers.ContentLength, strconv.Itoa(0))
Expand Down
4 changes: 2 additions & 2 deletions keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type KeyStore interface {
// prefix, and the next prefix from which the listing should
// continue.
//
// It returns all keys with the prefix if n < 0 and less then n
// It returns all keys with the prefix if n < 0 and less than n
// names if n is greater than the number of keys with the prefix.
//
// An empty prefix matches any key name. At the end of the listing
Expand Down Expand Up @@ -110,7 +110,7 @@ func (ks *MemKeyStore) Get(_ context.Context, name string) ([]byte, error) {
// List returns the first n key names that start with the given
// prefix and the next prefix from which to continue the listing.
//
// It returns all keys with the prefix if n < 0 and less then n
// It returns all keys with the prefix if n < 0 and less than n
// names if n is grater than the number of keys with the prefix.
//
// An empty prefix matches any key name. At the end of the listing
Expand Down
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ func (s *Server) describePolicy(resp *api.Response, req *api.Request) {
resp.Failr(kes.ErrPolicyNotFound)
return
}
api.ReplyWith(resp, http.StatusOK, api.DescribeKeyResponse{
api.ReplyWith(resp, http.StatusOK, api.DescribePolicyResponse{
Name: req.Resource,
CreatedAt: state.StartTime,
CreatedBy: state.Admin.String(),
Expand Down

0 comments on commit 8bbfc5a

Please sign in to comment.