Documentation ¶
Index ¶
- Constants
- Variables
- func HashPassword(password string) string
- func SaveToFile(config *Config, filename string) error
- func ToGSuiteGroup(group *Group) (*directoryv1.Group, *groupssettingsv1.Groups)
- func ToGSuiteGroupMember(member *Member) *directoryv1.Member
- func ToGSuiteOrgUnit(orgUnit *OrgUnit) *directoryv1.OrgUnit
- func ToGSuiteUser(user *User, enableInsecurePasswords bool) *directoryv1.User
- func ValidateLicenses(licenses []License) []error
- type Config
- func (c *Config) DefaultGroups() error
- func (c *Config) DefaultOrgUnits() error
- func (c *Config) DefaultUsers() error
- func (c *Config) Sort()
- func (c *Config) UndefaultGroups() error
- func (c *Config) UndefaultOrgUnits() error
- func (c *Config) UndefaultUsers() error
- func (c *Config) ValidateGroups() []error
- func (c *Config) ValidateOrgUnits() []error
- func (c *Config) ValidateUsers() []error
- type CustomSchema
- type Employee
- type Group
- type License
- type Location
- type Member
- type OrgUnit
- type User
Constants ¶
View Source
const ( SchemaName = "gman" PasswordHashCustomField = "passwordHash" )
View Source
const ( // WhoCanContactOwner GroupOptionAllManagersCanContact = "ALL_MANAGERS_CAN_CONTACT" GroupOptionAllMembersCanContact = "ALL_MEMBERS_CAN_CONTACT" GroupOptionAllInDomainCanContact = "ALL_IN_DOMAIN_CAN_CONTACT" GroupOptionAnyoneCanContact = "ANYONE_CAN_CONTACT" GroupOptionWhoCanContactOwnerDefault = GroupOptionAllInDomainCanContact // WhoCanViewMembership GroupOptionAllManagersCanViewMembership = "ALL_MANAGERS_CAN_VIEW" GroupOptionAllMembersCanViewMembership = "ALL_MEMBERS_CAN_VIEW" GroupOptionAllInDomainCanViewMembership = "ALL_IN_DOMAIN_CAN_VIEW" GroupOptionWhoCanViewMembershipDefault = GroupOptionAllMembersCanViewMembership // WhoCanApproveMembers GroupOptionAllManagersCanApproveMembers = "ALL_MANAGERS_CAN_APPROVE" GroupOptionAllOwnersCanApproveMembers = "ALL_OWNERS_CAN_APPROVE" GroupOptionAllMembersCanApproveMembers = "ALL_MEMBERS_CAN_APPROVE" GroupOptionNoneCanApproveMembers = "NONE_CAN_APPROVE" GroupOptionWhoCanApproveMembersDefault = GroupOptionAllManagersCanApproveMembers // WhoCanPostMessage GroupOptionNoneCanPostMessage = "NONE_CAN_POST" GroupOptionAllOwnersCanPostMessage = "ALL_OWNERS_CAN_POST" GroupOptionAllManagersCanPostMessage = "ALL_MANAGERS_CAN_POST" GroupOptionAllMembersCanPostMessage = "ALL_MEMBERS_CAN_POST" GroupOptionAllInDomainCanPostMessage = "ALL_IN_DOMAIN_CAN_POST" GroupOptionAnyoneCanPostMessage = "ANYONE_CAN_POST" GroupOptionWhoCanPostMessageDefault = GroupOptionAllMembersCanPostMessage // WhoCanJoin GroupOptionInvitedCanJoin = "INVITED_CAN_JOIN" GroupOptionCanRequestToJoin = "CAN_REQUEST_TO_JOIN" GroupOptionAllInDomainCanJoin = "ALL_IN_DOMAIN_CAN_JOIN" GroupOptionAnyoneCanJoin = "ANYONE_CAN_JOIN" GroupOptionWhoCanJoinDefault = GroupOptionInvitedCanJoin // membership roles MemberRoleOwner = "OWNER" MemberRoleManager = "MANAGER" MemberRoleMember = "MEMBER" )
Variables ¶
View Source
var AllLicenses = []License{
{
ProductId: "Google-Apps",
SkuId: "1010020027",
Name: "GoogleWorkspaceBusinessStarter",
},
{
ProductId: "Google-Apps",
SkuId: "1010020028",
Name: "GoogleWorkspaceBusinessStandard",
},
{
ProductId: "Google-Apps",
SkuId: "1010020025",
Name: "GoogleWorkspaceBusinessPlus",
},
{
ProductId: "Google-Apps",
SkuId: "1010060003",
Name: "GoogleWorkspaceEnterpriseEssentials",
},
{
ProductId: "Google-Apps",
SkuId: "1010020026",
Name: "GoogleWorkspaceEnterpriseStandard",
},
{
ProductId: "Google-Apps",
SkuId: "1010020020",
Name: "GoogleWorkspaceEnterprisePlus",
},
{
ProductId: "Google-Apps",
SkuId: "1010060001",
Name: "GoogleWorkspaceEssentials",
},
{
ProductId: "Google-Apps",
SkuId: "Google-Apps-Unlimited",
Name: "GSuiteBusiness",
},
{
ProductId: "Google-Apps",
SkuId: "Google-Apps-For-Business",
Name: "GSuiteBasic",
},
{
ProductId: "Google-Apps",
SkuId: "Google-Apps-Lite",
Name: "GSuiteLite",
},
{
ProductId: "Google-Apps",
SkuId: "Google-Apps-For-Postini",
Name: "GoogleAppsMessageSecurity",
},
{
ProductId: "101031",
SkuId: "1010310002",
Name: "GSuiteEnterpriseForEducation",
},
{
ProductId: "101031",
SkuId: "1010310003",
Name: "GSuiteEnterpriseForEducationStudent",
},
{
ProductId: "Google-Drive-storage",
SkuId: "Google-Drive-storage-20GB",
Name: "GoogleDriveStorage20GB",
},
{
ProductId: "Google-Drive-storage",
SkuId: "Google-Drive-storage-50GB",
Name: "GoogleDriveStorage50GB",
},
{
ProductId: "Google-Drive-storage",
SkuId: "Google-Drive-storage-200GB",
Name: "GoogleDriveStorage200GB",
},
{
ProductId: "Google-Drive-storage",
SkuId: "Google-Drive-storage-400GB",
Name: "GoogleDriveStorage400GB",
},
{
ProductId: "Google-Drive-storage",
SkuId: "Google-Drive-storage-1TB",
Name: "GoogleDriveStorage1TB",
},
{
ProductId: "Google-Drive-storage",
SkuId: "Google-Drive-storage-2TB",
Name: "GoogleDriveStorage2TB",
},
{
ProductId: "Google-Drive-storage",
SkuId: "Google-Drive-storage-4TB",
Name: "GoogleDriveStorage4TB",
},
{
ProductId: "Google-Drive-storage",
SkuId: "Google-Drive-storage-8TB",
Name: "GoogleDriveStorage8TB",
},
{
ProductId: "Google-Drive-storage",
SkuId: "Google-Drive-storage-16TB",
Name: "GoogleDriveStorage16TB",
},
{
ProductId: "Google-Vault",
SkuId: "Google-Vault",
Name: "GoogleVault",
},
{
ProductId: "Google-Vault",
SkuId: "Google-Vault-Former-Employee",
Name: "GoogleVaultFormerEmployee",
},
{
ProductId: "101001",
SkuId: "1010010001",
Name: "CloudIdentity",
},
{
ProductId: "101005",
SkuId: "1010050001",
Name: "CloudIdentityPremium",
},
{
ProductId: "101033",
SkuId: "1010330003",
Name: "GoogleVoiceStarter",
},
{
ProductId: "101033",
SkuId: "1010330004",
Name: "GoogleVoiceStandard",
},
{
ProductId: "101033",
SkuId: "1010330002",
Name: "GoogleVoicePremier",
},
}
list of available GSuite Licenses
Functions ¶
func HashPassword ¶ added in v0.6.0
HashPassword returns an shortened hash for the given password; the hash is not meant to validate password inputs, but only to compare if the passwords have changed
func SaveToFile ¶
func ToGSuiteGroup ¶ added in v0.5.0
func ToGSuiteGroup(group *Group) (*directoryv1.Group, *groupssettingsv1.Groups)
func ToGSuiteGroupMember ¶ added in v0.5.0
func ToGSuiteGroupMember(member *Member) *directoryv1.Member
func ToGSuiteOrgUnit ¶ added in v0.5.0
func ToGSuiteOrgUnit(orgUnit *OrgUnit) *directoryv1.OrgUnit
func ToGSuiteUser ¶ added in v0.5.0
func ToGSuiteUser(user *User, enableInsecurePasswords bool) *directoryv1.User
func ValidateLicenses ¶ added in v0.5.0
Types ¶
type Config ¶
type Config struct { Organization string `yaml:"organization"` OrgUnits []OrgUnit `yaml:"orgUnits,omitempty"` Users []User `yaml:"users,omitempty"` Groups []Group `yaml:"groups,omitempty"` Licenses []License `yaml:"licenses,omitempty"` }
func LoadFromFile ¶
func (*Config) DefaultGroups ¶ added in v0.5.0
func (*Config) DefaultOrgUnits ¶ added in v0.5.0
func (*Config) DefaultUsers ¶ added in v0.5.0
func (*Config) UndefaultGroups ¶ added in v0.5.0
func (*Config) UndefaultOrgUnits ¶ added in v0.5.0
func (*Config) UndefaultUsers ¶ added in v0.5.0
func (*Config) ValidateGroups ¶ added in v0.0.6
func (*Config) ValidateOrgUnits ¶ added in v0.0.6
func (*Config) ValidateUsers ¶ added in v0.0.6
type CustomSchema ¶ added in v0.6.0
type CustomSchema struct {
PasswordHash string `json:"passwordHash"`
}
func GetUserSchema ¶ added in v0.6.0
func GetUserSchema(user *directoryv1.User) *CustomSchema
type Employee ¶ added in v0.5.0
type Group ¶ added in v0.5.0
type Group struct { Name string `yaml:"name"` Email string `yaml:"email"` Description string `yaml:"description,omitempty"` WhoCanContactOwner string `yaml:"whoCanContactOwner,omitempty"` WhoCanViewMembership string `yaml:"whoCanViewMembers,omitempty"` WhoCanApproveMembers string `yaml:"whoCanApproveMembers,omitempty"` WhoCanPostMessage string `yaml:"whoCanPostMessage,omitempty"` WhoCanJoin string `yaml:"whoCanJoin,omitempty"` AllowExternalMembers bool `yaml:"allowExternalMembers,omitempty"` IsArchived bool `yaml:"isArchived,omitempty"` Members []Member `yaml:"members,omitempty"` }
func ToConfigGroup ¶ added in v0.5.0
func ToConfigGroup(gsuiteGroup *directoryv1.Group, settings *groupssettingsv1.Groups, members []*directoryv1.Member) (Group, error)
type Location ¶ added in v0.5.0
type Member ¶ added in v0.5.0
func ToConfigGroupMember ¶ added in v0.5.0
func ToConfigGroupMember(gsuiteMember *directoryv1.Member) Member
type OrgUnit ¶ added in v0.5.0
type OrgUnit struct { Name string `yaml:"name"` Description string `yaml:"description,omitempty"` ParentOrgUnitPath string `yaml:"parentOrgUnitPath,omitempty"` BlockInheritance bool `yaml:"blockInheritance,omitempty"` }
func ToConfigOrgUnit ¶ added in v0.5.0
func ToConfigOrgUnit(orgUnit *directoryv1.OrgUnit) OrgUnit
type User ¶ added in v0.5.0
type User struct { FirstName string `yaml:"givenName"` LastName string `yaml:"familyName"` PrimaryEmail string `yaml:"primaryEmail"` Aliases []string `yaml:"aliases,omitempty"` Phones []string `yaml:"phones,omitempty"` RecoveryPhone string `yaml:"recoveryPhone,omitempty"` RecoveryEmail string `yaml:"recoveryEmail,omitempty"` OrgUnitPath string `yaml:"orgUnitPath,omitempty"` Licenses []string `yaml:"licenses,omitempty"` Employee Employee `yaml:"employeeInfo,omitempty"` Location Location `yaml:"location,omitempty"` Address string `yaml:"address,omitempty"` Password string `yaml:"password,omitempty"` }
func ToConfigUser ¶ added in v0.5.0
func ToConfigUser(gsuiteUser *directoryv1.User, userLicenses []License) (User, error)
Click to show internal directories.
Click to hide internal directories.