repo
stringlengths
6
47
file_url
stringlengths
77
269
file_path
stringlengths
5
186
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-07 08:35:43
2026-01-07 08:55:24
truncated
bool
2 classes
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/basic/client.go
pkg/infra/basic/client.go
package basic import ( "context" "crypto/tls" "github.com/hyperledger-twgc/tape/internal/fabric/core/comm" "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/pkg/errors" log "github.com/sirupsen/logrus" "google.golang.org/grpc" ) func Cre...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/basic/config.go
pkg/infra/basic/config.go
package basic import ( "crypto/ecdsa" "crypto/x509" "encoding/pem" "os" "sync" "github.com/opentracing/opentracing-go" "github.com/hyperledger-twgc/tape/internal/fabric/bccsp/utils" "github.com/gogo/protobuf/proto" "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric-proto...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/basic/client_test.go
pkg/infra/basic/client_test.go
//go:build !race // +build !race package basic_test import ( "context" "github.com/hyperledger-twgc/tape/e2e/mock" "github.com/hyperledger-twgc/tape/pkg/infra/basic" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" log "github.com/sirupsen/logrus" ) var _ = Describe("Client", func() { Context("conne...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/basic/config_test.go
pkg/infra/basic/config_test.go
package basic_test import ( "os" "text/template" "github.com/hyperledger-twgc/tape/pkg/infra/basic" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) type files struct { TlsFile string PolicyFile string } func generateConfigFile(FileName string, values interface{}) { var Text = `# Definition of ...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/basic/basic_suite_test.go
pkg/infra/basic/basic_suite_test.go
package basic_test import ( "testing" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) func TestBasic(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "Basic Suite") }
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/basic/crypto.go
pkg/infra/basic/crypto.go
package basic import ( "crypto/ecdsa" "crypto/rand" "crypto/sha256" "crypto/x509" "encoding/asn1" "math/big" "github.com/hyperledger-twgc/tape/internal/fabric/bccsp/utils" "github.com/hyperledger-twgc/tape/internal/fabric/common/crypto" "github.com/hyperledger/fabric-protos-go-apiv2/common" ) type CryptoCo...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/basic/logger.go
pkg/infra/basic/logger.go
package basic import ( "io" "sync" "time" "github.com/opentracing/opentracing-go" "github.com/prometheus/client_golang/prometheus" log "github.com/sirupsen/logrus" jaeger "github.com/uber/jaeger-client-go" "github.com/uber/jaeger-client-go/config" ) func LogEvent(logger *log.Logger, txid, event string) { no...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/bitmap/bitmap_suite_test.go
pkg/infra/bitmap/bitmap_suite_test.go
package bitmap_test import ( "testing" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) func TestBitmap(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "Bitmap Suite") }
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/bitmap/bitmap_test.go
pkg/infra/bitmap/bitmap_test.go
package bitmap_test import ( "github.com/hyperledger-twgc/tape/pkg/infra/bitmap" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) var _ = Describe("Bitmap", func() { Context("New BitsMap", func() { It("the environment is properly set", func() { b, err := bitmap.NewBitMap(4) Expect(err).To(BeNi...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/bitmap/bitmap.go
pkg/infra/bitmap/bitmap.go
package bitmap import "github.com/pkg/errors" type BitMap struct { count int // number of bits set capability int // total number of bits bits []uint64 } // Has determine whether the specified position is set func (b *BitMap) Has(num int) bool { if num >= b.capability { return false } c, bit := nu...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/trafficGenerator/policyHandler.go
pkg/infra/trafficGenerator/policyHandler.go
package trafficGenerator import ( "context" "github.com/hyperledger-twgc/tape/pkg/infra/basic" "github.com/open-policy-agent/opa/rego" ) func CheckPolicy(input *basic.Elements, rule string) (bool, error) { if input.Processed { return false, nil } rego := rego.New( rego.Query("data.tape.allow"), rego.Modu...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/trafficGenerator/proposal_test.go
pkg/infra/trafficGenerator/proposal_test.go
package trafficGenerator_test import ( "regexp" "strconv" "github.com/hyperledger-twgc/tape/pkg/infra/trafficGenerator" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) var _ = Describe("Proposal", func() { Context("ConvertString", func() { It("work accordingly for string", func() { input := "d...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/trafficGenerator/initiator.go
pkg/infra/trafficGenerator/initiator.go
package trafficGenerator import ( "context" "github.com/hyperledger-twgc/tape/pkg/infra" "github.com/hyperledger-twgc/tape/pkg/infra/basic" "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/time/rate" ) type Initiator struct { Num int Burst int R float64 Config basic.Conf...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/trafficGenerator/fackEnvelopGenerator.go
pkg/infra/trafficGenerator/fackEnvelopGenerator.go
package trafficGenerator import ( "github.com/hyperledger-twgc/tape/internal/fabric/protoutil" "github.com/hyperledger-twgc/tape/pkg/infra" "github.com/hyperledger-twgc/tape/pkg/infra/basic" "github.com/opentracing/opentracing-go" "github.com/hyperledger/fabric-protos-go-apiv2/common" ) type FackEnvelopGenerato...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/trafficGenerator/intgerator.go
pkg/infra/trafficGenerator/intgerator.go
package trafficGenerator import ( "context" "github.com/hyperledger-twgc/tape/pkg/infra" "github.com/hyperledger-twgc/tape/pkg/infra/basic" log "github.com/sirupsen/logrus" ) type Integrator struct { Signer infra.Crypto Ctx context.Context Processed chan *basic.Elements Envs chan *basic.Tracin...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/trafficGenerator/generatorFactory.go
pkg/infra/trafficGenerator/generatorFactory.go
package trafficGenerator import ( "context" "github.com/hyperledger-twgc/tape/pkg/infra" "github.com/hyperledger-twgc/tape/pkg/infra/basic" log "github.com/sirupsen/logrus" ) type TrafficGenerator struct { ctx context.Context crypto infra.Crypto raw chan *basic.TracingProposal signed...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/trafficGenerator/assembler.go
pkg/infra/trafficGenerator/assembler.go
package trafficGenerator import ( "context" "github.com/hyperledger-twgc/tape/pkg/infra/basic" "github.com/hyperledger-twgc/tape/pkg/infra" log "github.com/sirupsen/logrus" ) type Assembler struct { Signer infra.Crypto Ctx context.Context Raw chan *basic.TracingProposal Signed []chan *basic.Eleme...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/trafficGenerator/fuzzing_test.go
pkg/infra/trafficGenerator/fuzzing_test.go
//go:build !race // +build !race package trafficGenerator_test import ( "testing" "unicode/utf8" "github.com/hyperledger-twgc/tape/pkg/infra/trafficGenerator" ) func FuzzConvertString(f *testing.F) { testcases := []string{"data", "randomString1", "uuid", "randomNumber1_9", "{\"k1\":\"uuid\",\"key2\":\"randomNum...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/trafficGenerator/proposer_test.go
pkg/infra/trafficGenerator/proposer_test.go
//go:build !race // +build !race package trafficGenerator_test import ( "context" "time" "github.com/hyperledger-twgc/tape/e2e/mock" "github.com/hyperledger-twgc/tape/pkg/infra/basic" "github.com/hyperledger-twgc/tape/pkg/infra/trafficGenerator" "github.com/opentracing/opentracing-go" "github.com/hyperledger...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/trafficGenerator/fackEnvelopGenerator_test.go
pkg/infra/trafficGenerator/fackEnvelopGenerator_test.go
package trafficGenerator_test import ( "os" "time" "github.com/hyperledger-twgc/tape/e2e" "github.com/hyperledger-twgc/tape/pkg/infra/basic" "github.com/hyperledger-twgc/tape/pkg/infra/trafficGenerator" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) var _ = Describe("FackEnvelopGenerator", func() ...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/trafficGenerator/benchmark_test.go
pkg/infra/trafficGenerator/benchmark_test.go
//go:build !race // +build !race package trafficGenerator_test import ( "os" "testing" "github.com/hyperledger-twgc/tape/e2e" "github.com/hyperledger-twgc/tape/pkg/infra/basic" "github.com/hyperledger-twgc/tape/pkg/infra/trafficGenerator" ) func benchmarkProposalRandom(b *testing.B, arg string) { b.ReportAllo...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/trafficGenerator/proposer.go
pkg/infra/trafficGenerator/proposer.go
package trafficGenerator import ( "context" "errors" "github.com/hyperledger-twgc/tape/pkg/infra/basic" "github.com/hyperledger/fabric-protos-go-apiv2/peer" log "github.com/sirupsen/logrus" ) type Proposers struct { workers [][]*Proposer logger *log.Logger ctx context.Context signed []chan *b...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/trafficGenerator/policyHandler_test.go
pkg/infra/trafficGenerator/policyHandler_test.go
package trafficGenerator_test import ( "github.com/hyperledger-twgc/tape/pkg/infra/basic" "github.com/hyperledger-twgc/tape/pkg/infra/trafficGenerator" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) const org1 = "org1" const org2 = "org2" var _ = Describe("PolicyHandler", func() { It("should pass wh...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/trafficGenerator/broadcaster.go
pkg/infra/trafficGenerator/broadcaster.go
package trafficGenerator import ( "context" "io" "github.com/hyperledger-twgc/tape/pkg/infra" "github.com/hyperledger-twgc/tape/pkg/infra/basic" "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/pkg/errors" log "github.com/sirupsen/logr...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/trafficGenerator/trafficGenerator_suite_test.go
pkg/infra/trafficGenerator/trafficGenerator_suite_test.go
package trafficGenerator_test import ( "testing" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) func TestTrafficGenerator(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "TrafficGenerator Suite") }
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/trafficGenerator/proposal.go
pkg/infra/trafficGenerator/proposal.go
package trafficGenerator import ( "bytes" "fmt" "math" "math/rand" "regexp" "strconv" "strings" "time" "unicode/utf8" "github.com/hyperledger-twgc/tape/internal/fabric/protoutil" "github.com/hyperledger-twgc/tape/pkg/infra" "github.com/hyperledger-twgc/tape/pkg/infra/basic" "github.com/opentracing/opentr...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/trafficGenerator/initiator_test.go
pkg/infra/trafficGenerator/initiator_test.go
package trafficGenerator_test import ( "os" "time" "github.com/hyperledger-twgc/tape/e2e" "github.com/hyperledger-twgc/tape/pkg/infra/basic" "github.com/hyperledger-twgc/tape/pkg/infra/trafficGenerator" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" log "github.com/sirupsen/logrus" ) var _ = Descr...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/cmdImpl/processTemplate.go
pkg/infra/cmdImpl/processTemplate.go
package cmdImpl import ( "context" "io" "github.com/hyperledger-twgc/tape/pkg/infra/basic" "github.com/hyperledger-twgc/tape/pkg/infra/observer" "github.com/hyperledger-twgc/tape/pkg/infra/trafficGenerator" "github.com/opentracing/opentracing-go" log "github.com/sirupsen/logrus" ) type CmdConfig struct { Fi...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/cmdImpl/fullProcess.go
pkg/infra/cmdImpl/fullProcess.go
package cmdImpl import ( "fmt" "net/http" "os" "os/signal" "syscall" "time" "github.com/hyperledger-twgc/tape/pkg/infra" "github.com/hyperledger-twgc/tape/pkg/infra/basic" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" log "github.com/sirupsen/log...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/pkg/infra/cmdImpl/version.go
pkg/infra/cmdImpl/version.go
package cmdImpl import ( "fmt" "runtime" ) const ( programName = "tape" ) var ( Version string = "latest" CommitSHA string = "development build" BuiltTime string = "Mon Dec 21 19:00:00 2020" ) // GetVersionInfo return version information // TODO add commit hash, Built info func GetVersionInfo() string { re...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/cmd/tape/main.go
cmd/tape/main.go
package main import ( "fmt" "os" "github.com/hyperledger-twgc/tape/pkg/infra" "github.com/hyperledger-twgc/tape/pkg/infra/cmdImpl" "github.com/pkg/errors" log "github.com/sirupsen/logrus" kingpin "gopkg.in/alecthomas/kingpin.v2" ) const ( loglevel = "TAPE_LOGLEVEL" logfilename = ...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/e2e/bad_test.go
e2e/bad_test.go
package e2e_test import ( "os" "os/exec" "github.com/hyperledger-twgc/tape/e2e" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gbytes" "github.com/onsi/gomega/gexec" ) var _ = Describe("Mock test for error input", func() { Context("E2E with Error Cases", func() { When("C...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/e2e/e2e_version_cmd_test.go
e2e/e2e_version_cmd_test.go
package e2e_test import ( "os/exec" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gbytes" "github.com/onsi/gomega/gexec" ) var _ = Describe("Mock test for version", func() { Context("E2E with correct subcommand", func() { When("Version subcommand", func() { It("should...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/e2e/commitOnly_test.go
e2e/commitOnly_test.go
package e2e_test import ( "os" "os/exec" "github.com/hyperledger-twgc/tape/e2e" "github.com/hyperledger-twgc/tape/e2e/mock" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gbytes" "github.com/onsi/gomega/gexec" ) var _ = Describe("Mock test for good path", func() { Conte...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/e2e/single_peer_test.go
e2e/single_peer_test.go
package e2e_test import ( "crypto/tls" "crypto/x509" "net/http" "os" "os/exec" "github.com/hyperledger-twgc/tape/e2e" "github.com/hyperledger-twgc/tape/e2e/mock" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gbytes" "github.com/onsi/gomega/gexec" "google.golang.org/gr...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/e2e/util.go
e2e/util.go
package e2e import ( "crypto/ecdsa" "crypto/elliptic" "crypto/rand" "crypto/x509" "encoding/pem" "math/big" "net" "os" "text/template" "time" ) type NodeSpec struct { Addr string MtlsCrt string MtlsKey string Mtls bool } type Values struct { PrivSk string SignCert string MtlsCr...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/e2e/e2e_suite_test.go
e2e/e2e_suite_test.go
package e2e_test import ( "os" "testing" "github.com/hyperledger-twgc/tape/e2e" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/gexec" ) var ( mtlsCertFile, mtlsKeyFile, PolicyFile *os.File tmpDir, tapeBin string tapeSession *g...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/e2e/multi_peer_test.go
e2e/multi_peer_test.go
package e2e_test import ( "os" "os/exec" "github.com/hyperledger-twgc/tape/e2e" "github.com/hyperledger-twgc/tape/e2e/mock" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gbytes" "github.com/onsi/gomega/gexec" ) var _ = Describe("Mock test for good path", func() { Conte...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/e2e/endorsementOnly_test.go
e2e/endorsementOnly_test.go
package e2e_test import ( "os" "os/exec" "github.com/hyperledger-twgc/tape/e2e" "github.com/hyperledger-twgc/tape/e2e/mock" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gbytes" "github.com/onsi/gomega/gexec" ) var _ = Describe("Mock test for good path", func() { Conte...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/e2e/TrafficAndObserver_test.go
e2e/TrafficAndObserver_test.go
package e2e_test import ( "os" "os/exec" "github.com/hyperledger-twgc/tape/e2e" "github.com/hyperledger-twgc/tape/e2e/mock" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gbytes" "github.com/onsi/gomega/gexec" ) var _ = Describe("Mock test for good path", func() { Conte...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/e2e/mock/peer.go
e2e/mock/peer.go
package mock import ( "context" "net" "github.com/hyperledger/fabric-protos-go-apiv2/peer" "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) type Peer struct { Listener net.Listener GrpcServer *grpc.Server BlkSize, txCnt uint64 TxC chan struct{} ctlCh chan bool }...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/e2e/mock/orderer.go
e2e/mock/orderer.go
package mock import ( "fmt" "io" "net" "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) type Orderer struct { Listener net.Listener GrpcServer *grpc.Server cnt uint64 TxCs...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/e2e/mock/server.go
e2e/mock/server.go
package mock import ( "google.golang.org/grpc/credentials" ) type Server struct { peers []*Peer orderer *Orderer } // this is the channel size for mock server, peer and orderer // when use or send tx to mock server/peer/orderer // try not over this size to avoid hang up or over size const MockTxSize = 1000 fun...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/internal/fabric/bccsp/utils/ecdsa.go
internal/fabric/bccsp/utils/ecdsa.go
/* Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package utils import ( "crypto/ecdsa" "crypto/elliptic" "encoding/asn1" "errors" "fmt" "math/big" ) type ECDSASignature struct { R, S *big.Int } var ( // curveHalfOrders contains the precomputed curve group orders halved. /...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/internal/fabric/bccsp/utils/keys.go
internal/fabric/bccsp/utils/keys.go
/* Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package utils import ( "crypto/ecdsa" "crypto/x509" "encoding/pem" "errors" "fmt" ) // DERToPrivateKey unmarshals a der to private key func DERToPrivateKey(der []byte) (key interface{}, err error) { if key, err = x509.ParsePKCS...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/internal/fabric/common/crypto/random.go
internal/fabric/common/crypto/random.go
/* Copyright IBM Corp. 2016 All Rights Reserved. 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 wri...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/internal/fabric/core/comm/creds.go
internal/fabric/core/comm/creds.go
/* Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package comm import ( "context" "crypto/tls" "net" "github.com/pkg/errors" "google.golang.org/grpc/credentials" ) var ErrServerHandshakeNotImplemented = errors.New("core/comm: server handshakes are not implemented with clientCr...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/internal/fabric/core/comm/client.go
internal/fabric/core/comm/client.go
/* Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package comm import ( "crypto/tls" "crypto/x509" "time" grpc_opentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing" opentracing "github.com/opentracing/opentracing-go" "github.com/pkg/errors" "google.g...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/internal/fabric/core/comm/config.go
internal/fabric/core/comm/config.go
/* Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package comm import ( "crypto/x509" "time" "google.golang.org/grpc" ) // Configuration defaults var ( // Max send and receive bytes for grpc clients and servers MaxRecvMsgSize = 100 * 1024 * 1024 MaxSendMsgSize = 100 * 1024 * ...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/internal/fabric/core/comm/util.go
internal/fabric/core/comm/util.go
/* Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package comm import ( "crypto/x509" "encoding/pem" ) // AddPemToCertPool adds PEM-encoded certs to a cert pool func AddPemToCertPool(pemCerts []byte, pool *x509.CertPool) error { certs, _, err := pemToX509Certs(pemCerts) if err !...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/internal/fabric/protoutil/commonutils.go
internal/fabric/protoutil/commonutils.go
/* Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package protoutil import ( "crypto/rand" "time" "github.com/golang/protobuf/ptypes/timestamp" cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/pkg/errors" "google.golang.org/protobuf/proto" ) // MarshalOrP...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/internal/fabric/protoutil/txutils.go
internal/fabric/protoutil/txutils.go
/* Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package protoutil import ( "bytes" "crypto/sha256" "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/pkg/errors" "google.golang.org/protobuf/proto" ) // Get...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/internal/fabric/protoutil/proputils.go
internal/fabric/protoutil/proputils.go
/* Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package protoutil import ( "crypto/sha256" "encoding/hex" "time" "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/pkg/errors" "google.golang.org/protobuf/p...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
Hyperledger-TWGC/tape
https://github.com/Hyperledger-TWGC/tape/blob/ef65cc6c14e3fdf5d47d919d2be880c1817efb56/internal/fabric/protoutil/unmarshalers.go
internal/fabric/protoutil/unmarshalers.go
/* Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package protoutil import ( "github.com/hyperledger/fabric-protos-go-apiv2/common" cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/pkg/errors" "google.gola...
go
Apache-2.0
ef65cc6c14e3fdf5d47d919d2be880c1817efb56
2026-01-07T10:05:21.922186Z
false
mactat/framed
https://github.com/mactat/framed/blob/4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7/framed.go
framed.go
/* Copyright © 2023 Maciej Tatarski maciektatarski@gmail.com */ package main import "framed/cmd" func main() { cmd.Execute() }
go
MIT
4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7
2026-01-07T10:05:21.947025Z
false
mactat/framed
https://github.com/mactat/framed/blob/4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7/pkg/ext/network.go
pkg/ext/network.go
package ext import ( "io" "net/http" "os" ) func ExampleToUrl(example string) string { return "https://raw.githubusercontent.com/mactat/framed/master/examples/" + example + ".yaml" } func ImportFromUrl(path string, url string) error { // Get the data resp, err := http.Get(url) if err != nil { return err } ...
go
MIT
4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7
2026-01-07T10:05:21.947025Z
false
mactat/framed
https://github.com/mactat/framed/blob/4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7/pkg/ext/printer.go
pkg/ext/printer.go
package ext import ( "fmt" "os" "strings" "github.com/TwiN/go-color" ) func PrintOut(prompt string, text string) { fmt.Printf("%-35s %-35s\n", prompt, text) } // This is ugly but it works, it needs to be refactored. It also has some bugs in case of out of order directories. func VisualizeTemplate(template []Si...
go
MIT
4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7
2026-01-07T10:05:21.947025Z
false
mactat/framed
https://github.com/mactat/framed/blob/4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7/pkg/ext/decoder.go
pkg/ext/decoder.go
package ext import ( "fmt" "os" "github.com/creasty/defaults" "gopkg.in/yaml.v3" ) // SingleDir struct type SingleDir struct { Name string `yaml:"name"` Path string `yaml:"path"` Files *[]string `yaml:"files"` Dirs *[]SingleDir `yaml:"dirs"` ...
go
MIT
4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7
2026-01-07T10:05:21.947025Z
false
mactat/framed
https://github.com/mactat/framed/blob/4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7/pkg/ext/system.go
pkg/ext/system.go
package ext import ( "errors" "fmt" "log" "os" "path/filepath" "regexp" "strings" ) func CreateDir(path string) { // Create directory if _, err := os.Stat(path); errors.Is(err, os.ErrNotExist) { err := os.Mkdir(path, os.ModePerm) fmt.Printf("%-35s %-35s\n", "📂 Creating directory ==> ", path) if err !=...
go
MIT
4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7
2026-01-07T10:05:21.947025Z
false
mactat/framed
https://github.com/mactat/framed/blob/4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7/pkg/ext/encoder.go
pkg/ext/encoder.go
package ext import ( "fmt" "os" "strings" "gopkg.in/yaml.v3" ) // Consider implementing a custom Unmarshaler for SingleDirOut type SingleDirOut struct { Name string `yaml:"name"` Path string `yaml:"-"` Files *[]string `yaml:"files,omitempty"` Dirs...
go
MIT
4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7
2026-01-07T10:05:21.947025Z
false
mactat/framed
https://github.com/mactat/framed/blob/4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7/cmd/verify.go
cmd/verify.go
/* Copyright © 2023 Maciej Tatarski maciektatarski@gmail.com */ // Package cmd represents the command line interface of the application package cmd import ( "fmt" "framed/pkg/ext" "os" "github.com/spf13/cobra" ) // testCmd represents the test command var testCmd = &cobra.Command{ Use: "verify", Short: "Veri...
go
MIT
4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7
2026-01-07T10:05:21.947025Z
false
mactat/framed
https://github.com/mactat/framed/blob/4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7/cmd/root.go
cmd/root.go
/* Copyright © 2023 Maciej Tatarski maciektatarski@gmail.com */ // Package cmd represents the command line interface of the application package cmd import ( "os" "github.com/spf13/cobra" ) // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ Use: "framed", S...
go
MIT
4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7
2026-01-07T10:05:21.947025Z
false
mactat/framed
https://github.com/mactat/framed/blob/4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7/cmd/create.go
cmd/create.go
/* Copyright © 2023 Maciej Tatarski maciektatarski@gmail.com */ // Package cmd represents the command line interface of the application package cmd import ( "framed/pkg/ext" "github.com/spf13/cobra" ) // createCmd represents the create command var createCmd = &cobra.Command{ Use: "create", Short: "Create a ne...
go
MIT
4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7
2026-01-07T10:05:21.947025Z
false
mactat/framed
https://github.com/mactat/framed/blob/4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7/cmd/visualize.go
cmd/visualize.go
/* Copyright © 2023 Maciej Tatarski maciektatarski@gmail.com */ // Package cmd represents the command line interface of the application package cmd import ( "framed/pkg/ext" "github.com/spf13/cobra" ) // visualizeCmd represents the visualize command var visualizeCmd = &cobra.Command{ Use: "visualize", Short: ...
go
MIT
4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7
2026-01-07T10:05:21.947025Z
false
mactat/framed
https://github.com/mactat/framed/blob/4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7/cmd/capture.go
cmd/capture.go
/* Copyright © 2023 Maciej Tatarski maciektatarski@gmail.com */ // Package cmd represents the command line interface of the application package cmd import ( "fmt" "framed/pkg/ext" "os" "strconv" "github.com/spf13/cobra" ) // captureCmd represents the capture command var captureCmd = &cobra.Command{ Use: "c...
go
MIT
4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7
2026-01-07T10:05:21.947025Z
false
mactat/framed
https://github.com/mactat/framed/blob/4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7/cmd/import.go
cmd/import.go
/* Copyright © 2023 Maciej Tatarski maciektatarski@gmail.com */ // Package cmd represents the command line interface of the application package cmd import ( "framed/pkg/ext" "os" "github.com/spf13/cobra" ) // importCmd represents the import command var importCmd = &cobra.Command{ Use: "import", Short: "Impor...
go
MIT
4f18db334ce43b065a4e82dd04ccbbe3fbb7f3f7
2026-01-07T10:05:21.947025Z
false
nafey/minimalytics
https://github.com/nafey/minimalytics/blob/d6447eaff2caadf94db1fd7225acb6707f9a9405/main.go
main.go
package main import ( "minim/cmd" "github.com/jxskiss/mcli" _ "github.com/mattn/go-sqlite3" ) func main() { // cmd.Setup() cmd.Init() mcli.Add("version", cmd.CmdVersion, "View the version details") mcli.Add("status", cmd.CmdStatus, "View the status") mcli.AddGroup("server", "Commands for managing Minimalyt...
go
MIT
d6447eaff2caadf94db1fd7225acb6707f9a9405
2026-01-07T10:05:21.899121Z
false
nafey/minimalytics
https://github.com/nafey/minimalytics/blob/d6447eaff2caadf94db1fd7225acb6707f9a9405/cmd/cmd.go
cmd/cmd.go
package cmd import ( "errors" "fmt" "io/fs" "log" "minim/model" "os" "os/exec" "path/filepath" "strconv" "strings" _ "github.com/mattn/go-sqlite3" ) type Message struct { Event string } type Response struct { Status string `json:"status"` Message string `json:"message"` Data any `json:"data,om...
go
MIT
d6447eaff2caadf94db1fd7225acb6707f9a9405
2026-01-07T10:05:21.899121Z
false
nafey/minimalytics
https://github.com/nafey/minimalytics/blob/d6447eaff2caadf94db1fd7225acb6707f9a9405/cmd/server.go
cmd/server.go
package cmd import ( "encoding/json" "errors" "fmt" "io" "log" "minim/api" "minim/model" "net/http" "os" "path/filepath" "strconv" "syscall" "time" "github.com/gorilla/mux" "github.com/natefinch/lumberjack" ) func isServerRunning() (bool, error) { pid, err := readPID() if err != nil { return false...
go
MIT
d6447eaff2caadf94db1fd7225acb6707f9a9405
2026-01-07T10:05:21.899121Z
false
nafey/minimalytics
https://github.com/nafey/minimalytics/blob/d6447eaff2caadf94db1fd7225acb6707f9a9405/model/graphs.go
model/graphs.go
package model import ( "database/sql" "errors" "time" // "minimalytics/model" ) type Graph struct { Id int64 `json:"id"` DashboardId int64 `json:"dashboardId"` Name string `json:"name"` Event string `json:"event"` Period string `json:"period"` Length int64 `json:"length"` ...
go
MIT
d6447eaff2caadf94db1fd7225acb6707f9a9405
2026-01-07T10:05:21.899121Z
false
nafey/minimalytics
https://github.com/nafey/minimalytics/blob/d6447eaff2caadf94db1fd7225acb6707f9a9405/model/config.go
model/config.go
package model import ( "time" ) type Config struct { Id int64 Key string Value string CreatedOn string } func InitConfig() error { query := ` CREATE TABLE IF NOT EXISTS config ( id INTEGER PRIMARY KEY AUTOINCREMENT, key TEXT, value TEXT, createdOn TEXT );` _, err := db.Exec(qu...
go
MIT
d6447eaff2caadf94db1fd7225acb6707f9a9405
2026-01-07T10:05:21.899121Z
false
nafey/minimalytics
https://github.com/nafey/minimalytics/blob/d6447eaff2caadf94db1fd7225acb6707f9a9405/model/dash.go
model/dash.go
package model import ( "database/sql" "errors" "time" ) type Dashboard struct { Id int64 `json:"id"` Name string `json:"name"` CreatedOn string `json:"createdOn"` } type DashboardGet struct { Id int64 `json:"id"` Name string `json:"name"` CreatedOn string `json:"createdOn"` Gra...
go
MIT
d6447eaff2caadf94db1fd7225acb6707f9a9405
2026-01-07T10:05:21.899121Z
false
nafey/minimalytics
https://github.com/nafey/minimalytics/blob/d6447eaff2caadf94db1fd7225acb6707f9a9405/model/events.go
model/events.go
package model import ( "fmt" "log" "time" ) type EventRow struct { Time int64 Count int64 } type TimeStat struct { Time int64 `json:"time"` Count int64 `json:"count"` } type EventDef struct { Id string `json:"id"` Event string `json:"event"` LastSeen *string `json:"lastSeen"` } func InitEven...
go
MIT
d6447eaff2caadf94db1fd7225acb6707f9a9405
2026-01-07T10:05:21.899121Z
false
nafey/minimalytics
https://github.com/nafey/minimalytics/blob/d6447eaff2caadf94db1fd7225acb6707f9a9405/model/common.go
model/common.go
package model import ( "database/sql" "errors" "fmt" "io/fs" "log" "os" "path/filepath" ) var didInit bool = false var db *sql.DB func exists(path string) (bool, error) { _, err := os.Stat(path) if err == nil { return true, nil } if errors.Is(err, fs.ErrNotExist) { return false, nil } return false, ...
go
MIT
d6447eaff2caadf94db1fd7225acb6707f9a9405
2026-01-07T10:05:21.899121Z
false
nafey/minimalytics
https://github.com/nafey/minimalytics/blob/d6447eaff2caadf94db1fd7225acb6707f9a9405/api/api.go
api/api.go
package api import ( "bytes" "encoding/json" "errors" "io" "log" "minim/model" "net/http" "strconv" "strings" ) type Message struct { Event string } type Response struct { Status string `json:"status"` Message string `json:"message"` Data any `json:"data,omitempty"` } type StatRequest struct { ...
go
MIT
d6447eaff2caadf94db1fd7225acb6707f9a9405
2026-01-07T10:05:21.899121Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/cmd/script/main.go
cmd/script/main.go
package main import ( "flag" "fmt" "github.com/threagile/threagile/pkg/risks/script" "github.com/threagile/threagile/pkg/types" "gopkg.in/yaml.v3" "os" "path/filepath" "strings" ) func main() { var scriptFilename string flag.StringVar(&scriptFilename, "script", "", "script file") flag.Parse() if len(scr...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/cmd/threagile/main_test.go
cmd/threagile/main_test.go
package main import ( "encoding/json" "fmt" "github.com/akedrou/textdiff" "github.com/threagile/threagile/pkg/input" "os" "path/filepath" "sort" "strings" "testing" ) func TestParseModelYaml(t *testing.T) { flatModelFile := filepath.Join("..", "..", "test", "all.yaml") flatModel := *new(input.Model).Defaul...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/cmd/threagile/main.go
cmd/threagile/main.go
package main import ( "github.com/threagile/threagile/internal/threagile" ) var ( buildTimestamp = "" ) func main() { new(threagile.Threagile).Init(buildTimestamp).Execute() }
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/cmd/risk_demo/main.go
cmd/risk_demo/main.go
package main import ( "bufio" "flag" "fmt" "gopkg.in/yaml.v3" "io" "os" "github.com/threagile/threagile/pkg/model" "github.com/threagile/threagile/pkg/types" ) type customRiskRule string func main() { getInfo := flag.Bool("get-info", false, "get rule info") generateRisks := flag.Bool("generate-risks", fal...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/internal/threagile/server.go
internal/threagile/server.go
package threagile import ( "github.com/spf13/cobra" "github.com/threagile/threagile/pkg/risks" "github.com/threagile/threagile/pkg/server" ) func (what *Threagile) initServer() *Threagile { serverCmd := &cobra.Command{ Use: "server", Short: "Run server", RunE: func(cmd *cobra.Command, args []string) error...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/internal/threagile/print.go
internal/threagile/print.go
package threagile import ( "fmt" "os" "path/filepath" "github.com/spf13/cobra" ) func (what *Threagile) initPrint() *Threagile { what.rootCmd.AddCommand(&cobra.Command{ Use: Print3rdPartyCommand, Short: "Print 3rd-party license information", Long: "\n" + Logo + "\n\n" + fmt.Sprintf(VersionText, what.bu...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/internal/threagile/analyze.go
internal/threagile/analyze.go
package threagile import ( "fmt" "github.com/spf13/cobra" "github.com/threagile/threagile/pkg/model" "github.com/threagile/threagile/pkg/report" "github.com/threagile/threagile/pkg/risks" ) func (what *Threagile) initAnalyze() *Threagile { analyze := &cobra.Command{ Use: AnalyzeModelCommand, Short: "...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/internal/threagile/version.go
internal/threagile/version.go
package threagile import ( "fmt" "github.com/spf13/cobra" ) func (what *Threagile) initVersion() *Threagile { what.rootCmd.AddCommand(&cobra.Command{ Use: PrintVersionCommand, Short: "Get version information", Long: "\n" + Logo + "\n\n" + fmt.Sprintf(VersionText, what.buildTimestamp), }) return what }...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/internal/threagile/attractiveness.go
internal/threagile/attractiveness.go
package threagile type Attractiveness struct { Quantity int `json:"quantity,omitempty" yaml:"quantity"` Confidentiality AttackerFocus `json:"confidentiality" yaml:"confidentiality"` Integrity AttackerFocus `json:"integrity" yaml:"integrity"` Availability AttackerFocus `json:"availability"...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/internal/threagile/import.go
internal/threagile/import.go
package threagile import ( "fmt" "github.com/spf13/cobra" "github.com/threagile/threagile/pkg/model" "github.com/threagile/threagile/pkg/report" "github.com/threagile/threagile/pkg/risks" ) func (what *Threagile) initImport() *Threagile { analyze := &cobra.Command{ Use: ImportModelCommand, Short: "Imp...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/internal/threagile/consts.go
internal/threagile/consts.go
package threagile const ( TempDir = "/dev/shm" AppDir = "/app" PluginDir = "/app" DataDir = "/data" OutputDir = "." ServerDir = "/app/server" KeyDir = "keys" DefaultServerPort = 8080 InputFile = "threagile.yaml" ReportFilename = "report.pdf" ExcelRisksFilename ...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/internal/threagile/create.go
internal/threagile/create.go
/* Copyright © 2023 NAME HERE <EMAIL ADDRESS> */ package threagile import ( "fmt" "github.com/spf13/cobra" "github.com/threagile/threagile/pkg/examples" ) func (what *Threagile) initCreate() *Threagile { what.rootCmd.AddCommand(&cobra.Command{ Use: CreateExampleModelCommand, Short: "Create example threagi...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/internal/threagile/flags.go
internal/threagile/flags.go
/* Copyright © 2023 NAME HERE <EMAIL ADDRESS> */ package threagile const ( configFlagName = "config" verboseFlagName = "verbose" verboseFlagShorthand = "v" interactiveFlagName = "interactive" interactiveFlagShorthand = "i" appDirFlagName = "app-dir" pluginDirFlagName = "plugin-dir" dataDirFlag...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/internal/threagile/risk-excel-config.go
internal/threagile/risk-excel-config.go
package threagile type RiskExcelConfig struct { HideColumns []string `json:"HideColumns,omitempty" yaml:"HideColumns"` SortByColumns []string `json:"SortByColumns,omitempty" yaml:"SortByColumns"` WidthOfColumns map[string]float64 `json:"WidthOfColumns,omitempty" yaml:"WidthOfColu...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/internal/threagile/quit.go
internal/threagile/quit.go
package threagile import ( "os" "github.com/spf13/cobra" ) func (what *Threagile) initQuit() *Threagile { quit := &cobra.Command{ Use: QuitCommand, Short: "quit client", Aliases: []string{"exit", "bye", "x", "q"}, Run: func(cmd *cobra.Command, args []string) { what.processArgs(cmd, args) os.Ex...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/internal/threagile/explain.go
internal/threagile/explain.go
package threagile import ( "fmt" "github.com/spf13/cobra" "github.com/threagile/threagile/pkg/macros" "github.com/threagile/threagile/pkg/model" "github.com/threagile/threagile/pkg/risks" "github.com/threagile/threagile/pkg/types" ) func (what *Threagile) initExplain() *Threagile { return what.initExplainNew()...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/internal/threagile/execute.go
internal/threagile/execute.go
/* Copyright © 2023 NAME HERE <EMAIL ADDRESS> */ package threagile import ( "fmt" "github.com/spf13/cobra" "github.com/threagile/threagile/pkg/macros" "github.com/threagile/threagile/pkg/model" "github.com/threagile/threagile/pkg/risks" ) func (what *Threagile) initExecute() *Threagile { what.rootCmd.AddComm...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/internal/threagile/config.go
internal/threagile/config.go
package threagile import ( "encoding/json" "errors" "fmt" "log" "os" "path/filepath" "runtime" "strings" "gopkg.in/yaml.v3" "github.com/threagile/threagile/pkg/report" "github.com/threagile/threagile/pkg/types" ) type Config struct { ConfigGetter ConfigSetter BuildTimestampValue string `json:"BuildTi...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/internal/threagile/attacker-focus.go
internal/threagile/attacker-focus.go
package threagile type AttackerFocus struct { Asset int // fibonacci sequence base index ProcessedOrStoredData int // fibonacci sequence base index TransferredData int // fibonacci sequence base index }
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/internal/threagile/list.go
internal/threagile/list.go
package threagile import ( "fmt" "github.com/spf13/cobra" "github.com/threagile/threagile/pkg/macros" "github.com/threagile/threagile/pkg/model" "github.com/threagile/threagile/pkg/risks" "github.com/threagile/threagile/pkg/types" ) func (what *Threagile) initList() *Threagile { what.rootCmd.AddCommand(&cobra....
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/internal/threagile/progress-reporter.go
internal/threagile/progress-reporter.go
/* Copyright © 2023 NAME HERE <EMAIL ADDRESS> */ package threagile import ( "fmt" "log" ) type DefaultProgressReporter struct { Verbose bool SuppressError bool } func (r DefaultProgressReporter) Info(a ...any) { if r.Verbose { fmt.Println(a...) } } func (DefaultProgressReporter) Warn(a ...any) { fmt...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/internal/threagile/threagile.go
internal/threagile/threagile.go
package threagile import ( "os" "github.com/spf13/cobra" ) type Threagile struct { flags Flags config *Config rootCmd *cobra.Command buildTimestamp string } func (what *Threagile) Execute() { err := what.rootCmd.Execute() if err != nil { what.rootCmd.Println(err) os.Exit(1) } ...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/internal/threagile/root.go
internal/threagile/root.go
/* Copyright © 2023 NAME HERE <EMAIL ADDRESS> */ package threagile import ( "errors" "fmt" "os" "path/filepath" "strings" "github.com/chzyer/readline" "github.com/mattn/go-shellwords" "github.com/spf13/cobra" "github.com/threagile/threagile/pkg/report" ) const ( UsageTemplate = `Usage:{{if .Runnable}} ...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/report/graphviz.go
pkg/report/graphviz.go
package report import ( "fmt" "hash/fnv" "os" "os/exec" "path/filepath" "regexp" "sort" "strconv" "strings" "github.com/threagile/threagile/pkg/types" ) func WriteDataFlowDiagramGraphvizDOT(parsedModel *types.Model, diagramFilenameDOT string, dpi int, addModelTitle bool, addLegend bool, progressReporter ...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
true
Threagile/threagile
https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/report/excel-column.go
pkg/report/excel-column.go
package report import ( "github.com/xuri/excelize/v2" "strings" ) type ExcelColumns map[string]ExcelColumn func (what *ExcelColumns) GetColumns() ExcelColumns { *what = map[string]ExcelColumn{ "A": {Title: "Severity", Width: 12}, "B": {Title: "Likelihood", Width: 15}, "C": {Title: "Impact", Width: 15}, "D...
go
MIT
293892c9c3a6bb287f66b4b048d2fb1fae2d3676
2026-01-07T10:38:05.901794Z
false