Skip to content

Commit

Permalink
gofmt codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
sillygod committed Apr 12, 2023
1 parent 849270a commit 73d28fc
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 41 deletions.
28 changes: 14 additions & 14 deletions caddyfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,21 @@ func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error)

// UnmarshalCaddyfile sets up the handler from Caddyfile
//
// :4000 {
// reverse_proxy yourserver:5000
// http_cache {
// match_path /assets
// match_header Content-Type image/jpg image/png
// status_header X-Cache-Status
// default_max_age 15m
// path /tmp/caddy-cache
// :4000 {
// reverse_proxy yourserver:5000
// http_cache {
// match_path /assets
// match_header Content-Type image/jpg image/png
// status_header X-Cache-Status
// default_max_age 15m
// path /tmp/caddy-cache
//
// distributed consul {
// service_name
// addr
// }
// }
// }
// distributed consul {
// service_name
// addr
// }
// }
// }
func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
config := getDefaultConfig()

Expand Down
9 changes: 4 additions & 5 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@
// There is no need to modify the Caddy source code to customize your
// builds. You can easily build a custom Caddy with these simple steps:
//
// 1. Copy this file (main.go) into a new folder
// 2. Edit the imports below to include the modules you want plugged in
// 3. Run `go mod init caddy`
// 4. Run `go install` or `go build` - you now have a custom binary!
//
// 1. Copy this file (main.go) into a new folder
// 2. Edit the imports below to include the modules you want plugged in
// 3. Run `go mod init caddy`
// 4. Run `go install` or `go build` - you now have a custom binary!
package main

import (
Expand Down
10 changes: 5 additions & 5 deletions endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ type cachePurge struct{}
// PurgePayload holds the field which will be unmarshalled from the request's body
// NOTE: the format of URI can contains the query param.
// ex. when the client send a delete request with the body
// {
// "method": "GET",
// "hots": "example.com",
// "uri": "/static?ext=txt",
// }
//
// {
// "method": "GET",
// "hots": "example.com",
// "uri": "/static?ext=txt",
// }
type PurgePayload struct {
Method string `json:"method"`
Host string `json:"host"`
Expand Down
13 changes: 7 additions & 6 deletions extends/distributed/caddyfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ func getDefaultConfig() *Config {
}

// UnmarshalCaddyfile deserializes Caddyfile tokens into consulservice's config
// distributed consul {
// service_name
// addr
// token
// health_url
// }
//
// distributed consul {
// service_name
// addr
// token
// health_url
// }
func (c *ConsulService) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
config := getDefaultConfig()

Expand Down
13 changes: 7 additions & 6 deletions extends/influxlog/Caddyfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ func getDefaultConfig() *Config {
}

// UnmarshalCaddyfile deserializes Caddyfile tokens into influxlog config
// influxlog {
// addr
// token
// organization
// bucket
// }
//
// influxlog {
// addr
// token
// organization
// bucket
// }
func (s *Writer) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
config := getDefaultConfig()

Expand Down
11 changes: 6 additions & 5 deletions extends/storage/caddyfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ func getDefaultConfig() *Config {
}

// UnmarshalCaddyfile deserialize Caddyfile tokens into consul storage's config
// storage consul {
// addr
// token
// key_prefix
// }
//
// storage consul {
// addr
// token
// key_prefix
// }
func (s *Storage) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
config := getDefaultConfig()

Expand Down

0 comments on commit 73d28fc

Please sign in to comment.