-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
60c4bba
commit c815ed3
Showing
1 changed file
with
18 additions
and
18 deletions.
There are no files selected for viewing
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,32 +1,32 @@ | ||
package abstractions | ||
|
||
import ( | ||
"github.com/Akilan1999/p2p-rendering-computation/config" | ||
"github.com/Akilan1999/p2p-rendering-computation/config/generate" | ||
"github.com/Akilan1999/p2p-rendering-computation/server" | ||
"github.com/gin-gonic/gin" | ||
"github.com/Akilan1999/p2p-rendering-computation/config" | ||
"github.com/Akilan1999/p2p-rendering-computation/config/generate" | ||
"github.com/Akilan1999/p2p-rendering-computation/server" | ||
"github.com/gin-gonic/gin" | ||
) | ||
|
||
// Init Initialises p2prc | ||
func Init(customConfig interface{}) (config *config.Config, err error) { | ||
// set the config file with default paths | ||
config, err = generate.SetDefaults("P2PRC", false, customConfig, false) | ||
if err != nil { | ||
return | ||
} | ||
return | ||
// set the config file with default paths | ||
config, err = generate.SetDefaults("P2PRC", false, customConfig, false) | ||
if err != nil { | ||
return | ||
} | ||
return | ||
} | ||
|
||
// Start p2prc in a server mode | ||
func Start() (*gin.Engine, error) { | ||
engine, err := server.Server() | ||
if err != nil { | ||
return nil, err | ||
} | ||
return engine, nil | ||
engine, err := server.Server() | ||
if err != nil { | ||
return nil, err | ||
} | ||
return engine, nil | ||
} | ||
|
||
func MapPort(port string) (mapPort string, err error) { | ||
mapPort, err = server.MapPort(port) | ||
return | ||
func MapPort(port string) (entireAddres string, mapPort string, err error) { | ||
entireAddres, mapPort, err = server.MapPort(port) | ||
return | ||
} |