Documentation ¶
Overview ¶
Package ram avoid code redundancy by grouping types and functions used by other ram packages
Index ¶
- func BuildAncestorsDisplayName(ctx context.Context, ancestors []string, collectionID string, ...) []string
- func BuildAncestryPath(ancestors []string) string
- func CreateTopic(ctx context.Context, pubSubPulisherClient *pubsub.PublisherClient, ...) error
- func Find(slice []string, val string) bool
- func GetAssetContact(contactRole string, resourceJSON json.RawMessage) (string, error)
- func GetByteSet(start byte, length int) []byte
- func GetClientOptionAndCleanKeys(ctx context.Context, serviceAccountEmail string, keyJSONFilePath string, ...) (option.ClientOption, bool)
- func GetEnvVarBool(envVarName string) bool
- func GetEnvVarInt64(envVarName string) (int64, bool)
- func GetEnvVarTime(envVarName string) (time.Time, bool)
- func GetEnvVarUint64(envVarName string) (uint64, bool)
- func GetJWTConfigAndCleanKeys(ctx context.Context, serviceAccountEmail string, keyJSONFilePath string, ...) (*jwt.Config, bool)
- func GetPublishCallResult(ctx context.Context, publishResult *pubsubold.PublishResult, ...)
- func GetTopicList(ctx context.Context, pubSubPulisherClient *pubsub.PublisherClient, ...) error
- func IntialRetryCheck(ctxEvent context.Context, initFailed bool, retryTimeOutSeconds int64) (bool, *metadata.Metadata, error)
- func PrintEnptyInterfaceType(value interface{}, valueName string) error
- func RevertSlash(txt string) string
- type AssetGroup
- type AssetGroupSettings
- type AssetMember
- type ComplianceStatus
- type FeedMessageGroup
- type FeedMessageGroupSettings
- type FeedMessageMember
- type GCSEvent
- type Member
- type PubSubMessage
- type PublishRequest
- type Window
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildAncestorsDisplayName ¶
func BuildAncestorsDisplayName(ctx context.Context, ancestors []string, collectionID string, firestoreClient *firestore.Client, cloudresourcemanagerService *cloudresourcemanager.Service, cloudresourcemanagerServiceV2 *cloudresourcemanagerv2.Service) []string
BuildAncestorsDisplayName build a slice of Ancestor friendly name from a slice of ancestors
func BuildAncestryPath ¶
BuildAncestryPath build a path from a slice of ancestors
func CreateTopic ¶
func CreateTopic(ctx context.Context, pubSubPulisherClient *pubsub.PublisherClient, topicListPointer *[]string, topicName string, projectID string) error
CreateTopic check if a topic already exist, if not create it
func GetAssetContact ¶
func GetAssetContact(contactRole string, resourceJSON json.RawMessage) (string, error)
GetAssetContact retrieve owner of resolver contact from asset labels and parent labels
func GetByteSet ¶
GetByteSet return a set of lenght contiguous bytes starting at bytes
func GetClientOptionAndCleanKeys ¶
func GetClientOptionAndCleanKeys(ctx context.Context, serviceAccountEmail string, keyJSONFilePath string, projectID string, gciAdminUserToImpersonate string, scopes []string) (option.ClientOption, bool)
GetClientOptionAndCleanKeys build a clientOption object and manage the init state
func GetEnvVarBool ¶ added in v0.0.24
GetEnvVarBool retreive an os var, and convert it to bool
func GetEnvVarInt64 ¶
GetEnvVarInt64 retreive an os var, convert it and manage the init state
func GetEnvVarTime ¶
GetEnvVarTime retreive an os var, convert it and manage the init state
func GetEnvVarUint64 ¶
GetEnvVarUint64 retreive an os var, convert it and manage the init state
func GetJWTConfigAndCleanKeys ¶ added in v0.0.24
func GetJWTConfigAndCleanKeys(ctx context.Context, serviceAccountEmail string, keyJSONFilePath string, projectID string, gciAdminUserToImpersonate string, scopes []string) (*jwt.Config, bool)
GetJWTConfigAndCleanKeys build a JWT config and manage the init state
func GetPublishCallResult ¶
func GetPublishCallResult(ctx context.Context, publishResult *pubsubold.PublishResult, waitgroup *sync.WaitGroup, msgInfo string, pubSubErrNumber *uint64, pubSubMsgNumber *uint64, logEventEveryXPubSubMsg uint64)
GetPublishCallResult func to be used in go routine to scale pubsub event publish
func GetTopicList ¶
func GetTopicList(ctx context.Context, pubSubPulisherClient *pubsub.PublisherClient, projectID string, topicListPointer *[]string) error
GetTopicList retreive the list of existing pubsub topics
func IntialRetryCheck ¶
func IntialRetryCheck(ctxEvent context.Context, initFailed bool, retryTimeOutSeconds int64) (bool, *metadata.Metadata, error)
IntialRetryCheck performs intitial controls 1) return true and metadata when controls are passed 2) return false when controls failed: - 2a) with an error to retry the cloud function entry point function - 2b) with nil to stop the cloud function entry point function
func PrintEnptyInterfaceType ¶
PrintEnptyInterfaceType discover the type below an empty interface
Types ¶
type AssetGroup ¶
type AssetGroup struct { Name string `json:"name"` AssetType string `json:"assetType"` Ancestors []string `json:"ancestors"` AncestryPath string `json:"ancestryPath"` IamPolicy json.RawMessage `json:"iamPolicy"` Resource *admin.Group `json:"resource"` }
AssetGroup CAI like format
type AssetGroupSettings ¶
type AssetGroupSettings struct { Name string `json:"name"` AssetType string `json:"assetType"` Ancestors []string `json:"ancestors"` IamPolicy json.RawMessage `json:"iamPolicy"` Resource *groupssettings.Groups `json:"resource"` }
AssetGroupSettings CAI like format
type AssetMember ¶
type AssetMember struct { Name string `json:"name"` AssetType string `json:"assetType"` Ancestors []string `json:"ancestors"` AncestryPath string `json:"ancestryPath"` IamPolicy json.RawMessage `json:"iamPolicy"` Resource Member `json:"resource"` }
AssetMember CAI like format
type ComplianceStatus ¶ added in v0.0.14
type ComplianceStatus struct { AssetName string `json:"assetName"` AssetInventoryTimeStamp time.Time `json:"assetInventoryTimeStamp"` AssetInventoryOrigin string `json:"assetInventoryOrigin"` RuleName string `json:"ruleName"` RuleDeploymentTimeStamp time.Time `json:"ruleDeploymentTimeStamp"` Compliant bool `json:"compliant"` Deleted bool `json:"deleted"` }
ComplianceStatus by asset, by rule, true/false compliance status
type FeedMessageGroup ¶
type FeedMessageGroup struct { Asset AssetGroup `json:"asset"` Window Window `json:"window"` Deleted bool `json:"deleted"` Origin string `json:"origin"` }
FeedMessageGroup CAI like format
type FeedMessageGroupSettings ¶
type FeedMessageGroupSettings struct { Asset AssetGroupSettings `json:"asset"` Window Window `json:"window"` Deleted bool `json:"deleted"` Origin string `json:"origin"` }
FeedMessageGroupSettings CAI like format
type FeedMessageMember ¶
type FeedMessageMember struct { Asset AssetMember `json:"asset"` Window Window `json:"window"` Deleted bool `json:"deleted"` Origin string `json:"origin"` }
FeedMessageMember CAI like format
type GCSEvent ¶
type GCSEvent struct { Kind string `json:"kind"` ID string `json:"id"` SelfLink string `json:"selfLink"` Name string `json:"name"` Bucket string `json:"bucket"` Generation string `json:"generation"` Metageneration string `json:"metageneration"` ContentType string `json:"contentType"` TimeCreated time.Time `json:"timeCreated"` Updated time.Time `json:"updated"` TemporaryHold bool `json:"temporaryHold"` EventBasedHold bool `json:"eventBasedHold"` RetentionExpirationTime time.Time `json:"retentionExpirationTime"` StorageClass string `json:"storageClass"` TimeStorageClassUpdated time.Time `json:"timeStorageClassUpdated"` Size string `json:"size"` MD5Hash string `json:"md5Hash"` MediaLink string `json:"mediaLink"` ContentEncoding string `json:"contentEncoding"` ContentDisposition string `json:"contentDisposition"` CacheControl string `json:"cacheControl"` Metadata map[string]interface{} `json:"metadata"` CRC32C string `json:"crc32c"` ComponentCount int `json:"componentCount"` Etag string `json:"etag"` CustomerEncryption struct { EncryptionAlgorithm string `json:"encryptionAlgorithm"` KeySha256 string `json:"keySha256"` } KMSKeyName string `json:"kmsKeyName"` ResourceState string `json:"resourceState"` }
GCSEvent is the payload of a GCS event.
type Member ¶
type Member struct { MemberEmail string `json:"memberEmail"` GroupEmail string `json:"groupEmail"` ID string `json:"id"` Kind string `json:"kind"` Role string `json:"role"` Type string `json:"type"` }
Member is sligthly different from admim.Member to have both group email and member email
type PubSubMessage ¶
type PubSubMessage struct {
Data []byte `json:"data"`
}
PubSubMessage is the payload of a Pub/Sub event.
type PublishRequest ¶
type PublishRequest struct {
Topic string `json:"topic"`
}
PublishRequest Pub/sub