xml_users

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountUsers

func CountUsers(users []*XmlUser) map[string]int

CountUsers returns the set of users as a map from username to the number of times that user appears in the list.

func WriteUsers

func WriteUsers(fname string, glUsers []*gitlab.User) error

WriteUsers writes the users to the output file. If the output file already exists, the users will be merged into the existing output file.

Types

type XmlUser

type XmlUser struct {
	ID       int    `xml:"id"`
	Username string `xml:"username"`
	Email    string `xml:"email"`
	Name     string `xml:"name"`
}

User for the user.xml file.

func AppendUsersFromFile

func AppendUsersFromFile(
	fname string,
	newXmlUsers []*XmlUser,
) ([]*XmlUser,
	error,
)

appendUsersFromFile appends the list of new users to the list of users from the XML file. The newly looked up users will replace users having the same ID in the XML file.

func FromGitlabUser

func FromGitlabUser(glUser *gitlab.User) *XmlUser

FromGitlabUser converts from gitlab.User to gilab_util.XmlUser by removing all the unnecessary user information.

func FromGitlabUsers

func FromGitlabUsers(glUsers []*gitlab.User) []*XmlUser

FromGitlabUsers converts from gitlab.User slice to gilab_util.XmlUser slice by removing all the unnecessary user information.

func ReadUsers

func ReadUsers(fname string) ([]*XmlUser, error)

ReadUsers reads the users from the XML file.

type XmlUsers

type XmlUsers struct {
	XMLName xml.Name   `xml:"users"`
	Users   []*XmlUser `xml:"user"`
}

User list for the user.xml file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL