File: endpoint.go

package info (click to toggle)
golang-github-masterzen-winrm 0.0~git20160323.0752679-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 256 kB
  • ctags: 180
  • sloc: makefile: 34; sh: 14
file content (22 lines) | stat: -rw-r--r-- 322 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package winrm

import "fmt"

type Endpoint struct {
	Host     string
	Port     int
	HTTPS    bool
	Insecure bool
	CACert   *[]byte
}

func (ep *Endpoint) url() string {
	var scheme string
	if ep.HTTPS {
		scheme = "https"
	} else {
		scheme = "http"
	}

	return fmt.Sprintf("%s://%s:%d/wsman", scheme, ep.Host, ep.Port)
}