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 |
|---|---|---|---|---|---|---|---|---|
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/storage/disk/snap_codec_test.go | internal/storage/disk/snap_codec_test.go | package disk
import (
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"
"github.com/shaj13/raft/internal/raftpb"
"github.com/shaj13/raft/internal/storage"
"github.com/stretchr/testify/require"
"go.etcd.io/etcd/server/v3/storage/wal/walpb"
etcdraftpb "go.etcd.io/raft/v3/raftpb"
)
func TestSnapshotCodec(t... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/storage/disk/disk_test.go | internal/storage/disk/disk_test.go | package disk
import (
"fmt"
"os"
"path/filepath"
"testing"
"github.com/shaj13/raft/raftlog"
"github.com/stretchr/testify/require"
"go.etcd.io/etcd/client/pkg/v3/fileutil"
"go.etcd.io/etcd/server/v3/storage/wal"
"go.etcd.io/etcd/server/v3/storage/wal/walpb"
"go.etcd.io/raft/v3/raftpb"
)
func TestDiskWalInte... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/storage/disk/snapshotter_test.go | internal/storage/disk/snapshotter_test.go | package disk
import (
"io/ioutil"
"testing"
"github.com/stretchr/testify/require"
)
func TestSnapshotterReaderWriter(t *testing.T) {
nils := "<nil>"
notExist := "/does-not-exist-1-2-3"
noFileDir := "no such file or directory"
callReader := func(s *snapshotter) error {
_, err := s.Reader(1, 1)
return err
... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/mocks/storage/storage.go | internal/mocks/storage/storage.go | // Code generated by MockGen. DO NOT EDIT.
// Source: internal/storage/types.go
// Package storagemock is a generated GoMock package.
package storagemock
import (
io "io"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
storage "github.com/shaj13/raft/internal/storage"
raftpb "go.etcd.io/raft/v3/raftpb"... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/mocks/membership/membership.go | internal/mocks/membership/membership.go | // Code generated by MockGen. DO NOT EDIT.
// Source: internal/membership/types.go
// Package membershipmock is a generated GoMock package.
package membershipmock
import (
context "context"
reflect "reflect"
time "time"
gomock "github.com/golang/mock/gomock"
membership "github.com/shaj13/raft/internal/membershi... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/mocks/raftengine/engine.go | internal/mocks/raftengine/engine.go | // Code generated by MockGen. DO NOT EDIT.
// Source: internal/raftengine/engine.go
// Package raftenginemock is a generated GoMock package.
package raftenginemock
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
raftengine "github.com/shaj13/raft/internal/raftengine"
raftpb "... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/mocks/transport/transport.go | internal/mocks/transport/transport.go | // Code generated by MockGen. DO NOT EDIT.
// Source: internal/transport/types.go
// Package transportmock is a generated GoMock package.
package transportmock
import (
context "context"
io "io"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
raftpb "github.com/shaj13/raft/internal/raftpb"
transport "... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/membership/local.go | internal/membership/local.go | package membership
import (
"context"
"sync/atomic"
"time"
"github.com/shaj13/raft/internal/raftpb"
"github.com/shaj13/raft/raftlog"
etcdraftpb "go.etcd.io/raft/v3/raftpb"
)
func newLocal(cfg Config, m raftpb.Member) (Member, error) {
l := &local{
r: cfg.Reporter(),
active: time.Now(),
}
_ = l.Upda... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/membership/removed.go | internal/membership/removed.go | package membership
import (
"context"
"errors"
"time"
"github.com/shaj13/raft/internal/raftpb"
etcdraftpb "go.etcd.io/raft/v3/raftpb"
)
var errRemovedMember = errors.New("raft/membership: member was removed")
func newRemoved(_ Config, m raftpb.Member) (Member, error) {
return removed{
raw: m,
}, nil
}
// ... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/membership/remote.go | internal/membership/remote.go | package membership
import (
"context"
"errors"
"fmt"
"sync"
"sync/atomic"
"time"
"github.com/shaj13/raft/internal/raftpb"
"github.com/shaj13/raft/internal/transport"
"github.com/shaj13/raft/raftlog"
"go.etcd.io/raft/v3"
etcdraftpb "go.etcd.io/raft/v3/raftpb"
)
func newRemote(cfg Config, m raftpb.Member) (... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/membership/types_test.go | internal/membership/types_test.go | // Code generated by MockGen. DO NOT EDIT.
// Source: internal/membership/types.go
// Package membership is a generated GoMock package.
package membership
import (
context "context"
reflect "reflect"
time "time"
gomock "github.com/golang/mock/gomock"
raftpb "github.com/shaj13/raft/internal/raftpb"
transport "g... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/membership/pool_test.go | internal/membership/pool_test.go | package membership
import (
"context"
"testing"
"time"
"github.com/golang/mock/gomock"
"github.com/shaj13/raft/internal/raftpb"
"github.com/shaj13/raft/internal/transport"
"github.com/shaj13/raft/raftlog"
"github.com/stretchr/testify/require"
)
func TestPoolPurge(t *testing.T) {
p := &pool{
membs: map[uin... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/membership/types.go | internal/membership/types.go | package membership
import (
"context"
"time"
"github.com/shaj13/raft/internal/raftpb"
"github.com/shaj13/raft/internal/transport"
"github.com/shaj13/raft/raftlog"
"go.etcd.io/raft/v3"
etcdraftpb "go.etcd.io/raft/v3/raftpb"
)
//go:generate mockgen -package membershipmock -source internal/membership/types.go -... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/membership/removed_test.go | internal/membership/removed_test.go | package membership
import (
"testing"
"time"
"github.com/shaj13/raft/internal/raftpb"
"github.com/stretchr/testify/require"
etcdraftpb "go.etcd.io/raft/v3/raftpb"
)
func TestRemoved(t *testing.T) {
addr := ":50051"
id := uint64(1)
r := removed{
raw: raftpb.Member{
ID: id,
Address: addr,
},
}
... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/membership/pool.go | internal/membership/pool.go | package membership
import (
"context"
"fmt"
"math/rand"
"sync"
"time"
"github.com/shaj13/raft/internal/raftpb"
"github.com/shaj13/raft/raftlog"
"golang.org/x/sync/errgroup"
)
func init() {
rand.Seed(time.Now().UnixNano())
}
// New construct and returns a new pool members.
func New(cfg Config) Pool {
retur... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/membership/remote_test.go | internal/membership/remote_test.go | package membership
import (
"context"
"fmt"
"testing"
"time"
"github.com/golang/mock/gomock"
transportmock "github.com/shaj13/raft/internal/mocks/transport"
"github.com/shaj13/raft/internal/raftpb"
"github.com/shaj13/raft/raftlog"
"github.com/stretchr/testify/require"
"go.etcd.io/raft/v3"
etcdraftpb "go.et... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/membership/local_test.go | internal/membership/local_test.go | package membership
import (
"testing"
"time"
"github.com/shaj13/raft/internal/raftpb"
"github.com/stretchr/testify/require"
etcdraftpb "go.etcd.io/raft/v3/raftpb"
)
func TestLocal(t *testing.T) {
addr := ":8080"
id := uint64(1)
raw := raftpb.Member{ID: 2}
l := local{}
l.raw.Store(raftpb.Member{
ID: ... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/raftengine/types_test.go | internal/raftengine/types_test.go | // Code generated by MockGen. DO NOT EDIT.
// Source: internal/raftengine/types.go
// Package raftengine is a generated GoMock package.
package raftengine
import (
context "context"
io "io"
reflect "reflect"
time "time"
gomock "github.com/golang/mock/gomock"
membership "github.com/shaj13/raft/internal/membersh... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/raftengine/types.go | internal/raftengine/types.go | package raftengine
import (
"context"
"fmt"
"io"
"time"
"github.com/shaj13/raft/internal/membership"
"github.com/shaj13/raft/internal/raftpb"
"github.com/shaj13/raft/internal/storage"
"github.com/shaj13/raft/internal/transport"
"github.com/shaj13/raft/raftlog"
"go.etcd.io/raft/v3"
etcdraftpb "go.etcd.io/ra... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/raftengine/node_test.go | internal/raftengine/node_test.go | // Code generated by MockGen. DO NOT EDIT.
// Source: vendor/go.etcd.io/raft/v3/node.go
// Package raftengine is a generated GoMock package.
package raftengine
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
raft "go.etcd.io/raft/v3"
raftpb "go.etcd.io/raft/v3/raftpb"
)
// M... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/raftengine/mux_test.go | internal/raftengine/mux_test.go | package raftengine
import (
"context"
"testing"
"time"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/require"
"go.etcd.io/etcd/pkg/v3/pbutil"
"go.etcd.io/raft/v3"
etcdraftpb "go.etcd.io/raft/v3/raftpb"
)
const testGroupID = uint64(1)
func TestMuxOp(t *testing.T) {
table := []struct {
fn fu... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/raftengine/engine_test.go | internal/raftengine/engine_test.go | package raftengine
import (
"context"
"encoding/binary"
"errors"
"testing"
"time"
"github.com/gogo/protobuf/types"
"github.com/golang/mock/gomock"
"github.com/shaj13/raft/internal/atomic"
"github.com/shaj13/raft/internal/membership"
membershipmock "github.com/shaj13/raft/internal/mocks/membership"
storagem... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/raftengine/operator.go | internal/raftengine/operator.go | package raftengine
import (
"context"
"errors"
"fmt"
"math/rand"
"sort"
"time"
"github.com/gogo/protobuf/types"
"github.com/shaj13/raft/internal/raftpb"
"github.com/shaj13/raft/internal/storage"
"go.etcd.io/etcd/pkg/v3/pbutil"
"go.etcd.io/raft/v3"
etcdraftpb "go.etcd.io/raft/v3/raftpb"
)
// order define ... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/raftengine/engine.go | internal/raftengine/engine.go | package raftengine
import (
"context"
"encoding/binary"
"errors"
"fmt"
"sync"
"time"
"github.com/gogo/protobuf/types"
"github.com/shaj13/raft/internal/atomic"
"github.com/shaj13/raft/internal/membership"
"github.com/shaj13/raft/internal/msgbus"
"github.com/shaj13/raft/internal/raftpb"
"github.com/shaj13/r... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/raftengine/mux.go | internal/raftengine/mux.go | package raftengine
import (
"context"
"encoding/json"
"github.com/shaj13/raft/raftlog"
"go.etcd.io/raft/v3"
etcdraftpb "go.etcd.io/raft/v3/raftpb"
)
const (
// add nodeState into the multiplexer.
add operationType = iota
// remove nodeState from the multiplexer.
remove
// call a method on raft raw node.
c... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/raftengine/operator_test.go | internal/raftengine/operator_test.go | package raftengine
import (
"context"
"fmt"
"testing"
"github.com/golang/mock/gomock"
membershipmock "github.com/shaj13/raft/internal/mocks/membership"
storagemock "github.com/shaj13/raft/internal/mocks/storage"
transportmock "github.com/shaj13/raft/internal/mocks/transport"
"github.com/shaj13/raft/internal/... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/msgbus/msgbus_test.go | internal/msgbus/msgbus_test.go | package msgbus
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestMsgBus(t *testing.T) {
eventid := uint64(1)
onceid := uint64(2)
val := "some value"
m := New()
s1 := m.Subscribe(eventid)
s2 := m.SubscribeOnce(onceid)
defer m.Close()
run := func(id uint64, s1, s2 *Subscription) bo... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/msgbus/msgbus.go | internal/msgbus/msgbus.go | package msgbus
import (
"math/rand"
"sync"
"time"
"go.etcd.io/etcd/pkg/v3/idutil"
)
// New create a new msgbus.
func New() *MsgBus {
id := rand.Int63() + 1
idgen := idutil.NewGenerator(uint16(id), time.Now())
return &MsgBus{
subid: idgen,
events: map[uint64]map[uint64]*Subscription{},
}
}
// MsgBus is ... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/atomic/atomic.go | internal/atomic/atomic.go | package atomic
import (
"strconv"
"sync/atomic"
)
// NewBool create new atomic type-safe bool.
func NewBool() *Bool {
return new(Bool)
}
//NewUint64 create new atomic type-safe uint64
func NewUint64() *Uint64 {
return new(Uint64)
}
// Bool is an atomic type-safe wrapper for bool values.
type Bool uint32
// Set... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/transport/types.go | internal/transport/types.go | package transport
import (
"context"
"io"
"github.com/shaj13/raft/internal/raftpb"
"github.com/shaj13/raft/raftlog"
etcdraftpb "go.etcd.io/raft/v3/raftpb"
)
//go:generate mockgen -package transportmock -source internal/transport/types.go -destination internal/mocks/transport/transport.go
// Config define comm... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/transport/proto.go | internal/transport/proto.go | package transport
import (
"strconv"
)
const (
// GRPC represents raft transportation using gRPC.
GRPC Proto = iota + 1
// HTTP represents raft transportation using http.
HTTP
max
)
var registry = make([]*protoPair, max)
type protoPair struct {
nh NewHandler
dial Dialer
}
// Proto is a portmanteau of pro... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/transport/rafthttp/client.go | internal/transport/rafthttp/client.go | package rafthttp
import (
"bytes"
"context"
"fmt"
"io"
"net/http"
"strconv"
"strings"
"sync"
"github.com/shaj13/raft/internal/raftpb"
"github.com/shaj13/raft/internal/transport"
"go.etcd.io/etcd/pkg/v3/pbutil"
etcdraftpb "go.etcd.io/raft/v3/raftpb"
)
const (
snapshotHeader = "X-Raft-Snapshot"
groupIDHe... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/transport/rafthttp/http_test.go | internal/transport/rafthttp/http_test.go | //nolint:dupl
package rafthttp
import (
"bytes"
"context"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/http/httptest"
"strings"
"testing"
"github.com/golang/mock/gomock"
transportmock "github.com/shaj13/raft/internal/mocks/transport"
"github.com/shaj13/raft/internal/raftpb"
"github.com/shaj13/raft/raftlog"
"g... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/transport/rafthttp/server.go | internal/transport/rafthttp/server.go | package rafthttp
import (
"errors"
"io"
"io/ioutil"
"net/http"
"strconv"
"github.com/shaj13/raft/internal/raftpb"
"github.com/shaj13/raft/internal/transport"
"github.com/shaj13/raft/raftlog"
"go.etcd.io/etcd/pkg/v3/pbutil"
etcdraftpb "go.etcd.io/raft/v3/raftpb"
)
// NewHandlerFunc retur'ns func that create... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/transport/raftgrpc/client.go | internal/transport/raftgrpc/client.go | package raftgrpc
import (
"bytes"
"context"
"io"
"strconv"
"sync"
"github.com/shaj13/raft/internal/raftpb"
"github.com/shaj13/raft/internal/transport"
"github.com/shaj13/raft/internal/transport/raftgrpc/pb"
etcdraftpb "go.etcd.io/raft/v3/raftpb"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
)
... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/transport/raftgrpc/grpc_test.go | internal/transport/raftgrpc/grpc_test.go | //nolint:dupl
package raftgrpc
import (
"bytes"
"context"
"fmt"
"io"
"io/ioutil"
"net"
"strings"
"testing"
"github.com/golang/mock/gomock"
transportmock "github.com/shaj13/raft/internal/mocks/transport"
"github.com/shaj13/raft/internal/raftpb"
"github.com/shaj13/raft/internal/transport/raftgrpc/pb"
"gith... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/transport/raftgrpc/server.go | internal/transport/raftgrpc/server.go | package raftgrpc
import (
"bytes"
"context"
"errors"
"io"
"strconv"
"github.com/golang/protobuf/ptypes/empty"
"github.com/shaj13/raft/internal/raftpb"
"github.com/shaj13/raft/internal/transport"
"github.com/shaj13/raft/internal/transport/raftgrpc/pb"
"github.com/shaj13/raft/raftlog"
etcdraftpb "go.etcd.io/... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/transport/raftgrpc/encoding_test.go | internal/transport/raftgrpc/encoding_test.go | package raftgrpc
import (
"bufio"
"bytes"
"crypto/rand"
"fmt"
"io"
"strings"
"testing"
"github.com/shaj13/raft/internal/transport/raftgrpc/pb"
"github.com/stretchr/testify/assert"
)
func TestDecoder(t *testing.T) {
w := new(bytes.Buffer)
dec := newDecoder(w)
// Round #1 it retrun error when index mismat... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/transport/raftgrpc/encoding.go | internal/transport/raftgrpc/encoding.go | package raftgrpc
import (
"bufio"
"fmt"
"io"
"github.com/shaj13/raft/internal/transport/raftgrpc/pb"
)
func newEncoder(r io.Reader) *encoder {
e := new(encoder)
e.scanner = bufio.NewScanner(r)
e.scanner.Split(e.scan)
return e
}
func newDecoder(w io.Writer) *decoder {
return &decoder{
w: w,
}
}
type enc... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/transport/raftgrpc/pb/raft.pb.go | internal/transport/raftgrpc/pb/raft.pb.go | // Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: internal/transport/grpc/pb/raft.proto
package pb
import (
context "context"
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
empty "github.com/golang/protobuf/ptypes/empty"
raftpb "github.com/shaj13/raft/interna... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/internal/raftpb/raft.pb.go | internal/raftpb/raft.pb.go | // Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: gen/pb-go/raftpb/raft.proto
package raftpb
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
types "github.com/gogo/protobuf/types"
raftpb "go.etcd.io/raft/v3/raftpb"
io "io"
math "math"
math_bits "mat... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | true |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/_examples/raft/main.go | _examples/raft/main.go | package main
import (
"context"
"encoding/json"
"flag"
"io"
"io/ioutil"
"log"
"net"
"net/http"
"os"
"os/signal"
"strconv"
"strings"
"sync"
"time"
"github.com/gorilla/mux"
"github.com/shaj13/raft"
"github.com/shaj13/raft/transport"
"github.com/shaj13/raft/transport/raftgrpc"
"google.golang.org/grpc"... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/_examples/multiraft/main.go | _examples/multiraft/main.go | package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net"
"net/http"
"os"
"os/signal"
"path/filepath"
"strconv"
"strings"
"sync"
"time"
"github.com/gorilla/mux"
"github.com/shaj13/raft"
"github.com/shaj13/raft/raftlog"
"github.com/shaj13/raft/transport"
"github.com... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/transport/transport.go | transport/transport.go | // Package transport provides types for raft transport functions.
package transport
import "github.com/shaj13/raft/internal/transport"
const (
// GRPC represents raft transportation using gRPC.
GRPC Proto = Proto(transport.GRPC)
// HTTP represents raft transportation using http.
HTTP Proto = Proto(transport.HTTP)... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/transport/rafthttp/rafthttp.go | transport/rafthttp/rafthttp.go | // Package rafthttp implements HTTP transportation layer for raft.
package rafthttp
import (
"context"
"net/http"
itransport "github.com/shaj13/raft/internal/transport"
"github.com/shaj13/raft/internal/transport/rafthttp"
"github.com/shaj13/raft/raftlog"
"github.com/shaj13/raft/transport"
)
func init() {
Regi... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
shaj13/raft | https://github.com/shaj13/raft/blob/a5e55c36efbb0c2f01a2e978716ca32c59513cb2/transport/raftgrpc/raftgrpc.go | transport/raftgrpc/raftgrpc.go | // Package raftgrpc implements gRPC transportation layer for raft.
package raftgrpc
import (
"context"
itransport "github.com/shaj13/raft/internal/transport"
"github.com/shaj13/raft/internal/transport/raftgrpc"
"github.com/shaj13/raft/internal/transport/raftgrpc/pb"
"github.com/shaj13/raft/raftlog"
"github.com/... | go | MIT | a5e55c36efbb0c2f01a2e978716ca32c59513cb2 | 2026-01-07T09:45:49.254147Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/poodle.go | poodle.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package main
import (
"os"
"github.com/clivern/poodle/cmd"
log "github.com/sirupsen/logrus"
)
var (
version = "dev"
commit = "none"
date = "unknown"
builtBy ... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/pkg/expect.go | pkg/expect.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package pkg
import (
"reflect"
"testing"
)
// Expect compare two values for testing
func Expect(t *testing.T, got, want interface{}) {
t.Logf(`Comparing values %v, %v... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/pkg/server_mock.go | pkg/server_mock.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package pkg
import (
"net/http"
"net/http/httptest"
)
// ServerMock mocks http server
func ServerMock(uri, response string, statusCode int) *httptest.Server {
handler... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/cmd/root.go | cmd/root.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package cmd
import (
"fmt"
"os"
"github.com/clivern/poodle/core/util"
"github.com/spf13/cobra"
)
// Verbose var
var Verbose bool
// Config var
var Config string
... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/cmd/sync.go | cmd/sync.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package cmd
import (
"context"
"fmt"
"strings"
"time"
"github.com/clivern/poodle/core/model"
"github.com/clivern/poodle/core/module"
"github.com/clivern/poodle/co... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/cmd/delete.go | cmd/delete.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package cmd
import (
"context"
"fmt"
"strings"
"time"
"github.com/clivern/poodle/core/model"
"github.com/clivern/poodle/core/module"
"github.com/clivern/poodle/co... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/cmd/edit.go | cmd/edit.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package cmd
import (
"fmt"
"strings"
"github.com/clivern/poodle/core/model"
"github.com/clivern/poodle/core/module"
"github.com/clivern/poodle/core/util"
. "githu... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/cmd/call.go | cmd/call.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package cmd
import (
"fmt"
"path/filepath"
"strings"
"time"
"github.com/clivern/poodle/core/model"
"github.com/clivern/poodle/core/module"
"github.com/clivern/poo... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/cmd/license.go | cmd/license.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package cmd
import (
"fmt"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
var licenseCmd = &cobra.Command{
Use: "license",
Short: "Print the license... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/cmd/new.go | cmd/new.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package cmd
import (
"fmt"
"regexp"
"strings"
"github.com/clivern/poodle/core/model"
"github.com/clivern/poodle/core/module"
"github.com/clivern/poodle/core/util"
... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/cmd/version.go | cmd/version.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package cmd
import (
"fmt"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
var (
// Version buildinfo item
Version = "dev"
// Commit buildinfo item
C... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/cmd/configure.go | cmd/configure.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package cmd
import (
"context"
"fmt"
"os"
"github.com/clivern/poodle/core/model"
"github.com/clivern/poodle/core/module"
"github.com/clivern/poodle/core/util"
. ... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/core/util/helpers_test.go | core/util/helpers_test.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package util
import (
"testing"
"github.com/clivern/poodle/pkg"
)
// TestInArray test cases
func TestInArray(t *testing.T) {
// TestInArray
t.Run("TestInArray", fun... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/core/util/helpers.go | core/util/helpers.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package util
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"reflect"
"strings"
"time"
"github.com/araddon/dateparse"
)
// File struct
type Fi... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/core/model/service.go | core/model/service.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package model
import (
"os"
"github.com/BurntSushi/toml"
)
// Basic type
type Basic struct {
Username string `toml:"username"`
Password string `toml:"password"`... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/core/model/configs.go | core/model/configs.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package model
import (
"fmt"
"os"
"github.com/clivern/poodle/core/util"
"github.com/BurntSushi/toml"
)
// Configs type
type Configs struct {
General General `to... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/core/module/editor.go | core/module/editor.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package module
import (
"os"
"os/exec"
)
// DefaultEditor is vim because we're adults ;)
const DefaultEditor = "vim"
// Editor type
type Editor struct{}
// Edit open... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/core/module/fuzzy_finder.go | core/module/fuzzy_finder.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package module
import (
"fmt"
"os"
"os/exec"
"strings"
)
// FuzzyFinder type
type FuzzyFinder struct{}
// Available validates if fzf installed
func (f *FuzzyFinder)... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/core/module/caller_test.go | core/module/caller_test.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package module
import (
"fmt"
"strings"
"testing"
"github.com/clivern/poodle/core/model"
"github.com/clivern/poodle/pkg"
)
// TestCallerPostRequest test cases
fun... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/core/module/http_test.go | core/module/http_test.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package module
import (
"context"
"net/http"
"strings"
"testing"
"github.com/clivern/poodle/pkg"
)
// TestHttpGet test cases
func TestHttpGet(t *testing.T) {
t.Ru... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/core/module/http.go | core/module/http.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package module
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
"time"
)
// HTTPClient struct
type HTTPClient struct {
Timeout time.D... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/core/module/prompt.go | core/module/prompt.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package module
import (
"fmt"
"strings"
"github.com/manifoldco/promptui"
)
// Prompt struct
type Prompt struct {
}
// NotEmpty returns error if input is empty
func ... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/core/module/github_test.go | core/module/github_test.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package module
import (
"context"
"os"
"testing"
"github.com/clivern/poodle/pkg"
)
// TestGithub test cases
func TestGithub(t *testing.T) {
// export GITHUB_USERN... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/core/module/file_system.go | core/module/file_system.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package module
import (
"encoding/json"
"fmt"
"os"
"path/filepath"
"strings"
"github.com/clivern/poodle/core/util"
"github.com/araddon/dateparse"
)
// VFile str... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/core/module/github.go | core/module/github.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package module
import (
"context"
"encoding/json"
"fmt"
"net/http"
"strings"
)
// GithubAPI github api url
const GithubAPI = "https://api.github.com"
// Github str... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
Clivern/Poodle | https://github.com/Clivern/Poodle/blob/5972462d6208039c6dff5b9ab11c9182f603b990/core/module/caller.go | core/module/caller.go | // Copyright 2020 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package module
import (
"context"
b64 "encoding/base64"
"fmt"
"net/http"
"regexp"
"strconv"
"strings"
"time"
"github.com/clivern/poodle/core/model"
"github.com... | go | MIT | 5972462d6208039c6dff5b9ab11c9182f603b990 | 2026-01-07T09:45:47.598300Z | false |
sethvargo/terraform-provider-googlecalendar | https://github.com/sethvargo/terraform-provider-googlecalendar/blob/b8bed0ce74ec8608c1c752db57793000336fd251/main.go | main.go | package main
import (
"github.com/hashicorp/terraform-plugin-sdk/plugin"
"github.com/sethvargo/terraform-provider-googlecalendar/googlecalendar"
)
func main() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: googlecalendar.Provider,
})
}
| go | MIT | b8bed0ce74ec8608c1c752db57793000336fd251 | 2026-01-07T09:45:48.588189Z | false |
sethvargo/terraform-provider-googlecalendar | https://github.com/sethvargo/terraform-provider-googlecalendar/blob/b8bed0ce74ec8608c1c752db57793000336fd251/tools/tools.go | tools/tools.go | // Package tools includes the list of tools used in the project.
package tools
import (
_ "github.com/client9/misspell/cmd/misspell"
_ "golang.org/x/tools/cmd/goimports"
_ "honnef.co/go/tools/cmd/staticcheck"
)
| go | MIT | b8bed0ce74ec8608c1c752db57793000336fd251 | 2026-01-07T09:45:48.588189Z | false |
sethvargo/terraform-provider-googlecalendar | https://github.com/sethvargo/terraform-provider-googlecalendar/blob/b8bed0ce74ec8608c1c752db57793000336fd251/googlecalendar/resource_event.go | googlecalendar/resource_event.go | package googlecalendar
import (
"fmt"
"log"
"time"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"google.golang.org/api/calendar/v3"
)
var (
eventValidMethods = []string{"email", "popup", "sms"}
eventValidVisbilities = []string{"publi... | go | MIT | b8bed0ce74ec8608c1c752db57793000336fd251 | 2026-01-07T09:45:48.588189Z | false |
sethvargo/terraform-provider-googlecalendar | https://github.com/sethvargo/terraform-provider-googlecalendar/blob/b8bed0ce74ec8608c1c752db57793000336fd251/googlecalendar/config.go | googlecalendar/config.go | package googlecalendar
import (
"google.golang.org/api/calendar/v3"
)
// Config is the structure used to instantiate the Google Calendar provider.
type Config struct {
calendar *calendar.Service
}
| go | MIT | b8bed0ce74ec8608c1c752db57793000336fd251 | 2026-01-07T09:45:48.588189Z | false |
sethvargo/terraform-provider-googlecalendar | https://github.com/sethvargo/terraform-provider-googlecalendar/blob/b8bed0ce74ec8608c1c752db57793000336fd251/googlecalendar/provider.go | googlecalendar/provider.go | // Package googlecalendar manages Google calendar events with Terraform.
package googlecalendar
import (
"context"
"fmt"
"log"
"runtime"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
"google.golang.org/api/calendar/v3"
"google.golang.org/api/op... | go | MIT | b8bed0ce74ec8608c1c752db57793000336fd251 | 2026-01-07T09:45:48.588189Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/main.go | main.go | package main
import (
"errors"
"log"
"os"
"github.com/pivotal-cf/om/cmd"
"github.com/pivotal-cf/om/commands"
_ "github.com/pivotal-cf/om/download_clients"
)
var version = "unknown"
var applySleepDurationString = "10s"
func main() {
err := cmd.Main(os.Stdout, os.Stderr, version, applySleepDurationString, os.... | go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/extractor/constructor.go | extractor/constructor.go | package extractor
import "net/http"
type Option func(*MetadataExtractor)
type MetadataExtractor struct {
httpClient httpClient
}
func NewMetadataExtractor(options ...Option) *MetadataExtractor {
me := &MetadataExtractor{
httpClient: http.DefaultClient,
}
for _, o := range options {
o(me)
}
return me
}
| go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/extractor/from_file.go | extractor/from_file.go | package extractor
import (
"archive/zip"
"errors"
"fmt"
"io"
"regexp"
"gopkg.in/yaml.v2"
)
var metadataRegexp = regexp.MustCompile(`^(.*\/)?metadata/.*\.yml`)
func (me *MetadataExtractor) ExtractFromFile(productPath string) (*Metadata, error) {
zipReader, err := zip.OpenReader(productPath)
if err != nil {
... | go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/extractor/init_test.go | extractor/init_test.go | package extractor_test
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"testing"
)
func TestExtractor(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "extractor")
}
| go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/extractor/metadata.go | extractor/metadata.go | package extractor
type Metadata struct {
Name string `yaml:"name"`
Version string `yaml:"product_version"`
StemcellCriteria struct {
OS string `yaml:"os"`
Version string `yaml:"version"`
PatchSecurityUpdates bool `yaml:"enable_patch_security_updates"`
} `... | go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/extractor/from_url.go | extractor/from_url.go | package extractor
import (
"archive/zip"
"fmt"
"howett.net/ranger"
"net/http"
"net/url"
)
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//counterfeiter:generate -o ./fakes/httpclient.go --fake-name HttpClient . httpClient
type httpClient interface {
Do(*http.Request) (*http.Response, e... | go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/extractor/metadata_extractor_test.go | extractor/metadata_extractor_test.go | package extractor_test
import (
"archive/zip"
"bytes"
"errors"
"fmt"
"io"
"net/http"
"os"
"time"
"github.com/onsi/gomega/ghttp"
"github.com/pivotal-cf/om/extractor/fakes"
"github.com/pivotal-cf/om/extractor"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
const (
validYAML = `
---
product... | go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/extractor/fakes/httpclient.go | extractor/fakes/httpclient.go | // Code generated by counterfeiter. DO NOT EDIT.
package fakes
import (
"net/http"
"sync"
)
type HttpClient struct {
DoStub func(*http.Request) (*http.Response, error)
doMutex sync.RWMutex
doArgsForCall []struct {
arg1 *http.Request
}
doReturns struct {
result1 *http.Response
result2 error
... | go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/pkg/testinfra/proxy.go | pkg/testinfra/proxy.go | package testinfra
import (
"context"
"fmt"
"io"
"os"
"time"
"github.com/testcontainers/testcontainers-go"
"github.com/testcontainers/testcontainers-go/wait"
)
// StartKerberosProxy starts a Squid proxy with Kerberos auth.
func StartKerberosProxy(ctx context.Context, networkName string, keytabPath string, kdc ... | go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/pkg/testinfra/config.go | pkg/testinfra/config.go | // Package testinfra provides shared test infrastructure for SPNEGO/Kerberos proxy testing.
package testinfra
import (
"bytes"
_ "embed"
"fmt"
"text/template"
)
const (
TestUsername = "testuser"
TestPassword = "testpass123"
TestRealm = "EXAMPLE.COM"
TestAdminPass = "admin123"
KDCHostname = "kdc.examp... | go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/pkg/testinfra/infra.go | pkg/testinfra/infra.go | package testinfra
import (
"context"
"fmt"
"os"
"path/filepath"
"testing"
"time"
"github.com/testcontainers/testcontainers-go"
"github.com/testcontainers/testcontainers-go/network"
)
// SPNEGOEnv holds the SPNEGO test infrastructure state.
type SPNEGOEnv struct {
ProxyURL string // URL to connect to proxy f... | go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/pkg/testinfra/standalone.go | pkg/testinfra/standalone.go | //go:build ignore
// Run with: go run ./pkg/testinfra/standalone.go
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
"github.com/pivotal-cf/om/pkg/testinfra"
)
func main() {
fmt.Println("Starting SPNEGO test infrastructure...")
env, err := testinfra.StartSPNEGOInfraStandalone()
if err != nil {
fmt.... | go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/pkg/testinfra/kdc.go | pkg/testinfra/kdc.go | package testinfra
import (
"context"
"fmt"
"time"
"github.com/testcontainers/testcontainers-go"
"github.com/testcontainers/testcontainers-go/wait"
)
// StartKDC starts a KDC container.
func StartKDC(ctx context.Context, networkName string) (testcontainers.Container, error) {
req := testcontainers.ContainerRequ... | go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/configtemplate/metadata/metadata_suite_test.go | configtemplate/metadata/metadata_suite_test.go | package metadata_test
import (
"testing"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
func TestMetadata(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Metadata Suite")
}
| go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/configtemplate/metadata/file.go | configtemplate/metadata/file.go | package metadata
import (
"fmt"
"github.com/pivotal-cf/om/extractor"
)
func NewFileProvider(pathToPivotalFile string) Provider {
return &FileProvider{
pathToPivotalFile: pathToPivotalFile,
}
}
type FileProvider struct {
pathToPivotalFile string
}
func (f *FileProvider) MetadataBytes() ([]byte, error) {
meta... | go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/configtemplate/metadata/types.go | configtemplate/metadata/types.go | package metadata
type Provider interface {
MetadataBytes() ([]byte, error)
}
| go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/configtemplate/metadata/pivnet_test.go | configtemplate/metadata/pivnet_test.go | package metadata_test
import (
"net/http"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/ghttp"
"github.com/pivotal-cf/go-pivnet/v9"
"github.com/pivotal-cf/om/configtemplate/metadata"
)
var _ = Describe("Pivnet Client", func() {
When("too many files match the glob", func() {... | go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/configtemplate/metadata/pivnet.go | configtemplate/metadata/pivnet.go | package metadata
import (
"log"
"os"
"github.com/pivotal-cf/om/download_clients"
)
func NewPivnetProvider(host, token, slug, version, glob string, skipSSL bool, proxyURL, proxyUsername, proxyPassword, proxyAuthType, proxyKrb5Config string) (Provider, error) {
stderr := log.New(os.Stderr, "", 0)
stdout := log.Ne... | go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/configtemplate/generator/value_types.go | configtemplate/generator/value_types.go | package generator
import "fmt"
type PropertyValue interface {
Parameters() []string
IsSelector() bool
}
type SimpleType interface {
Parameters() []string
IsSelector() bool
}
type SimpleString string
func (s SimpleString) Parameters() []string {
return []string{fmt.Sprintf("%v", s)}
}
func (s SimpleString) Is... | go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/configtemplate/generator/syslog_properties.go | configtemplate/generator/syslog_properties.go | package generator
type SyslogProperties struct {
Enabled string `yaml:"enabled,omitempty"`
Address string `yaml:"address"`
Port string `yaml:"port"`
TransportProtocol string `yaml:"transport_protocol,omitempty"`
TLSEnabled string... | go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/configtemplate/generator/collection_property_metadata_test.go | configtemplate/generator/collection_property_metadata_test.go | package generator_test
import (
"github.com/pivotal-cf/om/configtemplate/generator"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
var _ = Describe("CollectionPropertyMetadata", func() {
Context("IsDefaultAnArray", func() {
It("is true", func() {
Expect(generator.IsDefaultAnArray(make([]interfac... | go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/configtemplate/generator/types.go | configtemplate/generator/types.go | package generator
type Template struct {
ProductName string `yaml:"product-name"`
NetworkProperties *NetworkProperties `yaml:"network-properties"`
ProductProperties map[string]PropertyValue `yaml:"product-properties"`
ResourceConfig map[string]Resource `yaml:"resource-config,o... | go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
pivotal-cf/om | https://github.com/pivotal-cf/om/blob/245e150f629341f904f56882e30f43e376dbbcc5/configtemplate/generator/network_properties.go | configtemplate/generator/network_properties.go | package generator
type NetworkProperties struct {
Network *Name `yaml:"network,omitempty"`
ServiceNetwork *Name `yaml:"service_network,omitempty"`
OtherAvailabilityZones []Name `yaml:"other_availability_zones"`
SingletonAvailabilityZone *Name `yaml:"singleton_availability_zone"`
... | go | Apache-2.0 | 245e150f629341f904f56882e30f43e376dbbcc5 | 2026-01-07T09:45:45.909243Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.