...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package index
20
21
22
23
24 import (
25 "errors"
26 "net/url"
27 golangswaggerpaths "path"
28 )
29
30
31 type SearchIndexURL struct {
32 _basePath string
33 }
34
35
36
37
38 func (o *SearchIndexURL) WithBasePath(bp string) *SearchIndexURL {
39 o.SetBasePath(bp)
40 return o
41 }
42
43
44
45
46 func (o *SearchIndexURL) SetBasePath(bp string) {
47 o._basePath = bp
48 }
49
50
51 func (o *SearchIndexURL) Build() (*url.URL, error) {
52 var _result url.URL
53
54 var _path = "/api/v1/index/retrieve"
55
56 _basePath := o._basePath
57 _result.Path = golangswaggerpaths.Join(_basePath, _path)
58
59 return &_result, nil
60 }
61
62
63 func (o *SearchIndexURL) Must(u *url.URL, err error) *url.URL {
64 if err != nil {
65 panic(err)
66 }
67 if u == nil {
68 panic("url can't be nil")
69 }
70 return u
71 }
72
73
74 func (o *SearchIndexURL) String() string {
75 return o.Must(o.Build()).String()
76 }
77
78
79 func (o *SearchIndexURL) BuildFull(scheme, host string) (*url.URL, error) {
80 if scheme == "" {
81 return nil, errors.New("scheme is required for a full url on SearchIndexURL")
82 }
83 if host == "" {
84 return nil, errors.New("host is required for a full url on SearchIndexURL")
85 }
86
87 base, err := o.Build()
88 if err != nil {
89 return nil, err
90 }
91
92 base.Scheme = scheme
93 base.Host = host
94 return base, nil
95 }
96
97
98 func (o *SearchIndexURL) StringFull(scheme, host string) string {
99 return o.Must(o.BuildFull(scheme, host)).String()
100 }
101
View as plain text