Documentation ¶
Index ¶
- func IsNil(i interface{}) bool
- type APIKey
- type APIQuery
- type ApiKeyService
- type ExternalUserSearchQuery
- type Identity
- type IdentityClaim
- type SignInQuery
- type User
- type UserAuthentication
- type UserQuery
- type UserService
- func (s *UserService) Add(user *User) (*User, error)
- func (s *UserService) Get(usersQuery UsersQuery) (*resources.Resources[*User], error)
- func (s *UserService) GetAPIKeyByID(user *User, apiKeyID string) (*APIKey, error)
- func (s *UserService) GetAPIKeys(user *User, apiQuery ...APIQuery) (*resources.Resources[*APIKey], error)
- func (s *UserService) GetAll() ([]*User, error)
- func (s *UserService) GetAuthentication() (*UserAuthentication, error)
- func (s *UserService) GetAuthenticationByUser(user *User) (*UserAuthentication, error)
- func (s *UserService) GetByID(id string) (*User, error)
- func (s *UserService) GetMe() (*User, error)
- func (s *UserService) GetPermissions(user *User, userQuery ...UserQuery) (*permissions.UserPermissionSet, error)
- func (s *UserService) GetPermissionsConfiguration(user *User, userQuery ...UserQuery) (*permissions.UserPermissionSet, error)
- func (s *UserService) GetSpaces(user *User) ([]*spaces.Space, error)
- func (s *UserService) GetTeams(user *User, userQuery ...UserQuery) (*[]permissions.ProjectedTeamReferenceDataItem, error)
- func (s *UserService) Update(user *User) (*User, error)
- type UsersQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIKey ¶
type APIKey struct { APIKey string `json:"ApiKey,omitempty"` Created *time.Time `json:"Created,omitempty"` Purpose string `json:"Purpose,omitempty"` UserID string `json:"UserId,omitempty"` resources.Resource }
APIKey represents an API key.
type ApiKeyService ¶
ApiKeyService handles communication with API key-related methods of the Octopus API.
func NewAPIKeyService ¶
func NewAPIKeyService(sling *sling.Sling, uriTemplate string) *ApiKeyService
NewAPIKeyService returns an ApiKeyService with a preconfigured client.
func (*ApiKeyService) Create ¶
func (s *ApiKeyService) Create(apiKey *APIKey) (*APIKey, error)
Create generates a new API key for the specified user ID. The API key returned in the result must be saved by the caller, as it cannot be retrieved subsequently from the Octopus server.
func (*ApiKeyService) GetByID ¶
func (s *ApiKeyService) GetByID(userID string, apiKeyID string) (*APIKey, error)
GetByID the API key that belongs to the user by its ID.
func (*ApiKeyService) GetByUserID ¶
func (s *ApiKeyService) GetByUserID(userID string) ([]*APIKey, error)
GetByUserID lists all API keys for a user, returning the most recent results first.
type ExternalUserSearchQuery ¶
type ExternalUserSearchQuery struct {
PartialName string `uri:"partialName,omitempty" url:"partialName,omitempty"`
}
type Identity ¶
type Identity struct { Claims map[string]IdentityClaim `json:"Claims,omitempty"` IdentityProviderName string `json:"IdentityProviderName,omitempty"` }
type IdentityClaim ¶
type SignInQuery ¶
type SignInQuery struct {
ReturnURL string `uri:"returnUrl,omitempty" url:"returnUrl,omitempty"`
}
type User ¶
type User struct { CanPasswordBeEdited bool `json:"CanPasswordBeEdited,omitempty"` DisplayName string `json:"DisplayName,omitempty"` EmailAddress string `json:"EmailAddress,omitempty"` Identities []Identity `json:"Identities,omitempty"` IsActive bool `json:"IsActive,omitempty"` IsRequestor bool `json:"IsRequestor,omitempty"` IsService bool `json:"IsService,omitempty"` Password string `json:"Password,omitempty" validate:"max=20"` Username string `json:"Username,omitempty"` resources.Resource }
User represents a user in Octopus.
type UserAuthentication ¶
type UserAuthentication struct { AuthenticationProviders []authentication.AuthenticationProviderElement CanCurrentUserEditIdentitiesForUser bool Links map[string]string }
UserAuthentication represents enabled authentication providers and whether the current user can edit logins for the given user.
type UserService ¶
type UserService struct { services.CanDeleteService // contains filtered or unexported fields }
func NewUserService ¶
func NewUserService( sling *sling.Sling, uriTemplate string, apiKeysPath string, authenticateOctopusIDPath string, currentUserPath string, externalUserSearchPath string, registerPath string, signInPath string, signOutPath string, userAuthenticationPath string, userIdentityMetadataPath string) *UserService
func (*UserService) Add ¶
func (s *UserService) Add(user *User) (*User, error)
Add creates a new user.
func (*UserService) Get ¶
func (s *UserService) Get(usersQuery UsersQuery) (*resources.Resources[*User], error)
Get returns a collection of users based on the criteria defined by its input query parameter. If an error occurs, an empty collection is returned along with the associated error.
func (*UserService) GetAPIKeyByID ¶
func (s *UserService) GetAPIKeyByID(user *User, apiKeyID string) (*APIKey, error)
func (*UserService) GetAPIKeys ¶
func (*UserService) GetAll ¶
func (s *UserService) GetAll() ([]*User, error)
GetAll returns all users. If none can be found or an error occurs, it returns an empty collection.
func (*UserService) GetAuthentication ¶
func (s *UserService) GetAuthentication() (*UserAuthentication, error)
func (*UserService) GetAuthenticationByUser ¶
func (s *UserService) GetAuthenticationByUser(user *User) (*UserAuthentication, error)
func (*UserService) GetByID ¶
func (s *UserService) GetByID(id string) (*User, error)
GetByID returns the user that matches the input ID. If one cannot be found, it returns nil and an error.
func (*UserService) GetMe ¶
func (s *UserService) GetMe() (*User, error)
GetMe returns the user associated with the key used to invoke this API.
func (*UserService) GetPermissions ¶
func (s *UserService) GetPermissions(user *User, userQuery ...UserQuery) (*permissions.UserPermissionSet, error)
func (*UserService) GetPermissionsConfiguration ¶
func (s *UserService) GetPermissionsConfiguration(user *User, userQuery ...UserQuery) (*permissions.UserPermissionSet, error)
func (*UserService) GetSpaces ¶
func (s *UserService) GetSpaces(user *User) ([]*spaces.Space, error)
func (*UserService) GetTeams ¶
func (s *UserService) GetTeams(user *User, userQuery ...UserQuery) (*[]permissions.ProjectedTeamReferenceDataItem, error)