| 1882 | } |
| 1883 | |
| 1884 | func (c *unixSocketClient) CreateNetworkChannel( |
| 1885 | ctx context.Context, |
| 1886 | workspaceRef string, |
| 1887 | request CreateNetworkChannelRequest, |
| 1888 | ) (NetworkChannelDetailRecord, error) { |
| 1889 | var response contract.CreateNetworkChannelResponse |
| 1890 | path, err := networkBasePath(workspaceRef) |
| 1891 | if err != nil { |
| 1892 | return NetworkChannelDetailRecord{}, err |
| 1893 | } |
| 1894 | body := struct { |
| 1895 | Channel string `json:"channel"` |
| 1896 | Purpose string `json:"purpose"` |
| 1897 | FanoutPolicy string `json:"fanout_policy,omitempty"` |
| 1898 | CoordinatorPeerID string `json:"coordinator_peer_id,omitempty"` |
| 1899 | AgentNames []string `json:"agent_names"` |
| 1900 | }{ |
| 1901 | Channel: request.Channel, |
| 1902 | Purpose: request.Purpose, |
| 1903 | FanoutPolicy: request.FanoutPolicy, |
| 1904 | CoordinatorPeerID: request.CoordinatorPeerID, |
| 1905 | AgentNames: request.AgentNames, |
| 1906 | } |
| 1907 | if err := c.doJSON(ctx, http.MethodPost, path+"/channels", nil, body, &response); err != nil { |
| 1908 | return NetworkChannelDetailRecord{}, err |
| 1909 | } |
| 1910 | return response.Channel, nil |
| 1911 | } |
| 1912 | |
| 1913 | func (c *unixSocketClient) UpdateNetworkChannel( |
| 1914 | ctx context.Context, |