MCPcopy
hub / github.com/minio/minio-go / New

Function New

api.go:201–221  ·  api.go::New

New - instantiate minio client with options

(endpoint string, opts *Options)

Source from the content-addressed store, hash-verified

199
200// New - instantiate minio client with options
201func New(endpoint string, opts *Options) (*Client, error) {
202 if opts == nil {
203 return nil, errors.New("no options provided")
204 }
205 clnt, err := privateNew(endpoint, opts)
206 if err != nil {
207 return nil, err
208 }
209 if s3utils.IsAmazonEndpoint(*clnt.endpointURL) {
210 // If Amazon S3 set to signature v4.
211 clnt.overrideSignerType = credentials.SignatureV4
212 // Amazon S3 endpoints are resolved into dual-stack endpoints by default
213 // for backwards compatibility.
214 clnt.s3DualstackEnabled = true
215 } else if s3utils.IsAmazonOutpostsEndpoint(*clnt.endpointURL) {
216 // S3 on Outposts uses signature v4 with service name s3-outposts.
217 clnt.overrideSignerType = credentials.SignatureV4
218 }
219
220 return clnt, nil
221}
222
223// EndpointURL returns the URL of the S3-compatible endpoint that this client connects to.
224//

Calls 3

IsAmazonEndpointFunction · 0.92
IsAmazonOutpostsEndpointFunction · 0.92
privateNewFunction · 0.85