Skip to content
Snippets Groups Projects
Commit a6ce0ee3 authored by Tigran Avakyan's avatar Tigran Avakyan
Browse files

Ran go lint on graphs

parent 8ecc5c71
No related branches found
No related tags found
No related merge requests found
...@@ -8,4 +8,5 @@ package graphs ...@@ -8,4 +8,5 @@ package graphs
import "gitlab.com/elixxir/server/services" import "gitlab.com/elixxir/server/services"
// Initializer is the function type signature for how all graphs should be initialized
type Initializer func(gc services.GraphGenerator) *services.Graph type Initializer func(gc services.GraphGenerator) *services.Graph
...@@ -12,11 +12,13 @@ import ( ...@@ -12,11 +12,13 @@ import (
"gitlab.com/elixxir/server/services" "gitlab.com/elixxir/server/services"
) )
// PermuteIO used to convert input and output when streams are linked
type PermuteIO struct { type PermuteIO struct {
Input *cyclic.IntBuffer Input *cyclic.IntBuffer
Output []*cyclic.Int Output []*cyclic.Int
} }
// PermuteSubStream is used to store input and outputs slices for permutation
type PermuteSubStream struct { type PermuteSubStream struct {
// Populate during Link // Populate during Link
permutations []uint32 permutations []uint32
...@@ -26,6 +28,7 @@ type PermuteSubStream struct { ...@@ -26,6 +28,7 @@ type PermuteSubStream struct {
outputs [][]*cyclic.Int outputs [][]*cyclic.Int
} }
// LinkStreams sets array of permutations slice references and appends each permute io from list into substream
func (pss *PermuteSubStream) LinkStreams(expandedBatchSize uint32, permutation []uint32, ioLst ...PermuteIO) { func (pss *PermuteSubStream) LinkStreams(expandedBatchSize uint32, permutation []uint32, ioLst ...PermuteIO) {
pss.permutations = permutation pss.permutations = permutation
...@@ -43,6 +46,7 @@ func (pss *PermuteSubStream) getSubStream() *PermuteSubStream { ...@@ -43,6 +46,7 @@ func (pss *PermuteSubStream) getSubStream() *PermuteSubStream {
return pss return pss
} }
// Permute module implements slot permutations on Adapt and conforms to module interface using a dummy cryptop
var Permute = services.Module{ var Permute = services.Module{
Adapt: func(stream services.Stream, cryptop cryptops.Cryptop, chunk services.Chunk) error { Adapt: func(stream services.Stream, cryptop cryptops.Cryptop, chunk services.Chunk) error {
ps, ok := stream.(permuteSubStreamInterface) ps, ok := stream.(permuteSubStreamInterface)
...@@ -69,7 +73,7 @@ var Permute = services.Module{ ...@@ -69,7 +73,7 @@ var Permute = services.Module{
NumThreads: 4, NumThreads: 4,
} }
/*dummy cryptop for testing*/ /* Dummy cryptop for testing*/
type permuteDummyCryptopPrototype func() type permuteDummyCryptopPrototype func()
var permuteDummyCryptop permuteDummyCryptopPrototype = func() { return } var permuteDummyCryptop permuteDummyCryptopPrototype = func() { return }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment