url

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

View Source
var Protocol_name = map[int32]string{
	0: "Local",
	1: "SSH",
}
View Source
var Protocol_value = map[string]int32{
	"Local": 0,
	"SSH":   1,
}

Functions

This section is empty.

Types

type Protocol

type Protocol int32
const (
	Protocol_Local Protocol = 0
	Protocol_SSH   Protocol = 1
)

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func Parse

func Parse(raw string) (*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() string

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

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 (dst *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