File: client_posix.go

package info (click to toggle)
golang-github-spiffe-go-spiffe 2.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,116 kB
  • sloc: makefile: 157
file content (29 lines) | stat: -rw-r--r-- 680 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//go:build !windows
// +build !windows

package workloadapi

import "errors"

// appendDialOptionsOS appends OS specific dial options
func (c *Client) appendDialOptionsOS() {
	// No options to add in this platform
}
func (c *Client) setAddress() error {
	if c.config.namedPipeName != "" {
		// Purely defensive. This should never happen.
		return errors.New("named pipes not supported in this platform")
	}

	if c.config.address == "" {
		var ok bool
		c.config.address, ok = GetDefaultAddress()
		if !ok {
			return errors.New("workload endpoint socket address is not configured")
		}
	}

	var err error
	c.config.address, err = TargetFromAddress(c.config.address)
	return err
}