Documentation ¶
Overview ¶
Copyright 2016 The GoStor Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 The GoStor Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func ParseHost(host string) (string, string, string, error)
- type Client
- func (cli *Client) ClientVersion() string
- func (cli *Client) TargetCreate(ctx context.Context, options api.TargetCreateRequest) (api.SCSITarget, error)
- func (cli *Client) TargetList(ctx context.Context, options api.TargetListOptions) ([]api.SCSITarget, error)
- func (cli *Client) TargetRemove(ctx context.Context, options api.TargetRemoveOptions) error
- func (cli *Client) UpdateClientVersion(v string)
Constants ¶
const DefaultDockerHost = "unix:///var/run/docker.sock"
DefaultDockerHost defines os specific default if DOCKER_HOST is unset
Variables ¶
var ErrConnectionFailed = errors.New("Cannot connect to the SCSI Target daemon. Is the SCSI target daemon running on this host?")
ErrConnectionFailed is an error raised when the connection between the client and the server failed.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(host string, version string, client *http.Client, httpHeaders map[string]string) (*Client, error)
NewClient initializes a new API client for the given host and API version. It uses the given http client as transport. It also initializes the custom http headers to add to each request.
It won't send any version information if the version number is empty. It is highly recommended that you set a version or your client may break if the server is upgraded.
func (*Client) ClientVersion ¶
ClientVersion returns the version string associated with this instance of the Client. Note that this value can be changed via the DOCKER_API_VERSION env var.
func (*Client) TargetCreate ¶
func (cli *Client) TargetCreate(ctx context.Context, options api.TargetCreateRequest) (api.SCSITarget, error)
TargetCreate creates a target in the SCSI Target.
func (*Client) TargetList ¶
func (cli *Client) TargetList(ctx context.Context, options api.TargetListOptions) ([]api.SCSITarget, error)
TargetCreate creates a target in the SCSI Target.
func (*Client) TargetRemove ¶
TargetCreate creates a target in the SCSI Target.
func (*Client) UpdateClientVersion ¶
UpdateClientVersion updates the version string associated with this instance of the Client.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package transport provides function to send request to remote endpoints.
|
Package transport provides function to send request to remote endpoints. |
cancellable
Package cancellable provides helper function to cancel http requests.
|
Package cancellable provides helper function to cancel http requests. |