Documentation
¶
Overview ¶
Package brn provides a parser for interacting with BCE Resource Names.
Index ¶
- Variables
- func DealFName(accountID, fName string) (thumbnailName, version, alias string, err error)
- func DealFName1(accountID, fName string) (thumbnailName, version, uidStr string, err error)
- func GenerateCommonBrn(service, region, uid, resource, qualifier string) string
- func GenerateFuncBrnString(region, uid, functionName, qualifier string) string
- func GetVersionAndAlias(qualifier string) (version, alias string)
- func JudgeQualifier(qualifier string) (string, error)
- func JudgeUnderlyingBrn(underlyingBrn string) (string, error)
- func Md5BceUid(uid string) string
- func SimplifyFunctionNameAndQualifier(functionName, qualifier string) (string, string)
- type BRN
- type FunctionBRN
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RegAlias = regexp.MustCompile("^[a-zA-Z0-9-_]+$") RegNotMatchErr = errors.New(`member must satisfy regular expression pattern: (brn:(cloud[a-zA-Z-]*)?:faas:)?([a-z]{2,5}[0-9]*:)?([0-9a-z]{32}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?`) )
Functions ¶
func DealFName1 ¶
fName = ThumbnailName/Uid-ThumbnailName/FuncBrn
func GenerateCommonBrn ¶
func GenerateFuncBrnString ¶
func GetVersionAndAlias ¶
func JudgeQualifier ¶
func JudgeUnderlyingBrn ¶
func SimplifyFunctionNameAndQualifier ¶
SimplifyFunctionNameAndQualifier TODO: partial function name
Types ¶
type BRN ¶
type BRN struct { // The partition that the resource is in. For standard BCE regions, the partition is "cloud". If you have resources in // other partitions, the partition is "cloud-partitionname". For example, the partition for resources in the China // (Beijing) region is "cloud-cn". Partition string // The service namespace that identifies the BCE product. For a list of namespaces, see // http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces. Service string // The region the resource resides in. Note that the BRNs for some resources do not require a region, so this // component might be omitted. Region string // The ID of the BCE account that owns the resource, without the hyphens. For example, 123456789012. Note that the // BRNs for some resources don't require an account number, so this component might be omitted. AccountID string // The content of this part of the BRN varies by service. It often includes an indicator of the type of resource — // for example, an IAM user or BCE RDS database - followed by a slash (/) or a colon (:), followed by the // resource name itself. Some services allows paths for resource names, as described in // http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arns-paths. Resource string }
BRN captures the individual fields of an BCE Resource Name. See http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html for more information.
func Parse ¶
Parse parses an BRN into its constituent parts.
Some example BRNs: brn:cloud:elasticbeanstalk:us-east-1:123456789012:environment/My App/MyEnvironment brn:cloud:iam::123456789012:user/David brn:cloud:rds:eu-west-1:123456789012:db:mysql-db brn:cloud:s3:::my_corporate_bucket/exampleobject.png
type FunctionBRN ¶
func GenerateFunctionBRN ¶
func GenerateFunctionBRN(region, uid, functionName, qualifier string) FunctionBRN
func ParseFunction ¶
func ParseFunction(brn string) (FunctionBRN, error)
Click to show internal directories.
Click to hide internal directories.