github.com/zhuohuang-hust/src-cbuild@v0.0.0-20230105071821-c7aab3e7c840/mergeCode/libnetwork/osl/namespace_windows.go (about)

     1  package osl
     2  
     3  import "testing"
     4  
     5  // GenerateKey generates a sandbox key based on the passed
     6  // container id.
     7  func GenerateKey(containerID string) string {
     8  	maxLen := 12
     9  	if len(containerID) < maxLen {
    10  		maxLen = len(containerID)
    11  	}
    12  
    13  	return containerID[:maxLen]
    14  }
    15  
    16  // NewSandbox provides a new sandbox instance created in an os specific way
    17  // provided a key which uniquely identifies the sandbox
    18  func NewSandbox(key string, osCreate, isRestore bool) (Sandbox, error) {
    19  	return nil, nil
    20  }
    21  
    22  func GetSandboxForExternalKey(path string, key string) (Sandbox, error) {
    23  	return nil, nil
    24  }
    25  
    26  // GC triggers garbage collection of namespace path right away
    27  // and waits for it.
    28  func GC() {
    29  }
    30  
    31  // InitOSContext initializes OS context while configuring network resources
    32  func InitOSContext() func() {
    33  	return func() {}
    34  }
    35  
    36  // SetupTestOSContext sets up a separate test  OS context in which tests will be executed.
    37  func SetupTestOSContext(t *testing.T) func() {
    38  	return func() {}
    39  }
    40  
    41  // SetBasePath sets the base url prefix for the ns path
    42  func SetBasePath(path string) {
    43  }