go.temporal.io/server/common/archiver/uri.go

79 LOC · 39 covered · 40 uncovered · 13 ranges · 344 concepts · 8 introducers · 144 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 package archiver
2
3 import (
4 "net/url"
5 )
6
7 type (
8 // URI identifies the archival resource to which records are written to and read from.
9 URI interface {
10 Scheme() string
11 Path() string
12 Hostname() string
13 Port() string
14 Username() string
15 Password() string
16 String() string
17 Opaque() string
18 Query() map[string][]string
19 }
20
21 uri struct {
22 url *url.URL
23 }
24 )
25
26 // NewURI constructs a new archiver URI from string.
27 > func NewURI(s string) (URI, error) { uri.go ×1
28 > url, err := url.ParseRequestURI(s)
29 > if err != nil {
30 > return nil, err uri.go ×1
31 > }
32 > return &uri{url: url}, nil uri.go ×1
33 }
34
35 > func (u *uri) Scheme() string { uri.go ×1
36 > return u.url.Scheme
37 > }
38
39 > func (u *uri) Path() string { uri.go ×1
40 > return u.url.Path
41 > }
42
43 > func (u *uri) Hostname() string { uri.go ×1
44 > return u.url.Hostname()
45 > }
46
47 > func (u *uri) Port() string { uri.go ×6
48 > return u.url.Port()
49 > }
50
51 > func (u *uri) Username() string { uri.go ×6
52 > if u.url.User == nil {
53 > return ""
54 > }
55 > return u.url.User.Username()
56 }
57
58 > func (u *uri) Password() string { uri.go ×6
59 > if u.url.User == nil {
60 > return ""
61 > }
62 > password, exist := u.url.User.Password()
63 > if !exist {
64 return ""
65 }
66 > return password uri.go ×6
67 }
68
69 > func (u *uri) Opaque() string { uri.go ×6
70 > return u.url.Opaque
71 > }
72
73 > func (u *uri) Query() map[string][]string { uri.go ×6
74 > return u.url.Query()
75 > }
76
77 > func (u *uri) String() string { uri.go ×1
78 > return u.url.String()
79 > }