Skip to content

tugbadm/docker-network-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-network-plugin

Docker go-plugin-helper network implementation

Build Status

To get this repo

go get github.com/tugbadartici/docker-network-plugin

Docker network plugin uses a network driver file which is located on "/etc/docker/plugins/". If this dir does not exist create it.

1- Create a json file on this location & give an empty port

{
	"Name": "mynetwork",
	"Addr": "tcp://127.0.0.1:8010"
}

2- Example usage of mydriver package with golang is like this. You need to pass the port as parameter to Handle function.

package main

import (
	"github.com/tugbadartici/docker-network-plugin"
	"github.com/docker/go-plugins-helpers/network"
)

func main() {
	d := mydriver.NewDriver()
	h := network.NewHandler(d)
	
	// About 3rd parameter:
	// Windows default daemon: WindowsDefaultDaemonRootDir() function. 
	// On Unix, this parameter is ignored.
	h.ServeTCP("test", ":8010", "", nil)  
}
more details please visit: https://medium.com/@tugba

About

Docker go-plugin-helper network implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages