Skip to content

Commit 7b6fbef

Browse files
Merge pull request #9 from tianxiaoliang/main
define cipher interface
2 parents a282b8f + bd39c7f commit 7b6fbef

File tree

4 files changed

+50
-2
lines changed

4 files changed

+50
-2
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: golangci-lint
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches:
7+
- master
8+
pull_request:
9+
jobs:
10+
golangci:
11+
name: lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: golangci-lint
16+
uses: golangci/golangci-lint-action@v2
17+
with:
18+
version: v1.29
19+
args: --skip-dirs=discovery --out-format=colored-line-number --skip-files=.*_test.go$

NOTICE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
cari
2+
Copyright 2017-2020 Huawei Technologies Co.,Ltd.

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# CARI
22
the full name is cloud application runtime interface,
3-
it defines the interfaces of cloud services that application can use in cloud
3+
it defines the interfaces of cloud services that application should follow to run in cloud
44

55

66
# packages
77
## discovery
8-
defines a standard service for register and discovery, service like eureka,consul and service center
8+
defines a standard service for register and discovery, service like eureka,consul and service center
9+
10+
## security
11+
defines a common interface to encrypt and decrypt info

security/cipher.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*Copyright 2017 Huawei Technologies Co., Ltd
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
// Package security created on 2017/6/22
17+
package security
18+
19+
//Cipher interface declares two function for encryption and decryption
20+
type Cipher interface {
21+
Encrypt(src string) (string, error)
22+
23+
Decrypt(src string) (string, error)
24+
}

0 commit comments

Comments
 (0)