Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
deatil committed Feb 28, 2023
1 parent ad9a37e commit 5a3fb68
Show file tree
Hide file tree
Showing 156 changed files with 463 additions and 150 deletions.
1 change: 1 addition & 0 deletions pkg/lakego-pkg/go-array/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ __debug_bin

# 临时文件 #
######################
go.sum
tmp/
.tmp/

Expand Down
1 change: 1 addition & 0 deletions pkg/lakego-pkg/go-cmd/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ __debug_bin

# 临时文件 #
######################
go.sum
tmp/
.tmp/

Expand Down
1 change: 1 addition & 0 deletions pkg/lakego-pkg/go-collection/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ __debug_bin

# 临时文件 #
######################
go.sum
tmp/
.tmp/

Expand Down
1 change: 1 addition & 0 deletions pkg/lakego-pkg/go-crc/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ __debug_bin

# 临时文件 #
######################
go.sum
tmp/
.tmp/

Expand Down
1 change: 1 addition & 0 deletions pkg/lakego-pkg/go-crc16/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ __debug_bin

# 临时文件 #
######################
go.sum
tmp/
.tmp/

Expand Down
1 change: 1 addition & 0 deletions pkg/lakego-pkg/go-crc32/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ __debug_bin

# 临时文件 #
######################
go.sum
tmp/
.tmp/

Expand Down
1 change: 1 addition & 0 deletions pkg/lakego-pkg/go-crc8/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ __debug_bin

# 临时文件 #
######################
go.sum
tmp/
.tmp/

Expand Down
1 change: 1 addition & 0 deletions pkg/lakego-pkg/go-cryptobin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ __debug_bin

# 临时文件 #
######################
go.sum
tmp/
.tmp/

Expand Down
17 changes: 17 additions & 0 deletions pkg/lakego-pkg/go-cryptobin/cryptobin/ca/error.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package ca

import (
cryptobin_tool "github.com/deatil/go-cryptobin/tool"
)

// 添加错误
func (this CA) AppendError(err ...error) CA {
this.Errors = append(this.Errors, err...)

return this
}

// 获取错误
func (this CA) Error() *cryptobin_tool.Errors {
return cryptobin_tool.NewError(this.Errors...)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"crypto/x509"

sm2X509 "github.com/tjfoc/gmsm/x509"

cryptobin_tool "github.com/deatil/go-cryptobin/tool"
)

// 获取 cert
Expand Down Expand Up @@ -38,11 +36,6 @@ func (this CA) GetErrors() []error {
return this.Errors
}

// 获取错误
func (this CA) Error() *cryptobin_tool.Errors {
return cryptobin_tool.NewError(this.Errors...)
}

// =========================

// 获取签名 alg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,3 @@ func (this CA) WithErrors(errs []error) CA {

return this
}

// 添加错误
func (this CA) AppendError(err ...error) CA {
this.Errors = append(this.Errors, err...)

return this
}
17 changes: 17 additions & 0 deletions pkg/lakego-pkg/go-cryptobin/cryptobin/crypto/error.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package crypto

import (
cryptobin_tool "github.com/deatil/go-cryptobin/tool"
)

// 添加错误
func (this Cryptobin) AppendError(err ...error) Cryptobin {
this.Errors = append(this.Errors, err...)

return this
}

// 获取错误
func (this Cryptobin) Error() *cryptobin_tool.Errors {
return cryptobin_tool.NewError(this.Errors...)
}
5 changes: 0 additions & 5 deletions pkg/lakego-pkg/go-cryptobin/cryptobin/crypto/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,3 @@ func (this Cryptobin) GetOneConfig(key string) any {
func (this Cryptobin) GetErrors() []error {
return this.Errors
}

// 获取错误
func (this Cryptobin) Error() *cryptobin_tool.Errors {
return cryptobin_tool.NewError(this.Errors...)
}
7 changes: 0 additions & 7 deletions pkg/lakego-pkg/go-cryptobin/cryptobin/crypto/with.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,3 @@ func (this Cryptobin) WithErrors(errs []error) Cryptobin {

return this
}

// 添加错误
func (this Cryptobin) AppendError(err ...error) Cryptobin {
this.Errors = append(this.Errors, err...)

return this
}
17 changes: 17 additions & 0 deletions pkg/lakego-pkg/go-cryptobin/cryptobin/dh/curve25519/error.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package curve25519

import (
cryptobin_tool "github.com/deatil/go-cryptobin/tool"
)

// 添加错误
func (this Curve25519) AppendError(err ...error) Curve25519 {
this.Errors = append(this.Errors, err...)

return this
}

// 获取错误
func (this Curve25519) Error() *cryptobin_tool.Errors {
return cryptobin_tool.NewError(this.Errors...)
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,3 @@ func (this Curve25519) GetSecretData() []byte {
func (this Curve25519) GetErrors() []error {
return this.Errors
}

// 获取错误
func (this Curve25519) Error() *cryptobin_tool.Errors {
return cryptobin_tool.NewError(this.Errors...)
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,3 @@ func (this Curve25519) WithErrors(errs []error) Curve25519 {

return this
}

// 添加错误
func (this Curve25519) AppendError(err ...error) Curve25519 {
this.Errors = append(this.Errors, err...)

return this
}
17 changes: 17 additions & 0 deletions pkg/lakego-pkg/go-cryptobin/cryptobin/dh/dh/error.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package dh

import (
cryptobin_tool "github.com/deatil/go-cryptobin/tool"
)

// 添加错误
func (this Dh) AppendError(err ...error) Dh {
this.Errors = append(this.Errors, err...)

return this
}

// 获取错误
func (this Dh) Error() *cryptobin_tool.Errors {
return cryptobin_tool.NewError(this.Errors...)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package dh

import (
"github.com/deatil/go-cryptobin/dh/dh"

cryptobin_tool "github.com/deatil/go-cryptobin/tool"
)

// 获取 PrivateKey
Expand Down Expand Up @@ -79,8 +77,3 @@ func (this Dh) GetSecretData() []byte {
func (this Dh) GetErrors() []error {
return this.Errors
}

// 获取错误
func (this Dh) Error() *cryptobin_tool.Errors {
return cryptobin_tool.NewError(this.Errors...)
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,3 @@ func (this Dh) WithError(errs []error) Dh {

return this
}

// 添加错误
func (this Dh) AppendError(err ...error) Dh {
this.Errors = append(this.Errors, err...)

return this
}
17 changes: 17 additions & 0 deletions pkg/lakego-pkg/go-cryptobin/cryptobin/dh/ecdh/error.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package ecdh

import (
cryptobin_tool "github.com/deatil/go-cryptobin/tool"
)

// 添加错误
func (this Ecdh) AppendError(err ...error) Ecdh {
this.Errors = append(this.Errors, err...)

return this
}

// 获取错误
func (this Ecdh) Error() *cryptobin_tool.Errors {
return cryptobin_tool.NewError(this.Errors...)
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,3 @@ func (this Ecdh) GetSecretData() []byte {
func (this Ecdh) GetErrors() []error {
return this.Errors
}

// 获取错误
func (this Ecdh) Error() *cryptobin_tool.Errors {
return cryptobin_tool.NewError(this.Errors...)
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,3 @@ func (this Ecdh) WithErrors(errs []error) Ecdh {

return this
}

// 添加错误
func (this Ecdh) AppendError(err ...error) Ecdh {
this.Errors = append(this.Errors, err...)

return this
}
17 changes: 17 additions & 0 deletions pkg/lakego-pkg/go-cryptobin/cryptobin/dsa/error.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package dsa

import (
cryptobin_tool "github.com/deatil/go-cryptobin/tool"
)

// 添加错误
func (this DSA) AppendError(err ...error) DSA {
this.Errors = append(this.Errors, err...)

return this
}

// 获取错误
func (this DSA) Error() *cryptobin_tool.Errors {
return cryptobin_tool.NewError(this.Errors...)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package dsa

import (
"crypto/dsa"

cryptobin_tool "github.com/deatil/go-cryptobin/tool"
)

// 获取 PrivateKey
Expand Down Expand Up @@ -45,8 +43,3 @@ func (this DSA) GetVerify() bool {
func (this DSA) GetErrors() []error {
return this.Errors
}

// 获取错误
func (this DSA) Error() *cryptobin_tool.Errors {
return cryptobin_tool.NewError(this.Errors...)
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,3 @@ func (this DSA) WithErrors(errs []error) DSA {

return this
}

// 添加错误
func (this DSA) AppendError(err ...error) DSA {
this.Errors = append(this.Errors, err...)

return this
}
17 changes: 17 additions & 0 deletions pkg/lakego-pkg/go-cryptobin/cryptobin/ecdh/error.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package ecdh

import (
cryptobin_tool "github.com/deatil/go-cryptobin/tool"
)

// 添加错误
func (this Ecdh) AppendError(err ...error) Ecdh {
this.Errors = append(this.Errors, err...)

return this
}

// 获取错误
func (this Ecdh) Error() *cryptobin_tool.Errors {
return cryptobin_tool.NewError(this.Errors...)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package ecdh

import (
"crypto/ecdh"

cryptobin_tool "github.com/deatil/go-cryptobin/tool"
)

// 获取 PrivateKey
Expand Down Expand Up @@ -35,8 +33,3 @@ func (this Ecdh) GetSecretData() []byte {
func (this Ecdh) GetErrors() []error {
return this.Errors
}

// 获取错误
func (this Ecdh) Error() *cryptobin_tool.Errors {
return cryptobin_tool.NewError(this.Errors...)
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,3 @@ func (this Ecdh) WithErrors(errs []error) Ecdh {

return this
}

// 添加错误
func (this Ecdh) AppendError(err ...error) Ecdh {
this.Errors = append(this.Errors, err...)

return this
}
17 changes: 17 additions & 0 deletions pkg/lakego-pkg/go-cryptobin/cryptobin/ecdsa/error.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package ecdsa

import (
cryptobin_tool "github.com/deatil/go-cryptobin/tool"
)

// 添加错误
func (this Ecdsa) AppendError(err ...error) Ecdsa {
this.Errors = append(this.Errors, err...)

return this
}

// 获取错误
func (this Ecdsa) Error() *cryptobin_tool.Errors {
return cryptobin_tool.NewError(this.Errors...)
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,3 @@ func (this Ecdsa) GetVerify() bool {
func (this Ecdsa) GetErrors() []error {
return this.Errors
}

// 获取错误
func (this Ecdsa) Error() *cryptobin_tool.Errors {
return cryptobin_tool.NewError(this.Errors...)
}
Loading

0 comments on commit 5a3fb68

Please sign in to comment.