Documentation ¶
Index ¶
- func BuildAncestorsDisplayName(ctx context.Context, ancestors []string, collectionID string, ...) []string
- func BuildAncestryPath(ancestors []string) string
- func CreateTopic(ctx context.Context, pubSubClient *pubsub.Client, topicList []string, ...) 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 GetEnvVarInt64(envVarName string) (int64, bool)
- func GetEnvVarTime(envVarName string) (time.Time, bool)
- func GetEnvVarUint64(envVarName string) (uint64, bool)
- func GetPublishCallResult(ctx context.Context, publishResult *pubsub.PublishResult, ...)
- func GetTopicList(ctx context.Context, pubSubClient *pubsub.Client) ([]string, 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 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 fron a slice of ancestors
func BuildAncestryPath ¶
BuildAncestryPath build a path from a slice of ancestors
func CreateTopic ¶
func CreateTopic(ctx context.Context, pubSubClient *pubsub.Client, topicList []string, topicName 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 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 GetPublishCallResult ¶
func GetPublishCallResult(ctx context.Context, publishResult *pubsub.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 ¶
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 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