Skip to content

Commit

Permalink
Apply license; add copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed Jun 17, 2023
1 parent bc4310e commit 2dc0d58
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 15 deletions.
43 changes: 28 additions & 15 deletions caddyfile.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 Matthew Holt

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package caddyrl

import (
Expand All @@ -23,21 +37,20 @@ func parseCaddyfile(helper httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, e

// UnmarshalCaddyfile implements caddyfile.Unmarshaler. Syntax:
//
// rate_limit {
// zone <name> {
// key <string>
// window <duration>
// events <max_events>
// }
// distributed {
// read_interval <duration>
// write_interval <duration>
// }
// storage <module...>
// jitter <percent>
// sweep_interval <duration>
// }
//
// rate_limit {
// zone <name> {
// key <string>
// window <duration>
// events <max_events>
// }
// distributed {
// read_interval <duration>
// write_interval <duration>
// }
// storage <module...>
// jitter <percent>
// sweep_interval <duration>
// }
func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
for d.Next() {
if d.NextArg() {
Expand Down
14 changes: 14 additions & 0 deletions distributed.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 Matthew Holt

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package caddyrl

import (
Expand Down
14 changes: 14 additions & 0 deletions handler.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 Matthew Holt

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package caddyrl

import (
Expand Down
14 changes: 14 additions & 0 deletions ratelimit.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 Matthew Holt

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package caddyrl

import (
Expand Down
14 changes: 14 additions & 0 deletions ringbuffer.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 Matthew Holt

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package caddyrl

import (
Expand Down

0 comments on commit 2dc0d58

Please sign in to comment.