-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved entrypoint types and funcs in the main helium package, moved pr…
…otobuf-related symbols to api
- Loading branch information
1 parent
2d7c77c
commit 47f2b6e
Showing
13 changed files
with
113 additions
and
112 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package centralized | ||
package helium | ||
|
||
import ( | ||
"context" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,44 @@ | ||
// Package helium provides the main types and interfaces for the Helium framework. | ||
package helium | ||
|
||
import ( | ||
"context" | ||
"net" | ||
|
||
"github.com/ChristianMct/helium/circuit" | ||
"github.com/ChristianMct/helium/node" | ||
"github.com/ChristianMct/helium/services/compute" | ||
) | ||
|
||
func RunHeliumServer(ctx context.Context, config node.Config, nl node.List, app node.App, ip compute.InputProvider) (cdescs chan<- circuit.Descriptor, outs <-chan circuit.Output, err error) { | ||
|
||
helperNode, err := node.New(config, nl) | ||
if err != nil { | ||
return nil, nil, err | ||
} | ||
|
||
hsv := NewHeliumServer(helperNode) | ||
|
||
lis, err := net.Listen("tcp", string(config.Address)) | ||
if err != nil { | ||
return nil, nil, err | ||
} | ||
|
||
go hsv.Serve(lis) | ||
|
||
return hsv.Run(ctx, app, ip) | ||
} | ||
|
||
func RunHeliumClient(ctx context.Context, config node.Config, nl node.List, app node.App, ip compute.InputProvider) (outs <-chan circuit.Output, err error) { | ||
|
||
n, err := node.New(config, nl) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
hc := NewHeliumClient(n, config.HelperID, nl.AddressOf(config.HelperID)) | ||
if err := hc.Connect(); err != nil { | ||
return nil, err | ||
} | ||
|
||
return hc.Run(ctx, app, ip) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package centralized | ||
package helium | ||
|
||
import ( | ||
"context" | ||
|
Oops, something went wrong.