github.com/cidverse/cid-sdk-go@v0.0.0-20240318001225-c193d83f053e/README.md (about)

     1  # CID - Go SDK
     2  
     3  > go sdk for cid
     4  
     5  ## Configuration
     6  
     7  The SDK will detect the endpoint (unix socket or http api) automatically when initialized as part of a action or workflow run based on the follwing envionrment properties:
     8  
     9  | Property       | Description                                  |
    10  |----------------|----------------------------------------------|
    11  | CID_API_SOCKET | unix socket file                             |
    12  | CID_API_ADDR   | http endpoint                                |
    13  | CID_API_SECRET | temporary api key to securely access the api |
    14  
    15  For local testing run `cid api` and set `CID_API_ADDR` to `http://localhost:7400`.
    16  
    17  ## Code Example
    18  
    19  ```golang
    20  // sdk
    21  cid, _ := cidsdk.NewSDK()
    22  currentModule, _ := cid.CurrentModule()
    23  ```
    24  
    25  ## License
    26  
    27  Released under the [MIT License](./LICENSE).