Documentation ¶
Index ¶
- Constants
- Variables
- func SimplifyAttributes(attrs Attributes) map[string]string
- type API
- func (api *API) DeleteGroupAttributes(groupName, attrName string) error
- func (api *API) DeleteUserAttributes(userName, attrName string) error
- func (api *API) GetGroup(groupName string, withAttributes bool) (*Group, error)
- func (api *API) GetGroupAttributes(groupName string) (Attributes, error)
- func (api *API) GetGroupDirectUsers(groupName string) ([]*User, error)
- func (api *API) GetGroupNestedUsers(groupName string) ([]*User, error)
- func (api *API) GetGroupUsers(groupName, groupType string) ([]*User, error)
- func (api *API) GetMemberships() ([]*Membership, error)
- func (api *API) GetUser(userName string, withAttributes bool) (*User, error)
- func (api *API) GetUserAttributes(userName string) (Attributes, error)
- func (api *API) GetUserDirectGroups(userName string) ([]*Group, error)
- func (api *API) GetUserGroups(userName, groupType string) ([]*Group, error)
- func (api *API) GetUserNestedGroups(userName string) ([]*Group, error)
- func (api *API) SearchGroups(cql string) ([]*Group, error)
- func (api *API) SearchUsers(cql string) ([]*User, error)
- func (api *API) SetGroupAttributes(groupName string, attrs *GroupAttributes) error
- func (api *API) SetUserAgent(app, version string)
- func (api *API) SetUserAttributes(userName string, attrs *UserAttributes) error
- type Attribute
- type Attributes
- type Group
- type GroupAttributes
- type Membership
- type User
- type UserAttributes
- type UserInfo
Constants ¶
const ( GROUP_DIRECT = "direct" GROUP_NESTED = "nested" )
Groups types
const ( // NAME is package name NAME = "Go-Crowd" // VERSION is package version VERSION = "3.0.2" )
Variables ¶
var ( ErrInitEmptyURL = errors.New("URL can't be empty") ErrInitEmptyApp = errors.New("App can't be empty") ErrInitEmptyPassword = errors.New("Password can't be empty") ErrNoPerms = errors.New("Application does not have permission to use Crowd") ErrUserNoFound = errors.New("User could not be found") ErrGroupNoFound = errors.New("Group could not be found") )
API errors
Functions ¶
func SimplifyAttributes ¶
func SimplifyAttributes(attrs Attributes) map[string]string
SimplifyAttributes convert slice with attributes to map name->value
Types ¶
type API ¶
type API struct { Client *fasthttp.Client // Client is client for http requests // contains filtered or unexported fields }
API is Confluence API struct
func (*API) DeleteGroupAttributes ¶
DeleteGroupAttributes deletes a group attribute
func (*API) DeleteUserAttributes ¶
DeleteUserAttributes deletes a user attribute
func (*API) GetGroupAttributes ¶
func (api *API) GetGroupAttributes(groupName string) (Attributes, error)
GetGroupAttributes returns a list of group attributes
func (*API) GetGroupDirectUsers ¶
GetGroupDirectUsers returns the users that are direct members of the specified group
func (*API) GetGroupNestedUsers ¶
GetGroupNestedUsers returns the users that are nested members of the specified group
func (*API) GetGroupUsers ¶
GetGroupUsers returns the users that are members of the specified group
func (*API) GetMemberships ¶
func (api *API) GetMemberships() ([]*Membership, error)
GetMemberships returns full details of all group memberships, with users and nested groups
func (*API) GetUserAttributes ¶
func (api *API) GetUserAttributes(userName string) (Attributes, error)
GetUserAttributes returns a list of user attributes
func (*API) GetUserDirectGroups ¶
GetUserDirectGroups returns the groups that the user is a direct member of
func (*API) GetUserGroups ¶
GetUserGroups returns the groups that the user is a member of
func (*API) GetUserNestedGroups ¶
GetUserNestedGroups returns the groups that the user is a nested member of
func (*API) SearchGroups ¶
SearchGroups searches for groups with the specified search restriction
func (*API) SearchUsers ¶
SearchUsers searches for users with the specified search restriction
func (*API) SetGroupAttributes ¶
func (api *API) SetGroupAttributes(groupName string, attrs *GroupAttributes) error
SetGroupAttributes stores all the group attributes
func (*API) SetUserAgent ¶
SetUserAgent set user-agent string based on app name and version
func (*API) SetUserAttributes ¶
func (api *API) SetUserAttributes(userName string, attrs *UserAttributes) error
SetUserAttributes stores all the user attributes for an existing user
type Attributes ¶
type Attributes []*Attribute
Attributes it is slice with attributes
func (Attributes) Get ¶
func (a Attributes) Get(name string) string
Get returns merged values for attribute with given name
func (Attributes) GetList ¶
func (a Attributes) GetList(name string) []string
GetList returns slice with values for attribute with given name
func (Attributes) Has ¶
func (a Attributes) Has(name string) bool
Has returns true if slice contains attribute with given name
type Group ¶
type Group struct { Name string `xml:"name,attr"` Description string `xml:"description"` Type string `xml:"type"` IsActive bool `xml:"active"` }
Group contains info about group
type GroupAttributes ¶
type GroupAttributes struct { XMLName xml.Name `xml:"attributes"` Attributes []*Attribute `xml:"attribute"` }
GroupAttributes contains group attributes
type Membership ¶
Membership contains membership info
type User ¶
type User struct { Attributes Attributes `xml:"attributes>attribute"` Name string `xml:"name,attr"` FirstName string `xml:"first-name"` LastName string `xml:"last-name"` DisplayName string `xml:"display-name"` Email string `xml:"email"` Key string `xml:"key,omitempty"` Password string `xml:"password>value,omitempty"` IsActive bool `xml:"active"` }
User contains info about user
type UserAttributes ¶
type UserAttributes struct { XMLName xml.Name `xml:"attributes,omitempty"` Attributes []*Attribute `xml:"attribute"` }
UserAttributes contains user attributes