Documentation ¶
Index ¶
- Constants
- Variables
- func Address(ctx context.Context, lockFile string) (string, error)
- func DeleteLockFile(lockFile string) error
- func Identifier(s string) string
- func LockFilePath() string
- func StoreAddressToLockFile(lockFile, addr string) error
- func ValidResourcePolicy(s string) bool
- type Connection
Constants ¶
View Source
const ( AddressEnv = "CFT_BEACON_ADDR" LockFileEnv = "CFT_LOCKFILE" IdentifierEnv = "CFT_IDENTIFIER" NamespaceEnv = "CFT_NAMESPACE" ResourcePolicyEnv = "CFT_RESOURCE_POLICY" LogLevelEnv = "CFT_LOG_LEVEL" )
View Source
const ( ResourcePolicyError = "error" ResourcePolicyReuse = "reuse" ResourcePolicyReusable = "reusable" ResourcePolicyTakeOver = "takeover" )
View Source
const (
LabelIdentifier = "daichitakahashi.confort.beacon.identifier"
)
View Source
const LockFile = ".confort.lock"
LockFile is default file name of lock file.
Variables ¶
View Source
var ErrIntegrationDisabled = errors.New("the integration with beacon server is disabled")
Functions ¶
func Address ¶
Address returns address of beacon server. It returns value of CFT_BEACON_ADDR if exists. If the value of CFT_BEACON_ADDR equals "disabled", this returns ErrIntegrationDisabled.
If the variable not exists, Address try to read from lockFile.
func DeleteLockFile ¶
func Identifier ¶
func LockFilePath ¶
func LockFilePath() string
LockFilePath returns file name of lock file. If CFT_LOCKFILE is set, return its value, or else return LockFile.
func StoreAddressToLockFile ¶
func ValidResourcePolicy ¶
Types ¶
type Connection ¶
type Connection struct { Conn *grpc.ClientConn Addr string }
func (*Connection) Close ¶ added in v1.1.0
func (c *Connection) Close() error
func (*Connection) Enabled ¶
func (c *Connection) Enabled() bool
Click to show internal directories.
Click to hide internal directories.