Skip to content

Commit

Permalink
添加license
Browse files Browse the repository at this point in the history
  • Loading branch information
hookokoko committed Oct 24, 2023
1 parent f3bbb01 commit f84d459
Show file tree
Hide file tree
Showing 31 changed files with 356 additions and 59 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/go-fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ jobs:
go-version: ">=1.20.0"

- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports@latest
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest && \
go install golang.org/x/tools/cmd/goimports@latest
- name: Check
run: |
Expand Down
2 changes: 1 addition & 1 deletion .licenserc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"**/*.go": "// Copyright 2021 ecodeclub",
"**/*.{yml,toml}": "# Copyright 2021 ecodeclub",
"**/*.{yml}": "# Copyright 2021 ecodeclub",
"**/*.sh": "# Copyright 2021 ecodeclub"
}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ setup:

.PHONY: fmt
fmt:
@goimports -l -w $(find . -type f -name '*.go' -not -path "./.idea/*")
@goimports -l -w $$(find . -type f -name '*.go' -not -path "./.idea/*")

.PHONY: lint
lint:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Go](https://github.com/hookokoko/notify-go_dev/actions/workflows/notify-go.yml/badge.svg?branch=dev)](https://github.com/hookokoko/notify-go_dev/actions/workflows/notify-go.yml)
[![Go](https://github.com/hookokoko/notify-go_dev/actions/workflows/go.yml/badge.svg?branch=dev)](https://github.com/hookokoko/notify-go_dev/actions/workflows/notify-go.yml)
[![codecov](https://codecov.io/github/hookokoko/notify-go_dev/graph/badge.svg?token=H9D9S5Y2VM)](https://codecov.io/github/hookokoko/notify-go_dev)
# notify-go

Expand Down
14 changes: 14 additions & 0 deletions channel/channel.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 ecodeclub
//
// 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 channel

import (
Expand Down
14 changes: 14 additions & 0 deletions channel/email/email.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 ecodeclub
//
// 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 email

import (
Expand Down
29 changes: 0 additions & 29 deletions channel/email/email_test.go

This file was deleted.

19 changes: 17 additions & 2 deletions channel/push/push.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
// Copyright 2021 ecodeclub
//
// 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 push

import (
"context"
"crypto/sha256"
"fmt"
"strconv"
"time"

"github.com/ecodeclub/ekit/slice"
"github.com/ecodeclub/notify-go/pkg/notifier"
"github.com/ecodeclub/notify-go/pkg/ral"
"github.com/pborman/uuid"
"github.com/pkg/errors"
"strconv"
"time"
)

type Config struct {
Expand Down
14 changes: 14 additions & 0 deletions channel/sms/sms.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 ecodeclub
//
// 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 sms

import (
Expand Down
16 changes: 15 additions & 1 deletion content/content.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 ecodeclub
//
// 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 content

import (
Expand Down Expand Up @@ -40,7 +54,7 @@ func (s *Service) GetContent(ctx context.Context, receivers []notifier.Receiver,
// 通过模版渲染出发送内容
cont, err = s.renderContent(ctx, tpl, variable)

return cont, nil
return cont, err
}

func (s *Service) renderContent(ctx context.Context, tpl string,
Expand Down
14 changes: 14 additions & 0 deletions content/template.go
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
// Copyright 2021 ecodeclub
//
// 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 content
19 changes: 17 additions & 2 deletions example/base/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
// Copyright 2021 ecodeclub
//
// 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 main

import (
"context"
"log"
"time"

"github.com/BurntSushi/toml"
"github.com/ecodeclub/ekit/slice"
notifygo "github.com/ecodeclub/notify-go"
Expand All @@ -11,8 +28,6 @@ import (
"github.com/ecodeclub/notify-go/pkg/ral"
"github.com/ecodeclub/notify-go/queue"
"github.com/ecodeclub/notify-go/queue/kafka"
"log"
"time"
)

var (
Expand Down
14 changes: 14 additions & 0 deletions notification.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 ecodeclub
//
// 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 notify_go

import (
Expand Down
14 changes: 14 additions & 0 deletions pkg/error/error.go
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
// Copyright 2021 ecodeclub
//
// 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 error
14 changes: 14 additions & 0 deletions pkg/log/log.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 ecodeclub
//
// 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 log

import (
Expand Down
14 changes: 14 additions & 0 deletions pkg/notifier/channel.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 ecodeclub
//
// 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 notifier

import "context"
Expand Down
14 changes: 14 additions & 0 deletions pkg/notifier/content.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 ecodeclub
//
// 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 notifier

type Content struct {
Expand Down
14 changes: 14 additions & 0 deletions pkg/notifier/recevicer.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 ecodeclub
//
// 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 notifier

type Receiver struct {
Expand Down
14 changes: 14 additions & 0 deletions pkg/ral/ral.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 ecodeclub
//
// 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 ral

import (
Expand Down
14 changes: 14 additions & 0 deletions pkg/ral/record.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 ecodeclub
//
// 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 ral

import (
Expand Down
17 changes: 16 additions & 1 deletion pkg/ral/service.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
// Copyright 2021 ecodeclub
//
// 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 ral

import (
"github.com/BurntSushi/toml"
"log"

"github.com/BurntSushi/toml"
)

type Service struct {
Expand Down
Loading

0 comments on commit f84d459

Please sign in to comment.