Documentation
¶
Overview ¶
Package url provides facilities for parsing and formatting Mutagen's URL formats.
Index ¶
- Variables
- type Kind
- type Protocol
- type URL
- func (*URL) Descriptor() ([]byte, []int)deprecated
- func (u *URL) EnsureValid() error
- func (u *URL) Equal(other *URL) bool
- func (u *URL) Format(environmentPrefix string) string
- func (x *URL) GetEnvironment() map[string]string
- func (x *URL) GetHost() string
- func (x *URL) GetKind() Kind
- func (x *URL) GetParameters() map[string]string
- func (x *URL) GetPath() string
- func (x *URL) GetPort() uint32
- func (x *URL) GetProtocol() Protocol
- func (x *URL) GetUser() string
- func (*URL) ProtoMessage()
- func (x *URL) ProtoReflect() protoreflect.Message
- func (x *URL) Reset()
- func (x *URL) String() string
Constants ¶
This section is empty.
Variables ¶
var ( Kind_name = map[int32]string{ 0: "Synchronization", 1: "Forwarding", } Kind_value = map[string]int32{ "Synchronization": 0, "Forwarding": 1, } )
Enum value maps for Kind.
var ( Protocol_name = map[int32]string{ 0: "Local", 1: "SSH", 3: "Tunnel", 11: "Docker", } Protocol_value = map[string]int32{ "Local": 0, "SSH": 1, "Tunnel": 3, "Docker": 11, } )
Enum value maps for Protocol.
var DockerEnvironmentVariables = []string{
"DOCKER_HOST",
"DOCKER_TLS_VERIFY",
"DOCKER_CERT_PATH",
"DOCKER_CONTEXT",
"DOCKER_API_VERSION",
}
DockerEnvironmentVariables is a list of Docker environment variables that should be locked in to Docker URLs at parse time.
var File_url_url_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Kind ¶ added in v0.10.0
type Kind int32
Kind indicates the kind of a URL.
func (Kind) Descriptor ¶ added in v0.12.0
func (Kind) Descriptor() protoreflect.EnumDescriptor
func (Kind) EnumDescriptor
deprecated
added in
v0.10.0
func (Kind) Number ¶ added in v0.12.0
func (x Kind) Number() protoreflect.EnumNumber
func (Kind) Type ¶ added in v0.12.0
func (Kind) Type() protoreflect.EnumType
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) Descriptor ¶ added in v0.12.0
func (Protocol) Descriptor() protoreflect.EnumDescriptor
func (Protocol) EnumDescriptor
deprecated
func (Protocol) Number ¶ added in v0.12.0
func (x Protocol) Number() protoreflect.EnumNumber
func (Protocol) Type ¶ added in v0.12.0
func (Protocol) Type() protoreflect.EnumType
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 contains captured environment variable information. It is not // a required component and its contents and their behavior depend on the // transport implementation. Environment map[string]string `` /* 163-byte string literal not displayed */ // Field 7 is already used above for the kind field. It is out of order for // historical reasons. // Parameters are internal transport parameters. These are set for URLs // generated internally that require additional metadata. Parameters are not // required and their behavior is dependent on the transport implementation. Parameters map[string]string `` /* 161-byte string literal not displayed */ // contains filtered or unexported fields }
URL represents a pointer to a resource.
func Parse ¶
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
deprecated
func (*URL) EnsureValid ¶
EnsureValid ensures that URL's invariants are respected.
func (*URL) Equal ¶ added in v0.12.0
Equal returns whether or not the URL is equivalent to another. The result of this method is only valid if both URLs are valid.
func (*URL) GetEnvironment ¶ added in v0.10.0
func (*URL) GetParameters ¶ added in v0.12.0
func (*URL) GetProtocol ¶
func (*URL) ProtoMessage ¶
func (*URL) ProtoMessage()
func (*URL) ProtoReflect ¶ added in v0.12.0
func (x *URL) ProtoReflect() protoreflect.Message
Source Files
¶
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. |