Documentation ¶
Index ¶
Constants ¶
const ( // maximum elb name length (the most limiting id) = 32 // maximum prefix length = 15 // maximum prefix length = l0-<prefix>- = 19 // maximum id length = 31 - 19 = 13 (add buffer of 1 just to be safe) = 12 MAX_ID_LENGTH = 12 MIN_ID_LENGTH = 2 MIN_ID_HASH_LENGTH = 5 )
Variables ¶
var GenerateHashedEntityID = func(name string) string { prefix := filterUsableName(name) if maxPrefixLength := MAX_ID_LENGTH - MIN_ID_HASH_LENGTH; len(prefix) > maxPrefixLength { prefix = prefix[:maxPrefixLength] } hashLength := MAX_ID_LENGTH - len(prefix) hash := hashNow()[:hashLength] return prefix + hash }
generates an id using as much of the name as possible with at least MIN_ID_HASH_LENGTH characters of the id randomly hashed the id will always be MAX_ID_LENGTH characters in length
var GenerateHashlessEntityID = func(name string) string { id := filterUsableName(name) if len(id) > MAX_ID_LENGTH { id = id[:MAX_ID_LENGTH] } if len(id) < MIN_ID_LENGTH { hashLength := MIN_ID_LENGTH - len(id) hash := hashNow()[:hashLength] id = id + hash } return id }
generates an id using only the name while still being being safe in regards to length and character limitations (if possible)
var PREFIX = fmt.Sprintf("l0-%s-", config.Prefix())
Functions ¶
func CertificateARNToName ¶
Types ¶
type ECSDeployID ¶
type ECSDeployID string
func TaskDefinitionARNToECSDeployID ¶
func TaskDefinitionARNToECSDeployID(arn string) ECSDeployID
func TaskDefinitionToECSDeployID ¶
func TaskDefinitionToECSDeployID(taskDefinition string) ECSDeployID
func (ECSDeployID) FamilyName ¶
func (id ECSDeployID) FamilyName() string
func (ECSDeployID) L0DeployID ¶
func (id ECSDeployID) L0DeployID() string
func (ECSDeployID) Revision ¶
func (id ECSDeployID) Revision() string
func (ECSDeployID) String ¶
func (id ECSDeployID) String() string
we need to add a custom .String() function, or else string conversions add quotes
func (ECSDeployID) TaskDefinition ¶
func (id ECSDeployID) TaskDefinition() string
type ECSEnvironmentID ¶
type ECSEnvironmentID string
func ClusterARNToECSEnvironmentID ¶
func ClusterARNToECSEnvironmentID(arn string) ECSEnvironmentID
func (ECSEnvironmentID) AutoScalingGroupName ¶
func (id ECSEnvironmentID) AutoScalingGroupName() string
func (ECSEnvironmentID) L0EnvironmentID ¶
func (id ECSEnvironmentID) L0EnvironmentID() string
func (ECSEnvironmentID) LaunchConfigurationName ¶
func (id ECSEnvironmentID) LaunchConfigurationName() string
func (ECSEnvironmentID) SecurityGroupName ¶
func (id ECSEnvironmentID) SecurityGroupName() string
func (ECSEnvironmentID) String ¶
func (id ECSEnvironmentID) String() string
we need to add a custom .String() function, or else string conversions add quotes
type ECSLoadBalancerID ¶
type ECSLoadBalancerID string
func (ECSLoadBalancerID) L0LoadBalancerID ¶
func (id ECSLoadBalancerID) L0LoadBalancerID() string
func (ECSLoadBalancerID) RoleName ¶
func (id ECSLoadBalancerID) RoleName() string
func (ECSLoadBalancerID) SecurityGroupName ¶
func (id ECSLoadBalancerID) SecurityGroupName() string
func (ECSLoadBalancerID) String ¶
func (id ECSLoadBalancerID) String() string
we need to add a custom .String() function, or else string conversions add quotes
type ECSServiceID ¶
type ECSServiceID string
func ServiceARNToECSServiceID ¶
func ServiceARNToECSServiceID(arn string) ECSServiceID
func (ECSServiceID) L0ServiceID ¶
func (id ECSServiceID) L0ServiceID() string
func (ECSServiceID) String ¶
func (id ECSServiceID) String() string
we need to add a custom .String() function, or else string conversions add quotes
type L0DeployID ¶
type L0DeployID string
func (L0DeployID) ECSDeployID ¶
func (id L0DeployID) ECSDeployID() ECSDeployID
func (L0DeployID) String ¶
func (id L0DeployID) String() string
we need to add a custom .String() function, or else string conversions add quotes
type L0EnvironmentID ¶
type L0EnvironmentID string
func (L0EnvironmentID) ECSEnvironmentID ¶
func (id L0EnvironmentID) ECSEnvironmentID() ECSEnvironmentID
func (L0EnvironmentID) String ¶
func (id L0EnvironmentID) String() string
we need to add a custom .String() function, or else string conversions add quotes
type L0LoadBalancerID ¶
type L0LoadBalancerID string
func (L0LoadBalancerID) ECSLoadBalancerID ¶
func (id L0LoadBalancerID) ECSLoadBalancerID() ECSLoadBalancerID
func (L0LoadBalancerID) String ¶
func (id L0LoadBalancerID) String() string
type L0ServiceID ¶
type L0ServiceID string
func (L0ServiceID) ECSServiceID ¶
func (id L0ServiceID) ECSServiceID() ECSServiceID
func (L0ServiceID) String ¶
func (id L0ServiceID) String() string
we need to add a custom .String() function, or else string conversions add quotes