( entrypoint string, dir string, insecure bool, opts ...NodeOption, )
| 71 | } |
| 72 | |
| 73 | func NewHTTPNode( |
| 74 | entrypoint string, |
| 75 | dir string, |
| 76 | insecure bool, |
| 77 | opts ...NodeOption, |
| 78 | ) (*HTTPNode, error) { |
| 79 | base := NewBaseNode(dir, opts...) |
| 80 | url, err := url.Parse(entrypoint) |
| 81 | if err != nil { |
| 82 | return nil, err |
| 83 | } |
| 84 | if url.Scheme == "http" && !insecure { |
| 85 | return nil, &errors.TaskfileNotSecureError{URI: url.Redacted()} |
| 86 | } |
| 87 | |
| 88 | client, err := buildHTTPClient(insecure, base.caCert, base.cert, base.certKey) |
| 89 | if err != nil { |
| 90 | return nil, err |
| 91 | } |
| 92 | |
| 93 | return &HTTPNode{ |
| 94 | baseNode: base, |
| 95 | url: url, |
| 96 | client: client, |
| 97 | }, nil |
| 98 | } |
| 99 | |
| 100 | func (node *HTTPNode) Location() string { |
| 101 | return node.url.Redacted() |
searching dependent graphs…