client

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2020 License: Apache-2.0 Imports: 13 Imported by: 10

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

View Source
const DefaultDockerHost = "unix:///var/run/docker.sock"

DefaultDockerHost defines os specific default if DOCKER_HOST is unset

Variables

View Source
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

func ParseHost

func ParseHost(host string) (string, string, string, error)

ParseHost verifies that the given host strings is valid.

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

func (cli *Client) ClientVersion() string

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

func (cli *Client) TargetRemove(ctx context.Context, options api.TargetRemoveOptions) error

TargetCreate creates a target in the SCSI Target.

func (*Client) UpdateClientVersion

func (cli *Client) UpdateClientVersion(v string)

UpdateClientVersion updates the version string associated with this instance of the Client.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL