url

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: MIT Imports: 8 Imported by: 0

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 Protocol_name = map[int32]string{
	0:  "Local",
	1:  "SSH",
	11: "Docker",
}
View Source
var Protocol_value = map[string]int32{
	"Local":  0,
	"SSH":    1,
	"Docker": 11,
}

Functions

This section is empty.

Types

type Protocol

type Protocol int32
const (
	Protocol_Local Protocol = 0
	Protocol_SSH   Protocol = 1
	// Enumeration value 2 is reserved for custom protocols.
	// Enumeration values 3-10 are reserved for core protocols.
	Protocol_Docker Protocol = 11
)

func (Protocol) EnumDescriptor

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

func (Protocol) String

func (x Protocol) String() string

type URL

type URL struct {
	Protocol             Protocol          `protobuf:"varint,1,opt,name=protocol,proto3,enum=url.Protocol" json:"protocol,omitempty"`
	Username             string            `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	Hostname             string            `protobuf:"bytes,3,opt,name=hostname,proto3" json:"hostname,omitempty"`
	Port                 uint32            `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"`
	Path                 string            `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"`
	Environment          map[string]string `` /* 163-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func Parse

func Parse(raw string, alpha bool) (*URL, error)

Parse parses a raw URL string into a URL type.

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.7.0

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

func (*URL) GetHostname

func (m *URL) GetHostname() string

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) GetUsername

func (m *URL) GetUsername() 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

Jump to

Keyboard shortcuts

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