Documentation
¶
Index ¶
- Variables
- func Check(secret string) error
- func CheckEnv(env string) error
- func CheckFile(file, secret string) error
- func CheckMachine() error
- func Error(file string, err error) error
- func GetMachineSecret(secret string) string
- func GetMod(info *debug.BuildInfo, ok bool) *debug.Module
- func IsBuild(file string) bool
- type ContainsReader
- type Sign
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSignFailed = errors.New("sign failed") ErrFileName = errors.New("error file name") ErrSigned = errors.New("file has been signed") )
View Source
var Mod = GetMod(debug.ReadBuildInfo())
nolint
Functions ¶
func Check ¶
Example ¶
package main
import (
"fmt"
"github.com/xuender/gosign"
)
func main() {
if err := gosign.Check("secret_key"); err != nil {
panic(err)
}
fmt.Println("Hello Word.")
fmt.Println("This file integrity.")
}
Output: Hello Word. This file integrity.
func CheckEnv ¶
Example ¶
package main
import (
"fmt"
"github.com/xuender/gosign"
)
func main() {
if err := gosign.CheckEnv("SECRET_KEY"); err != nil {
panic(err)
}
fmt.Println("Hello Word.")
fmt.Println("Run on safe environment.")
}
Output: Hello Word. Run on safe environment.
func CheckMachine ¶
func CheckMachine() error
Example ¶
package main
import (
"fmt"
"github.com/xuender/gosign"
)
func main() {
if err := gosign.CheckMachine(); err != nil {
panic(err)
}
fmt.Println("Hello Word.")
fmt.Println("Run on sign machine.")
}
Output: Hello Word. Run on sign machine.
func GetMachineSecret ¶
Types ¶
type ContainsReader ¶
type ContainsReader struct {
// contains filtered or unexported fields
}
func NewContainsReader ¶
func NewContainsReader(reader io.Reader, subslice []byte) *ContainsReader
func (*ContainsReader) Contains ¶
func (p *ContainsReader) Contains() bool
Click to show internal directories.
Click to hide internal directories.