github.com/hechain20/hechain@v0.0.0-20220316014945-b544036ba106/internal/osnadmin/remove.go (about) 1 /* 2 Copyright hechain. All Rights Reserved. 3 4 SPDX-License-Identifier: Apache-2.0 5 */ 6 7 package osnadmin 8 9 import ( 10 "crypto/tls" 11 "crypto/x509" 12 "fmt" 13 "net/http" 14 ) 15 16 // Removes an OSN from an existing channel. 17 func Remove(osnURL, channelID string, caCertPool *x509.CertPool, tlsClientCert tls.Certificate) (*http.Response, error) { 18 url := fmt.Sprintf("%s/participation/v1/channels/%s", osnURL, channelID) 19 20 req, err := http.NewRequest(http.MethodDelete, url, nil) 21 if err != nil { 22 return nil, err 23 } 24 25 return httpDo(req, caCertPool, tlsClientCert) 26 }