url

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: MIT Imports: 11 Imported by: 2

Documentation

Overview

Package url provides facilities for parsing and formatting Mutagen's URL formats.

Index

Constants

View Source
const (

	// DockerHostEnvironmentVariable is the name of the DOCKER_HOST environment
	// variable.
	DockerHostEnvironmentVariable = "DOCKER_HOST"
	// DockerTLSVerifyEnvironmentVariable is the name of the DOCKER_TLS_VERIFY
	// environment variable.
	DockerTLSVerifyEnvironmentVariable = "DOCKER_TLS_VERIFY"
	// DockerCertPathEnvironmentVariable is the name of the DOCKER_CERT_PATH
	// environment variable.
	DockerCertPathEnvironmentVariable = "DOCKER_CERT_PATH"
)

Variables

DockerEnvironmentVariables is a list of Docker environment variables that should be locked in to the URL at parse time.

View Source
var Kind_name = map[int32]string{
	0: "Synchronization",
	1: "Forwarding",
}
View Source
var Kind_value = map[string]int32{
	"Synchronization": 0,
	"Forwarding":      1,
}
View Source
var Protocol_name = map[int32]string{
	0:  "Local",
	1:  "SSH",
	3:  "Tunnel",
	11: "Docker",
}
View Source
var Protocol_value = map[string]int32{
	"Local":  0,
	"SSH":    1,
	"Tunnel": 3,
	"Docker": 11,
}

Functions

This section is empty.

Types

type Kind added in v0.10.0

type Kind int32

Kind indicates the kind of a URL.

const (
	// Synchronization indicates a synchronization URL.
	Kind_Synchronization Kind = 0
	// Forwarding indicates a forwarding URL.
	Kind_Forwarding Kind = 1
)

func (Kind) EnumDescriptor added in v0.10.0

func (Kind) EnumDescriptor() ([]byte, []int)

func (Kind) String added in v0.10.0

func (x Kind) String() string

func (Kind) Supported added in v0.10.0

func (k Kind) Supported() bool

Supported returns whether or not a URL kind is supported.

type Protocol

type Protocol int32

Protocol indicates a location type.

const (
	// Local indicates that the resource is on the local system.
	Protocol_Local Protocol = 0
	// SSH indicates that the resource is accessible via SSH.
	Protocol_SSH Protocol = 1
	// Tunnel indicates that the resource is available via a mutagen.io tunnel.
	Protocol_Tunnel Protocol = 3
	// Docker indicates that the resource is inside a Docker container.
	Protocol_Docker Protocol = 11
)

func (Protocol) EnumDescriptor

func (Protocol) EnumDescriptor() ([]byte, []int)

func (Protocol) MightRequireInput added in v0.11.0

func (p Protocol) MightRequireInput() bool

MightRequireInput indicates whether or not a protocol might require interactive user input (e.g. a password or confirmation) while connecting.

func (Protocol) String

func (x Protocol) String() string

type URL

type URL struct {
	// Kind indicates the URL kind.
	// NOTE: This field number is out of order for historical reasons.
	Kind Kind `protobuf:"varint,7,opt,name=kind,proto3,enum=url.Kind" json:"kind,omitempty"`
	// Protocol indicates a location type.
	Protocol Protocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=url.Protocol" json:"protocol,omitempty"`
	// User is the user under which a resource should be accessed.
	User string `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"`
	// Host is protocol-specific, but generally indicates the location of the
	// remote.
	Host string `protobuf:"bytes,3,opt,name=host,proto3" json:"host,omitempty"`
	// Port indicates a TCP port via which to access the remote location, if
	// applicable.
	Port uint32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"`
	// Path indicates the path of a resource.
	Path string `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"`
	// Environment is used to capture environment variable information (if
	// necessary) for transports which operate by executing a command.
	Environment          map[string]string `` /* 163-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

URL represents a pointer to a resource.

func Parse

func Parse(raw string, kind Kind, first bool) (*URL, error)

Parse parses a raw URL string into a URL type. It accepts information about the URL kind (e.g. synchronization vs. forwarding) and position (i.e. the URL is considered an alpha/source URL if first is true and a beta/destination URL otherwise).

func (*URL) Descriptor

func (*URL) Descriptor() ([]byte, []int)

func (*URL) EnsureValid

func (u *URL) EnsureValid() error

EnsureValid ensures that URL's invariants are respected.

func (*URL) Format

func (u *URL) Format(environmentPrefix string) string

Format formats a URL into a human-readable (and reparsable) format.

func (*URL) GetEnvironment added in v0.10.0

func (m *URL) GetEnvironment() map[string]string

func (*URL) GetHost added in v0.10.0

func (m *URL) GetHost() string

func (*URL) GetKind added in v0.10.0

func (m *URL) GetKind() Kind

func (*URL) GetPath

func (m *URL) GetPath() string

func (*URL) GetPort

func (m *URL) GetPort() uint32

func (*URL) GetProtocol

func (m *URL) GetProtocol() Protocol

func (*URL) GetUser added in v0.10.0

func (m *URL) GetUser() string

func (*URL) ProtoMessage

func (*URL) ProtoMessage()

func (*URL) Reset

func (m *URL) Reset()

func (*URL) String

func (m *URL) String() string

func (*URL) XXX_DiscardUnknown

func (m *URL) XXX_DiscardUnknown()

func (*URL) XXX_Marshal

func (m *URL) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*URL) XXX_Merge

func (m *URL) XXX_Merge(src proto.Message)

func (*URL) XXX_Size

func (m *URL) XXX_Size() int

func (*URL) XXX_Unmarshal

func (m *URL) XXX_Unmarshal(b []byte) error

Directories

Path Synopsis
Package forwarding provides the URL parsing routines for forwarding sub-URLs.
Package forwarding provides the URL parsing routines for forwarding sub-URLs.

Jump to

Keyboard shortcuts

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