...

Source file src/golang.conradwood.net/apis/getestservice/create_6.go

Documentation: golang.conradwood.net/apis/getestservice

     1  // client create: Ctx2TestClient
     2  /*
     3    Created by /home/cnw/devel/go/yatools/src/golang.yacloud.eu/yatools/protoc-gen-cnw/protoc-gen-cnw.go
     4  */
     5  
     6  /* geninfo:
     7     rendererv : 2
     8     filename  : golang.conradwood.net/apis/getestservice/getestservice.proto
     9     gopackage : golang.conradwood.net/apis/getestservice
    10     importname: ai_5
    11     clientfunc: GetCtx2Test
    12     serverfunc: NewCtx2Test
    13     lookupfunc: Ctx2TestLookupID
    14     varname   : client_Ctx2TestClient_5
    15     clientname: Ctx2TestClient
    16     servername: Ctx2TestServer
    17     gsvcname  : getestservice.Ctx2Test
    18     lockname  : lock_Ctx2TestClient_5
    19     activename: active_Ctx2TestClient_5
    20  */
    21  
    22  package getestservice
    23  
    24  import (
    25     "sync"
    26     "golang.conradwood.net/go-easyops/client"
    27  )
    28  var (
    29    lock_Ctx2TestClient_5 sync.Mutex
    30    client_Ctx2TestClient_5 Ctx2TestClient
    31  )
    32  
    33  func GetCtx2TestClient() Ctx2TestClient { 
    34      if client_Ctx2TestClient_5 != nil {
    35          return client_Ctx2TestClient_5
    36      }
    37  
    38      lock_Ctx2TestClient_5.Lock() 
    39      if client_Ctx2TestClient_5 != nil {
    40         lock_Ctx2TestClient_5.Unlock()
    41         return client_Ctx2TestClient_5
    42      }
    43  
    44      client_Ctx2TestClient_5 = NewCtx2TestClient(client.Connect(Ctx2TestLookupID()))
    45      lock_Ctx2TestClient_5.Unlock()
    46      return client_Ctx2TestClient_5
    47  }
    48  
    49  func Ctx2TestLookupID() string { return "getestservice.Ctx2Test" } // returns the ID suitable for lookup in the registry. treat as opaque, subject to change.
    50  
    51  func init() {
    52     client.RegisterDependency("getestservice.Ctx2Test")
    53     AddService("getestservice.Ctx2Test")
    54  }
    55  

View as plain text