modulepackage
0.0.0-20240404102856-301f51d0e202
Repository: https://github.com/celo-org/mockgcp.git
Documentation: pkg.go.dev
# Functions
AddBindingsToPolicy will add bindings to given policy and return the list of pointers to the bindings that were added.
BindingContains searches a binding for a member string and returns a boolean to indicate if found.
GenerateBinding Generates a binding with 10 members for use in testing.
GenerateBindings will create the specified number of bindings.
GenerateMember creates a binding member with a random name off a base principal in the format of an email address.
GeneratePolicy takes a number of bindings and generates a policy.
GenerateRole creates a random string and returns it to be used as a role.
New is the client which NewService will call to create a new service.
NewBinding takes a role and members and returns a binding.
NewClient returns the mock GCPClient client above.
NewFoldersService will return a new Folder Service.
NewOrganizationsService will return a new Organization Service.
NewPolicy creates a policy with the specified bindings.
NewProjectsService will return a new Project Service.
NewService creates a MockService and returns it with an http client Wrapper.
PolicyContains searches a policy for a role and returns its binding.
PolicyRoleMembers searches a Policy for a role and returns the members if they exist.
StringGenerator returns a random string.
# Structs
Folder is a mock of a google cloud Folder.
FoldersGetIamPolicyCall is a structure that is returned by Folders.GetIamPolicy which contains the Request to get a policy.
FoldersService is a mock of google Cloud's Folder Service.
FoldersSetIamPolicyCall is a structure that is returned by Folders.SetIamPolicy which contains the Request to get a policy.
GCPClient is the final wrapper we make with locally assigned methods, so we can match it on an interface easier.
MockService is a mockup of cloud resource manager's service (wrapper for it's client).
Organization is a mock of a google cloud Organization.
OrganizationsGetIamPolicyCall is a structure that is returned by Organizations.GetIamPolicy which contains the Request to get a policy.
OrganizationsService is a mock of google Cloud's Organization Service.
OrganizationsSetIamPolicyCall is a structure that is returned by Organizations.SetIamPolicy which contains the Request to get a policy.
Project is a mock of a google cloud Project.
ProjectsGetIamPolicyCall is a structure that is returned by Projects.GetIamPolicy which contains the Request to get a policy.
ProjectsService is a mock of google Cloud's Project Service.
ProjectsSetIamPolicyCall is a structure that is returned by Projects.SetIamPolicy which contains the Request to get a policy.
# Interfaces
PolicyCallItf interface will match for Do() so we can call it on SetPolicyCall and GetPolicyCall.