Documentation ¶
Index ¶
- Constants
- Variables
- func ErrNotOK(statusCode int, body string) error
- func MakeDeploymentUserName(repoName string) string
- func MakeOrgPipelineCmsNs(orgID uint64) string
- func MakeOrgRepoName(format RepositoryFormat, _type RepositoryType, orgID uint64, suffix ...string) string
- func MakeOrgThirdPartyRepoName(format RepositoryFormat, _type RepositoryType, orgID uint64, ...) string
- func MakePlatformPipelineCmsNs() string
- func MakePublisherPipelineCmNs(publisherID uint64) string
- func MakePublisherRepoName(format RepositoryFormat, _type RepositoryType, publisherID uint64) string
- func MakeReadonlyUserName(repoName string) string
- type BaseRepositoryCreateRequest
- type BlobStore
- type BlobStoreDeleteRequest
- type BlobStoreListRequest
- type BlobStoreSoftQuota
- type BlobStoreType
- type BlobUseNetdata
- type ContentSelector
- type ContentSelectorCreateRequest
- type ContentSelectorDeleteRequest
- type ContentSelectorGetRequest
- type ContentSelectorListRequest
- type ContentSelectorUpdateRequest
- type DockerHostedRepositoryCreateRequest
- type DockerHostedRepositoryUpdateRequest
- type DockerProxyRepositoryCreateRequest
- type DockerProxyRepositoryUpdateRequest
- type EnsureDeploymentUserRequest
- type EnsureUserRequest
- type ExternalRoleID
- type FileBlobStoreCreateRequest
- type FileBlobStoreGetRequest
- type FileBlobStoreUpdateRequest
- type GroupRepositoryCreateRequest
- type HostedRepositoryCreateRequest
- type HostedRepositoryStorageConfig
- type MavenGroupRepositoryCreateRequest
- type MavenGroupRepositoryUpdateRequest
- type MavenHostedRepositoryCreateRequest
- type MavenHostedRepositoryUpdateRequest
- type MavenProxyRepositoryCreateRequest
- type MavenProxyRepositoryUpdateRequest
- type Nexus
- func (n *Nexus) ChangeUserPassword(req UserChangePasswordRequest) error
- func (n *Nexus) ContentSelectorCreateRequest(req ContentSelectorCreateRequest) error
- func (n *Nexus) ContentSelectorGetRequest(req ContentSelectorGetRequest) (*ContentSelector, error)
- func (n *Nexus) ContentSelectorListRequest(req ContentSelectorListRequest) ([]ContentSelector, error)
- func (n *Nexus) CreateDockerHostedRepository(req DockerHostedRepositoryCreateRequest) error
- func (n *Nexus) CreateDockerProxyRepository(req DockerProxyRepositoryCreateRequest) error
- func (n *Nexus) CreateFileBlobStore(req FileBlobStoreCreateRequest) error
- func (n *Nexus) CreateMavenGroupRepository(req MavenGroupRepositoryCreateRequest) error
- func (n *Nexus) CreateMavenHostedRepository(req MavenHostedRepositoryCreateRequest) error
- func (n *Nexus) CreateMavenProxyRepository(req MavenProxyRepositoryCreateRequest) error
- func (n *Nexus) CreateNpmGroupRepository(req NpmGroupRepositoryCreateRequest) error
- func (n *Nexus) CreateNpmHostedRepository(req NpmHostedRepositoryCreateRequest) error
- func (n *Nexus) CreateNpmProxyRepository(req NpmProxyRepositoryCreateRequest) error
- func (n *Nexus) CreateRepository(req RepositoryCreator) error
- func (n *Nexus) CreateRepositoryContentSelectorPrivilege(req RepositoryContentSelectorPrivilegeCreateRequest) error
- func (n *Nexus) CreateRole(req RoleCreateRequest) error
- func (n *Nexus) CreateUser(req UserCreateRequest) error
- func (n *Nexus) DeleteBlobStore(req BlobStoreDeleteRequest) error
- func (n *Nexus) DeleteContentSelector(req ContentSelectorDeleteRequest) error
- func (n *Nexus) DeletePrivilege(req PrivilegeDeleteRequest) error
- func (n *Nexus) DeleteRepository(req RepositoryDeleteRequest) error
- func (n *Nexus) DeleteRole(req RoleDeleteRequest) error
- func (n *Nexus) EnsureAddRealms(req RealmEnsureAddRequest) error
- func (n *Nexus) EnsureFileBlobStore(req FileBlobStoreCreateRequest) error
- func (n *Nexus) EnsureNpmHostedRepository(req NpmHostedRepositoryCreateRequest) error
- func (n *Nexus) EnsureRepository(req RepositoryCreator) error
- func (n *Nexus) EnsureRole(req RoleCreateRequest) error
- func (n *Nexus) EnsureUser(req EnsureUserRequest) (UserID, error)
- func (n *Nexus) GetFileBlobStore(req FileBlobStoreGetRequest) (*BlobStore, error)
- func (n *Nexus) GetPrivilege(req PrivilegeGetRequest) (*Privilege, error)
- func (n *Nexus) GetRepository(req RepositoryGetRequest) (*Repository, error)
- func (n *Nexus) GetRole(req RoleGetRequest) (*Role, error)
- func (n *Nexus) GetUser(userID UserID) (*User, error)
- func (n *Nexus) InvalidateRepositoryCache(req RepositoryInvalidateCacheRequest) error
- func (n *Nexus) ListActiveRealms(req RealmListActiveRequest) ([]RealmID, error)
- func (n *Nexus) ListAvailableRealms(req RealmListAvailableRequest) ([]Realm, error)
- func (n *Nexus) ListBlobStore(req BlobStoreListRequest) ([]BlobStore, error)
- func (n *Nexus) ListPrivileges(req PrivilegeListRequest) ([]Privilege, error)
- func (n *Nexus) ListRepositories(req RepositoryListRequest) ([]Repository, error)
- func (n *Nexus) ListRoles(req RoleListRequest) ([]Role, error)
- func (n *Nexus) ListUsers(req UserListRequest) ([]User, error)
- func (n *Nexus) RebuildRepositoryIndex(req RepositoryRebuildIndexRequest) error
- func (n *Nexus) SetActiveRealms(req RealmSetActivesRequest) error
- func (n *Nexus) UpdateContentSelector(req ContentSelectorUpdateRequest) error
- func (n *Nexus) UpdateDockerHostedRepository(req DockerHostedRepositoryUpdateRequest) error
- func (n *Nexus) UpdateDockerProxyRepository(req DockerProxyRepositoryUpdateRequest) error
- func (n *Nexus) UpdateFileBlobStore(req FileBlobStoreUpdateRequest) error
- func (n *Nexus) UpdateMavenHostedRepository(req MavenHostedRepositoryUpdateRequest) error
- func (n *Nexus) UpdateMavenProxyRepository(req MavenProxyRepositoryUpdateRequest) error
- func (n *Nexus) UpdateNpmGroupRepository(req NpmGroupRepositoryUpdateRequest) error
- func (n *Nexus) UpdateNpmHostedRepository(req NpmHostedRepositoryUpdateRequest) error
- func (n *Nexus) UpdateNpmProxyRepository(req NpmProxyRepositoryUpdateRequest) error
- func (n *Nexus) UpdateRepository(req RepositoryCreator) error
- func (n *Nexus) UpdateRepositoryContentSelectorPrivilege(req RepositoryContentSelectorPrivilegeUpdateRequest) error
- func (n *Nexus) UpdateRole(req RoleUpdateRequest) error
- func (n *Nexus) UpdateUser(req UserUpdateRequest) error
- type NpmGroupRepositoryCreateRequest
- type NpmGroupRepositoryUpdateRequest
- type NpmHostedRepositoryCreateRequest
- type NpmHostedRepositoryUpdateRequest
- type NpmProxyRepositoryCreateRequest
- type NpmProxyRepositoryUpdateRequest
- type Option
- type Privilege
- type PrivilegeAction
- type PrivilegeDeleteRequest
- type PrivilegeGetRequest
- type PrivilegeID
- type PrivilegeListRequest
- type PrivilegeType
- type ProxyRepositoryCreateRequest
- func (r ProxyRepositoryCreateRequest) GetHttpClient() RepositoryHttpClientConfig
- func (r ProxyRepositoryCreateRequest) GetNegativeCache() RepositoryNegativeCacheConfig
- func (r ProxyRepositoryCreateRequest) GetProxy() RepositoryProxyConfig
- func (r ProxyRepositoryCreateRequest) GetRoutingRule() string
- func (r ProxyRepositoryCreateRequest) GetType() RepositoryType
- type Realm
- type RealmEnsureAddRequest
- type RealmID
- type RealmListActiveRequest
- type RealmListAvailableRequest
- type RealmSetActivesRequest
- type Repository
- type RepositoryAuthenticationType
- type RepositoryCleanupConfig
- type RepositoryContentSelectorPrivilegeCreateRequest
- type RepositoryContentSelectorPrivilegeUpdateRequest
- type RepositoryCreator
- type RepositoryDeleteRequest
- type RepositoryDockerConfig
- type RepositoryDockerProxyConfig
- type RepositoryExtra
- type RepositoryFormat
- type RepositoryGetRequest
- type RepositoryGroupConfig
- type RepositoryGroupCreator
- type RepositoryHttpClientAuthentication
- type RepositoryHttpClientConfig
- type RepositoryHttpClientConnection
- type RepositoryInvalidateCacheRequest
- type RepositoryListRequest
- type RepositoryMavenConfig
- type RepositoryMavenLayoutPolicy
- type RepositoryMavenVersionPolicy
- type RepositoryNegativeCacheConfig
- type RepositoryProxyConfig
- type RepositoryProxyCreator
- type RepositoryRebuildIndexRequest
- type RepositoryStorageWritePolicy
- type RepositoryType
- type Role
- type RoleCreateRequest
- type RoleDeleteRequest
- type RoleGetRequest
- type RoleID
- type RoleListRequest
- type RoleUpdateRequest
- type Server
- type User
- type UserChangePasswordRequest
- type UserCreateRequest
- type UserEnsureRequest
- type UserID
- type UserListRequest
- type UserSource
- type UserStatus
- type UserUpdateRequest
Constants ¶
const ( HeaderAuthorization = "Authorization" HeaderContentType = "Content-Type" )
const (
DefaultBlobNetdataDir = "nexus-netdata/"
)
Variables ¶
var ( ErrNotFound = errors.New("not found") ErrMissingRepoFormat = errors.New("missing repo format") )
var ( RepoDeploymentPrivileges = []PrivilegeAction{PrivilegeActionADD, PrivilegeActionBROWSE, PrivilegeActionEDIT, PrivilegeActionREAD} RepoReadOnlyPrivileges = []PrivilegeAction{PrivilegeActionBROWSE, PrivilegeActionREAD} )
var ( LocalAuthenticatingRealm = Realm{ID: "NexusAuthenticatingRealm", Name: "Local Authenticating Realm"} LocalAuthorizingRealm = Realm{ID: "NexusAuthorizingRealm", Name: "Local Authorizing Realm"} NpmBearerTokenRealm = Realm{ID: "NpmToken", Name: "npm Bearer Token Realm"} ConanTokenRealm = Realm{ID: "org.sonatype.repository.conan.internal.security.token.ConanTokenRealm", Name: "Conan Bearer Token Realm"} DefaultRoleRealm = Realm{ID: "DefaultRole", Name: "Default Role Realm"} DockerTokenRealm = Realm{ID: "DockerToken", Name: "Docker Bearer Token Realm"} LDAPRealm = Realm{ID: "LdapRealm", Name: "LDAP Realm"} NuGetApiKeyRealm = Realm{ID: "NuGetApiKey", Name: "NuGet API-Key Realm"} RutAuthRealm = Realm{ID: "rutauth-realm", Name: "Rut Auth Realm"} )
var ( RepositoryFormatMaven RepositoryFormat = "maven" RepositoryFormatNpm RepositoryFormat = "npm" RepositoryFormatDocker RepositoryFormat = "docker" RepositoryFormatAny RepositoryFormat = "*" RepositoryTypeHosted RepositoryType = "hosted" RepositoryTypeGroup RepositoryType = "group" RepositoryTypeProxy RepositoryType = "proxy" RepositoryMavenVersionPolicyRelease RepositoryMavenVersionPolicy = "RELEASE" RepositoryMavenVersionPolicySnapshot RepositoryMavenVersionPolicy = "SNAPSHOT" RepositoryMavenVersionPolicyMixed RepositoryMavenVersionPolicy = "MIXED" RepositoryMavenLayoutPolicyStrict RepositoryMavenLayoutPolicy = "STRICT" RepositoryMavenLayoutPolicyPermissive RepositoryMavenLayoutPolicy = "PERMISSIVE" RepositoryStorageWritePolicyAllowRedploy RepositoryStorageWritePolicy = "ALLOW" RepositoryStorageWritePolicyDisableRedeploy RepositoryStorageWritePolicy = "ALLOW_ONCE" RepositoryStorageWritePolicyReadOnly RepositoryStorageWritePolicy = "DENY" RepositoryAuthenticationTypeUsername RepositoryAuthenticationType = "username" RepositoryAuthenticationTypeNTLM RepositoryAuthenticationType = "ntlm" // windows ntlm )
Functions ¶
func MakeDeploymentUserName ¶
${repoName}-deployment
func MakeOrgRepoName ¶
func MakeOrgRepoName(format RepositoryFormat, _type RepositoryType, orgID uint64, suffix ...string) string
${format}-${type}-org-${orgID} example: npm-proxy-org-2
func MakeOrgThirdPartyRepoName ¶
func MakeOrgThirdPartyRepoName(format RepositoryFormat, _type RepositoryType, orgID uint64, thirdPartyName string) string
${format}-${type}-org-${orgID}-thirdparty-${thirdpartyName}
func MakePublisherPipelineCmNs ¶
publisher-${publisherID}-nexus
func MakePublisherRepoName ¶
func MakePublisherRepoName(format RepositoryFormat, _type RepositoryType, publisherID uint64) string
${format}-${type}-publisher-${publisherID} example: npm-proxy-publisher-1
Types ¶
type BaseRepositoryCreateRequest ¶
type BaseRepositoryCreateRequest struct { // A unique identifier for this repository // pattern: ^[a-zA-Z0-9\-]{1}[a-zA-Z0-9_\-\.]*$ // example: internal Name string `json:"name"` // Whether this repository accepts incoming requests Online bool `json:"online"` Storage HostedRepositoryStorageConfig `json:"storage"` Cleanup *RepositoryCleanupConfig `json:"cleanup"` }
func (BaseRepositoryCreateRequest) GetCleanup ¶
func (r BaseRepositoryCreateRequest) GetCleanup() *RepositoryCleanupConfig
func (BaseRepositoryCreateRequest) GetName ¶
func (r BaseRepositoryCreateRequest) GetName() string
func (BaseRepositoryCreateRequest) GetOnline ¶
func (r BaseRepositoryCreateRequest) GetOnline() bool
func (BaseRepositoryCreateRequest) GetStorage ¶
func (r BaseRepositoryCreateRequest) GetStorage() HostedRepositoryStorageConfig
type BlobStore ¶
type BlobStore struct { SoftQuota *BlobStoreSoftQuota `json:"softQuota"` Name string `json:"name"` Type BlobStoreType `json:"type"` Path string `json:"path"` BlobCount int64 `json:"blobCount"` TotalSizeInBytes int64 `json:"totalSizeInBytes"` AvailableSpaceInBytes int64 `json:"availableSpaceInBytes"` }
type BlobStoreDeleteRequest ¶
type BlobStoreDeleteRequest struct {
BlobName string
}
type BlobStoreListRequest ¶
type BlobStoreListRequest struct { }
type BlobStoreSoftQuota ¶
type BlobStoreType ¶
type BlobStoreType string
var ( BlobStoreTypeFile BlobStoreType = "file" BlobStoreTypeS3 BlobStoreType = "s3" )
type BlobUseNetdata ¶
type BlobUseNetdata struct {
UseNetdata bool `json:"useNetdata,omitempty"`
}
UseNetdata means if blob store in netdata.
type ContentSelector ¶
type ContentSelectorCreateRequest ¶
type ContentSelectorCreateRequest struct { // The content selector name cannot be changed after creation. // pattern: ^[a-zA-Z0-9\-]{1}[a-zA-Z0-9_\-\.]*$ Name string `json:"name"` // A human-readable description // allowEmptyValue: true Description string `json:"description"` // The expression used to identify content // example: format == "maven2" and path =^ "/org/sonatype/nexus" Expression string `json:"expression"` }
type ContentSelectorDeleteRequest ¶
type ContentSelectorDeleteRequest struct {
ContentSelectorName string
}
type ContentSelectorGetRequest ¶
type ContentSelectorGetRequest struct {
ContentSelectorName string
}
type ContentSelectorListRequest ¶
type ContentSelectorListRequest struct { }
type DockerHostedRepositoryCreateRequest ¶
type DockerHostedRepositoryCreateRequest struct { HostedRepositoryCreateRequest Docker RepositoryDockerConfig `json:"docker,omitempty"` // contains filtered or unexported fields }
hosted
func (DockerHostedRepositoryCreateRequest) GetFormat ¶
func (d DockerHostedRepositoryCreateRequest) GetFormat() RepositoryFormat
type DockerHostedRepositoryUpdateRequest ¶
type DockerHostedRepositoryUpdateRequest DockerHostedRepositoryCreateRequest
type DockerProxyRepositoryCreateRequest ¶
type DockerProxyRepositoryCreateRequest struct { ProxyRepositoryCreateRequest Docker RepositoryDockerConfig `json:"docker,omitempty"` DockerProxy RepositoryDockerProxyConfig `json:"dockerProxy,omitempty"` // contains filtered or unexported fields }
proxy
func (DockerProxyRepositoryCreateRequest) GetFormat ¶
func (d DockerProxyRepositoryCreateRequest) GetFormat() RepositoryFormat
type DockerProxyRepositoryUpdateRequest ¶
type DockerProxyRepositoryUpdateRequest DockerProxyRepositoryCreateRequest
type EnsureDeploymentUserRequest ¶
type EnsureDeploymentUserRequest struct { RepoName string RepoFormat RepositoryFormat Password string }
type EnsureUserRequest ¶
type EnsureUserRequest struct { // +required UserName string // +required Password string // +required RepoPrivileges map[RepositoryFormat]map[string][]PrivilegeAction // +optional // whether update password when option is update, not create ForceUpdatePassword bool }
type ExternalRoleID ¶
type ExternalRoleID string
type FileBlobStoreCreateRequest ¶
type FileBlobStoreCreateRequest struct { SoftQuota *BlobStoreSoftQuota `json:"softQuota"` // The path to the blobstore contents. // This can be an absolute path to anywhere on the system nxrm has access to or it can be a path relative to the sonatype-work directory. Path string `json:"path"` Name string `json:"name"` BlobUseNetdata }
type FileBlobStoreGetRequest ¶
type FileBlobStoreGetRequest struct {
Name string
}
type FileBlobStoreUpdateRequest ¶
type FileBlobStoreUpdateRequest struct {
FileBlobStoreCreateRequest
}
type GroupRepositoryCreateRequest ¶
type GroupRepositoryCreateRequest struct { BaseRepositoryCreateRequest Group RepositoryGroupConfig `json:"group"` }
func (GroupRepositoryCreateRequest) GetGroup ¶
func (r GroupRepositoryCreateRequest) GetGroup() RepositoryGroupConfig
func (GroupRepositoryCreateRequest) GetType ¶
func (r GroupRepositoryCreateRequest) GetType() RepositoryType
type HostedRepositoryCreateRequest ¶
type HostedRepositoryCreateRequest struct{ BaseRepositoryCreateRequest }
func (HostedRepositoryCreateRequest) GetType ¶
func (r HostedRepositoryCreateRequest) GetType() RepositoryType
type HostedRepositoryStorageConfig ¶
type HostedRepositoryStorageConfig struct { // Blob store used to store repository contents // example: default BlobStoreName string `json:"blobStoreName"` // Whether to validate uploaded content's MIME type appropriate for the repository format // example: true StrictContentTypeValidation bool `json:"strictContentTypeValidation"` // Controls if deployments of and updates to assets are allowed // example: allow_once WritePolicy RepositoryStorageWritePolicy `json:"writePolicy"` BlobUseNetdata }
type MavenGroupRepositoryCreateRequest ¶
type MavenGroupRepositoryCreateRequest struct { GroupRepositoryCreateRequest // contains filtered or unexported fields }
group
func (MavenGroupRepositoryCreateRequest) GetFormat ¶
func (m MavenGroupRepositoryCreateRequest) GetFormat() RepositoryFormat
type MavenGroupRepositoryUpdateRequest ¶
type MavenGroupRepositoryUpdateRequest MavenGroupRepositoryCreateRequest
type MavenHostedRepositoryCreateRequest ¶
type MavenHostedRepositoryCreateRequest struct { HostedRepositoryCreateRequest Maven RepositoryMavenConfig `json:"maven,omitempty"` // contains filtered or unexported fields }
hosted
func (MavenHostedRepositoryCreateRequest) GetFormat ¶
func (m MavenHostedRepositoryCreateRequest) GetFormat() RepositoryFormat
type MavenHostedRepositoryUpdateRequest ¶
type MavenHostedRepositoryUpdateRequest MavenHostedRepositoryCreateRequest
type MavenProxyRepositoryCreateRequest ¶
type MavenProxyRepositoryCreateRequest struct { ProxyRepositoryCreateRequest Maven RepositoryMavenConfig `json:"maven,omitempty"` // contains filtered or unexported fields }
proxy
func (MavenProxyRepositoryCreateRequest) GetFormat ¶
func (m MavenProxyRepositoryCreateRequest) GetFormat() RepositoryFormat
type MavenProxyRepositoryUpdateRequest ¶
type MavenProxyRepositoryUpdateRequest MavenProxyRepositoryCreateRequest
type Nexus ¶
type Nexus struct { Server // contains filtered or unexported fields }
func (*Nexus) ChangeUserPassword ¶
func (n *Nexus) ChangeUserPassword(req UserChangePasswordRequest) error
func (*Nexus) ContentSelectorCreateRequest ¶
func (n *Nexus) ContentSelectorCreateRequest(req ContentSelectorCreateRequest) error
func (*Nexus) ContentSelectorGetRequest ¶
func (n *Nexus) ContentSelectorGetRequest(req ContentSelectorGetRequest) (*ContentSelector, error)
func (*Nexus) ContentSelectorListRequest ¶
func (n *Nexus) ContentSelectorListRequest(req ContentSelectorListRequest) ([]ContentSelector, error)
func (*Nexus) CreateDockerHostedRepository ¶
func (n *Nexus) CreateDockerHostedRepository(req DockerHostedRepositoryCreateRequest) error
func (*Nexus) CreateDockerProxyRepository ¶
func (n *Nexus) CreateDockerProxyRepository(req DockerProxyRepositoryCreateRequest) error
func (*Nexus) CreateFileBlobStore ¶
func (n *Nexus) CreateFileBlobStore(req FileBlobStoreCreateRequest) error
func (*Nexus) CreateMavenGroupRepository ¶
func (n *Nexus) CreateMavenGroupRepository(req MavenGroupRepositoryCreateRequest) error
TODO 3.22 not provide maven group repository create rest api
func (*Nexus) CreateMavenHostedRepository ¶
func (n *Nexus) CreateMavenHostedRepository(req MavenHostedRepositoryCreateRequest) error
func (*Nexus) CreateMavenProxyRepository ¶
func (n *Nexus) CreateMavenProxyRepository(req MavenProxyRepositoryCreateRequest) error
func (*Nexus) CreateNpmGroupRepository ¶
func (n *Nexus) CreateNpmGroupRepository(req NpmGroupRepositoryCreateRequest) error
func (*Nexus) CreateNpmHostedRepository ¶
func (n *Nexus) CreateNpmHostedRepository(req NpmHostedRepositoryCreateRequest) error
func (*Nexus) CreateNpmProxyRepository ¶
func (n *Nexus) CreateNpmProxyRepository(req NpmProxyRepositoryCreateRequest) error
TODO 3.22 not provide maven group repository create rest api
func (*Nexus) CreateRepository ¶
func (n *Nexus) CreateRepository(req RepositoryCreator) error
func (*Nexus) CreateRepositoryContentSelectorPrivilege ¶
func (n *Nexus) CreateRepositoryContentSelectorPrivilege(req RepositoryContentSelectorPrivilegeCreateRequest) error
func (*Nexus) CreateRole ¶
func (n *Nexus) CreateRole(req RoleCreateRequest) error
func (*Nexus) CreateUser ¶
func (n *Nexus) CreateUser(req UserCreateRequest) error
CreateUser create a new user in the default source.
func (*Nexus) DeleteBlobStore ¶
func (n *Nexus) DeleteBlobStore(req BlobStoreDeleteRequest) error
func (*Nexus) DeleteContentSelector ¶
func (n *Nexus) DeleteContentSelector(req ContentSelectorDeleteRequest) error
func (*Nexus) DeletePrivilege ¶
func (n *Nexus) DeletePrivilege(req PrivilegeDeleteRequest) error
func (*Nexus) DeleteRepository ¶
func (n *Nexus) DeleteRepository(req RepositoryDeleteRequest) error
func (*Nexus) DeleteRole ¶
func (n *Nexus) DeleteRole(req RoleDeleteRequest) error
func (*Nexus) EnsureAddRealms ¶
func (n *Nexus) EnsureAddRealms(req RealmEnsureAddRequest) error
EnsureAddRealms 保证在原有 realm 基础上增加请求里的 realm
func (*Nexus) EnsureFileBlobStore ¶
func (n *Nexus) EnsureFileBlobStore(req FileBlobStoreCreateRequest) error
EnsureFileBlobStore create or update file blob store.
func (*Nexus) EnsureNpmHostedRepository ¶
func (n *Nexus) EnsureNpmHostedRepository(req NpmHostedRepositoryCreateRequest) error
func (*Nexus) EnsureRepository ¶
func (n *Nexus) EnsureRepository(req RepositoryCreator) error
EnsureRepository make sure repository exist, create or update according to request
func (*Nexus) EnsureRole ¶
func (n *Nexus) EnsureRole(req RoleCreateRequest) error
func (*Nexus) EnsureUser ¶
func (n *Nexus) EnsureUser(req EnsureUserRequest) (UserID, error)
EnsureUser won't update password if ForceUpdatePassword is false.
func (*Nexus) GetFileBlobStore ¶
func (n *Nexus) GetFileBlobStore(req FileBlobStoreGetRequest) (*BlobStore, error)
func (*Nexus) GetPrivilege ¶
func (n *Nexus) GetPrivilege(req PrivilegeGetRequest) (*Privilege, error)
func (*Nexus) GetRepository ¶
func (n *Nexus) GetRepository(req RepositoryGetRequest) (*Repository, error)
func (*Nexus) InvalidateRepositoryCache ¶
func (n *Nexus) InvalidateRepositoryCache(req RepositoryInvalidateCacheRequest) error
func (*Nexus) ListActiveRealms ¶
func (n *Nexus) ListActiveRealms(req RealmListActiveRequest) ([]RealmID, error)
func (*Nexus) ListAvailableRealms ¶
func (n *Nexus) ListAvailableRealms(req RealmListAvailableRequest) ([]Realm, error)
func (*Nexus) ListBlobStore ¶
func (n *Nexus) ListBlobStore(req BlobStoreListRequest) ([]BlobStore, error)
func (*Nexus) ListPrivileges ¶
func (n *Nexus) ListPrivileges(req PrivilegeListRequest) ([]Privilege, error)
func (*Nexus) ListRepositories ¶
func (n *Nexus) ListRepositories(req RepositoryListRequest) ([]Repository, error)
func (*Nexus) ListUsers ¶
func (n *Nexus) ListUsers(req UserListRequest) ([]User, error)
ListUsers Retrieve a list of users. Note if the source is not 'default' the response is limited to 100 users. curl -X GET "http://localhost:8081/service/rest/beta/security/users?userId=a&source=default" -H "accept: application/json"
func (*Nexus) RebuildRepositoryIndex ¶
func (n *Nexus) RebuildRepositoryIndex(req RepositoryRebuildIndexRequest) error
func (*Nexus) SetActiveRealms ¶
func (n *Nexus) SetActiveRealms(req RealmSetActivesRequest) error
func (*Nexus) UpdateContentSelector ¶
func (n *Nexus) UpdateContentSelector(req ContentSelectorUpdateRequest) error
func (*Nexus) UpdateDockerHostedRepository ¶
func (n *Nexus) UpdateDockerHostedRepository(req DockerHostedRepositoryUpdateRequest) error
func (*Nexus) UpdateDockerProxyRepository ¶
func (n *Nexus) UpdateDockerProxyRepository(req DockerProxyRepositoryUpdateRequest) error
func (*Nexus) UpdateFileBlobStore ¶
func (n *Nexus) UpdateFileBlobStore(req FileBlobStoreUpdateRequest) error
func (*Nexus) UpdateMavenHostedRepository ¶
func (n *Nexus) UpdateMavenHostedRepository(req MavenHostedRepositoryUpdateRequest) error
func (*Nexus) UpdateMavenProxyRepository ¶
func (n *Nexus) UpdateMavenProxyRepository(req MavenProxyRepositoryUpdateRequest) error
func (*Nexus) UpdateNpmGroupRepository ¶
func (n *Nexus) UpdateNpmGroupRepository(req NpmGroupRepositoryUpdateRequest) error
func (*Nexus) UpdateNpmHostedRepository ¶
func (n *Nexus) UpdateNpmHostedRepository(req NpmHostedRepositoryUpdateRequest) error
func (*Nexus) UpdateNpmProxyRepository ¶
func (n *Nexus) UpdateNpmProxyRepository(req NpmProxyRepositoryUpdateRequest) error
func (*Nexus) UpdateRepository ¶
func (n *Nexus) UpdateRepository(req RepositoryCreator) error
func (*Nexus) UpdateRepositoryContentSelectorPrivilege ¶
func (n *Nexus) UpdateRepositoryContentSelectorPrivilege(req RepositoryContentSelectorPrivilegeUpdateRequest) error
func (*Nexus) UpdateRole ¶
func (n *Nexus) UpdateRole(req RoleUpdateRequest) error
func (*Nexus) UpdateUser ¶
func (n *Nexus) UpdateUser(req UserUpdateRequest) error
type NpmGroupRepositoryCreateRequest ¶
type NpmGroupRepositoryCreateRequest struct { GroupRepositoryCreateRequest // contains filtered or unexported fields }
group
func (NpmGroupRepositoryCreateRequest) GetFormat ¶
func (n NpmGroupRepositoryCreateRequest) GetFormat() RepositoryFormat
type NpmGroupRepositoryUpdateRequest ¶
type NpmGroupRepositoryUpdateRequest NpmGroupRepositoryCreateRequest
type NpmHostedRepositoryCreateRequest ¶
type NpmHostedRepositoryCreateRequest struct { HostedRepositoryCreateRequest // contains filtered or unexported fields }
hosted
func (NpmHostedRepositoryCreateRequest) GetFormat ¶
func (n NpmHostedRepositoryCreateRequest) GetFormat() RepositoryFormat
type NpmHostedRepositoryUpdateRequest ¶
type NpmHostedRepositoryUpdateRequest NpmHostedRepositoryCreateRequest
type NpmProxyRepositoryCreateRequest ¶
type NpmProxyRepositoryCreateRequest struct { ProxyRepositoryCreateRequest // contains filtered or unexported fields }
proxy
func (NpmProxyRepositoryCreateRequest) GetFormat ¶
func (n NpmProxyRepositoryCreateRequest) GetFormat() RepositoryFormat
type NpmProxyRepositoryUpdateRequest ¶
type NpmProxyRepositoryUpdateRequest NpmProxyRepositoryCreateRequest
type Option ¶
type Option func(*Nexus)
func WithBlobNetdataDir ¶
func WithHttpClient ¶
func WithHttpClient(hc *httpclient.HTTPClient) Option
type PrivilegeAction ¶
type PrivilegeAction string
const ( PrivilegeActionREAD PrivilegeAction = "READ" PrivilegeActionBROWSE PrivilegeAction = "BROWSE" PrivilegeActionEDIT PrivilegeAction = "EDIT" PrivilegeActionADD PrivilegeAction = "ADD" PrivilegeActionDELETE PrivilegeAction = "DELETE" PrivilegeActionRUN PrivilegeAction = "RUN" PrivilegeActionASSOCIATE PrivilegeAction = "ASSOCIATE" PrivilegeActionDISASSOCIATE PrivilegeAction = "DISASSOCIATE" PrivilegeActionALL PrivilegeAction = "ALL" )
type PrivilegeDeleteRequest ¶
type PrivilegeDeleteRequest struct {
PrivilegeID string
}
type PrivilegeGetRequest ¶
type PrivilegeGetRequest struct {
PrivilegeID string
}
type PrivilegeID ¶
type PrivilegeID string
func GetNxRepositoryPrivilege ¶
func GetNxRepositoryPrivilege(privilegeType PrivilegeType, repoFormat RepositoryFormat, repoName string, actions ...PrivilegeAction) []PrivilegeID
func GetNxRepositoryViewPrivileges ¶
func GetNxRepositoryViewPrivileges(repoName string, repoFormat RepositoryFormat, actions ...PrivilegeAction) []PrivilegeID
type PrivilegeListRequest ¶
type PrivilegeListRequest struct { }
type PrivilegeType ¶
type PrivilegeType string
const ( PrivilegeTypeRepositoryView PrivilegeType = "nx-repository-view" PrivilegeTypeRepositoryAdmin PrivilegeType = "nx-repository-admin" )
type ProxyRepositoryCreateRequest ¶
type ProxyRepositoryCreateRequest struct { BaseRepositoryCreateRequest Proxy RepositoryProxyConfig `json:"proxy"` NegativeCache RepositoryNegativeCacheConfig `json:"negativeCache"` HttpClient RepositoryHttpClientConfig `json:"httpClient"` RoutingRule string `json:"routingRule"` }
func (ProxyRepositoryCreateRequest) GetHttpClient ¶
func (r ProxyRepositoryCreateRequest) GetHttpClient() RepositoryHttpClientConfig
func (ProxyRepositoryCreateRequest) GetNegativeCache ¶
func (r ProxyRepositoryCreateRequest) GetNegativeCache() RepositoryNegativeCacheConfig
func (ProxyRepositoryCreateRequest) GetProxy ¶
func (r ProxyRepositoryCreateRequest) GetProxy() RepositoryProxyConfig
func (ProxyRepositoryCreateRequest) GetRoutingRule ¶
func (r ProxyRepositoryCreateRequest) GetRoutingRule() string
func (ProxyRepositoryCreateRequest) GetType ¶
func (r ProxyRepositoryCreateRequest) GetType() RepositoryType
type RealmEnsureAddRequest ¶
type RealmEnsureAddRequest struct {
Realms []RealmID
}
type RealmListActiveRequest ¶
type RealmListActiveRequest struct{}
List the active realm IDs in order
type RealmSetActivesRequest ¶
type RealmSetActivesRequest struct {
ActiveRealms []RealmID
}
Set the active security realms in the order they should be used
type Repository ¶
type Repository struct { Name string `json:"name"` Format RepositoryFormat `json:"format"` URL string `json:"url"` Online bool `json:"online"` Storage HostedRepositoryStorageConfig `json:"storage"` Group *RepositoryGroupConfig `json:"group"` Cleanup *RepositoryCleanupConfig `json:"cleanup"` Proxy *RepositoryProxyConfig `json:"proxy"` NegativeCache *RepositoryNegativeCacheConfig `json:"negativeCache"` HttpClient *RepositoryHttpClientConfig `json:"httpClient"` RoutingRuleName *string `json:"routingRuleName"` Maven *RepositoryMavenConfig `json:"maven"` Type RepositoryType `json:"type"` Extra RepositoryExtra `json:"extra"` }
type RepositoryAuthenticationType ¶
type RepositoryAuthenticationType string
type RepositoryCleanupConfig ¶
type RepositoryCleanupConfig struct { // Components that match any of the applied policies will be deleted // example: weekly-cleanup PolicyNames []string `json:"policyNames"` }
type RepositoryContentSelectorPrivilegeCreateRequest ¶
type RepositoryContentSelectorPrivilegeCreateRequest struct { // The name of the privilege. This value cannot be changed. // pattern: ^[a-zA-Z0-9\-]{1}[a-zA-Z0-9_\-\.]*$ Name string `json:"name"` Description string `json:"description"` // A collection of actions to associate with the privilege, using BREAD syntax (browse,read,edit,add,delete,all) as well as 'run' for script privileges. Actions []PrivilegeAction `json:"actions"` // The repository format (i.e 'nuget', 'npm') this privilege will grant access to (or * for all). Format RepositoryFormat `json:"format"` // The name of the repository this privilege will grant access to (or * for all). Repository string `json:"repository"` // The name of a content selector that will be used to grant access to content via this privilege. ContentSelector string `json:"contentSelector"` }
type RepositoryContentSelectorPrivilegeUpdateRequest ¶
type RepositoryContentSelectorPrivilegeUpdateRequest RepositoryContentSelectorPrivilegeCreateRequest
type RepositoryCreator ¶
type RepositoryCreator interface { GetName() string GetOnline() bool GetStorage() HostedRepositoryStorageConfig GetCleanup() *RepositoryCleanupConfig GetFormat() RepositoryFormat // maven2 / npm / ... GetType() RepositoryType // hosted / proxy / group }
type RepositoryDeleteRequest ¶
type RepositoryDeleteRequest struct{ RepositoryName string }
type RepositoryDockerConfig ¶
type RepositoryDockerConfig struct { // Whether to allow clients to use the V1 API to interact with this repository // example: false V1Enabled bool `json:"v1Enabled"` // Whether to force authentication (Docker Bearer Token Realm required if false) // example: true ForceBasicAuth bool `json:"forceBasicAuth"` // Create an HTTP connector at specified port // +Optional // example: 8082 HttpPort *int `json:"httpPort"` // Create an HTTPS connector at specified port // +Optional // example: 8083 HttpsPort *int `json:"httpsPort"` }
type RepositoryExtra ¶
type RepositoryExtra struct { // ReverseProxyURL docker hosted or group repo will have ReverseProxyURL string `json:"reverseProxyURL,omitempty"` }
type RepositoryFormat ¶
type RepositoryFormat string
func (RepositoryFormat) Standard ¶
func (format RepositoryFormat) Standard() string
Standard 返回 format 标准值 maven -> maven2
type RepositoryGetRequest ¶
type RepositoryGetRequest struct{ RepositoryName string }
type RepositoryGroupConfig ¶
type RepositoryGroupConfig struct { // Member repositories' names // example: maven-public MemberNames []string `json:"memberNames"` }
type RepositoryGroupCreator ¶
type RepositoryGroupCreator interface { RepositoryCreator GetGroup() RepositoryGroupConfig }
type RepositoryHttpClientAuthentication ¶
type RepositoryHttpClientAuthentication struct { // Authentication type Type RepositoryAuthenticationType `json:"type"` Username string `json:"username"` Password string `json:"password"` }
type RepositoryHttpClientConfig ¶
type RepositoryHttpClientConfig struct { // Whether to block outbound connections on the repository Blocked bool `json:"blocked"` // Whether to auto-block outbound connections if remote peer is detected as unreachable/unresponsive AutoBlock bool `json:"autoBlock"` Connection *RepositoryHttpClientConnection `json:"connection"` // TODO not take effect yet Authentication *RepositoryHttpClientAuthentication `json:"authentication"` }
type RepositoryHttpClientConnection ¶
type RepositoryHttpClientConnection struct { // Total retries if the initial connection attempt suffers a timeout // example: 0 // minimum: 0 // maximum: 10 Retries *int64 `json:"retries"` // Custom fragment to append to User-Agent header in HTTP requests UserAgentSuffix *string `json:"userAgentSuffix"` // Seconds to wait for activity before stopping and retrying the connection // example: 60 // minimum: 1 // maximum: 3600 Timeout *int64 `json:"timeout"` // Whether to enable redirects to the same location (may be required by some servers) EnableCircularRedirects bool `json:"enableCircularRedirects"` // Whether to allow cookies to be stored and used EnableCookies bool `json:"enableCookies"` }
type RepositoryInvalidateCacheRequest ¶
type RepositoryInvalidateCacheRequest struct{ RepositoryName string }
type RepositoryListRequest ¶
type RepositoryListRequest struct{}
type RepositoryMavenConfig ¶
type RepositoryMavenConfig struct { // What type of artifacts does this repository store? // example: mixed VersionPolicy RepositoryMavenVersionPolicy `json:"versionPolicy"` // Validate that all paths are maven artifact or metadata paths // example: strict LayoutPolicy RepositoryMavenLayoutPolicy `json:"layoutPolicy"` }
type RepositoryMavenLayoutPolicy ¶
type RepositoryMavenLayoutPolicy string
type RepositoryMavenVersionPolicy ¶
type RepositoryMavenVersionPolicy string
type RepositoryNegativeCacheConfig ¶
type RepositoryNegativeCacheConfig struct { // Whether to cache responses for content not present in the proxied repository // example: false NotFoundCacheEnabled bool `json:"enabled"` // How long to cache the fact that a file was not found in the repository (in minutes) // example: 1440 NotFoundCacheTTL int64 `json:"timeToLive"` }
type RepositoryProxyConfig ¶
type RepositoryProxyConfig struct { // Location of the remote repository being proxied // example: https://registry.npmjs.org RemoteURL string `json:"remoteUrl"` // How long to cache artifacts before rechecking the remote repository (in minutes) // Release repositories should use -1. // example: 1440 ContentMaxAge int64 `json:"contentMaxAge"` // How long to cache metadata before rechecking the remote repository (in minutes) // example: 1440 MetadataMaxAge int64 `json:"metadataMaxAge"` }
type RepositoryProxyCreator ¶
type RepositoryProxyCreator interface { RepositoryCreator GetProxy() RepositoryProxyConfig GetNegativeCache() RepositoryNegativeCacheConfig GetHttpClient() RepositoryHttpClientConfig GetRoutingRule() string }
type RepositoryRebuildIndexRequest ¶
type RepositoryRebuildIndexRequest struct{ RepositoryName string }
type RepositoryStorageWritePolicy ¶
type RepositoryStorageWritePolicy string
type RepositoryType ¶
type RepositoryType string
type RoleCreateRequest ¶
type RoleCreateRequest struct { // Role-ID must be unique ID RoleID `json:"id"` Name string `json:"name"` Description string `json:"description"` // The list of privileges assigned to this role. Privileges []PrivilegeID `json:"privileges"` // The list of roles assigned to this role. Roles []string `json:"roles"` }
type RoleDeleteRequest ¶
type RoleDeleteRequest struct {
ID string
}
type RoleGetRequest ¶
type RoleGetRequest struct { ID RoleID Source UserSource }
type RoleListRequest ¶
type RoleListRequest struct { // +optional Source string }
type RoleUpdateRequest ¶
type RoleUpdateRequest RoleCreateRequest
type User ¶
type User struct { UserID UserID `json:"userId"` FirstName string `json:"firstName"` LastName string `json:"lastName"` EmailAddress string `json:"emailAddress"` Source UserSource `json:"source"` Status string `json:"status"` ReadOnly bool `json:"readOnly"` Roles []RoleID `json:"roles"` ExternalRoles []ExternalRoleID `json:"externalRoles"` }
{ "userId": "anonymous", "firstName": "Anonymous", "lastName": "User", "emailAddress": "anonymous@example.org", "source": "default", "status": "active", "readOnly": false, "roles": [ "nx-anonymous" ], "externalRoles": [] },
type UserCreateRequest ¶
type UserCreateRequest struct { // The userid which is required for login. This value cannot be changed. // User-ID must be unique UserID UserID `json:"userId"` // The first name of the user. FirstName string `json:"firstName"` // The last name of the user. LastName string `json:"lastName"` // The email address associated with the user. EmailAddress string `json:"emailAddress"` // The password for the new user. Password string `json:"password"` // The user's status, e.g. active or disabled. Status UserStatus `json:"status"` // The roles which the user has been assigned within Nexus. // uniqueItems: true Roles []RoleID `json:"roles"` }
type UserEnsureRequest ¶
type UserEnsureRequest struct { UserCreateRequest ForceUpdatePassword bool }
type UserListRequest ¶
type UserStatus ¶
type UserStatus string
var ( UserStatusActive UserStatus = "ACTIVE" UserStatusLocked UserStatus = "LOCKED" UserStatusDisabled UserStatus = "DISABLED" UserStatusChangePassword UserStatus = "CHANGEPASSWORD" )
type UserUpdateRequest ¶
type UserUpdateRequest struct { UserCreateRequest // The user source which is the origin of this user. This value cannot be changed. Source UserSource `json:"source"` // Indicates whether the user's properties could be modified by Nexus. When false only roles are considered during update. ReadOnly bool `json:"readOnly"` // The roles which the user has been assigned in an external source, e.g. LDAP group. These cannot be changed within Nexus. // uniqueItems: true ExternalRoles []ExternalRoleID `json:"externalRoles"` }
UserUpdateRequest won't update password if field `Password` is empty