beacon

package
v1.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

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

func Address(ctx context.Context, lockFile string) (string, error)

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 DeleteLockFile(lockFile string) error

func Identifier

func Identifier(s string) string

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 StoreAddressToLockFile(lockFile, addr string) error

func ValidResourcePolicy

func ValidResourcePolicy(s string) bool

Types

type Connection

type Connection struct {
	Conn *grpc.ClientConn
	Addr string
}

func Connect

func Connect(ctx context.Context) (*Connection, error)

func (*Connection) Close added in v1.1.0

func (c *Connection) Close() error

func (*Connection) Enabled

func (c *Connection) Enabled() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL