credentials

package
v2.42.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

View Source
const (
	GitCredentialTypeAnonymous        = Type("Anonymous")
	GitCredentialTypeReference        = Type("Reference")
	GitCredentialTypeUsernamePassword = Type("UsernamePassword")
)

Variables

This section is empty.

Functions

func DeleteByID added in v2.33.0

func DeleteByID(client newclient.Client, spaceID string, ID string) error

DeleteByID deletes a Git credential based on the provided ID.

func Get added in v2.33.0

func Get(client newclient.Client, spaceID string, query Query) (*resources.Resources[*Resource], error)

Get returns a collection of environments 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 IsNil

func IsNil(i interface{}) bool

Types

type Anonymous

type Anonymous struct {
	// contains filtered or unexported fields
}

func NewAnonymous

func NewAnonymous() *Anonymous

func (*Anonymous) Type added in v2.12.0

func (a *Anonymous) Type() Type

Type returns the type for this Git credential.

type GitCredential added in v2.12.0

type GitCredential interface {
	Type() Type
}

GitCredential defines the interface for Git credentials.

type Query

type Query struct {
	Name string `uri:"name,omitempty" url:"name,omitempty"`
	Skip int    `uri:"skip,omitempty" url:"skip,omitempty"`
	Take int    `uri:"take,omitempty" url:"take,omitempty"`
}

type Reference

type Reference struct {
	ID string `json:"Id"`
	// contains filtered or unexported fields
}

Reference defines a reference Git credential.

func NewReference

func NewReference(id string) *Reference

NewReference creates and initializes a reference Git credential.

func (*Reference) Type added in v2.12.0

func (u *Reference) Type() Type

Type returns the type for this Git credential.

type Resource

type Resource struct {
	Description string        `json:"Description,omitempty"`
	Details     GitCredential `json:"Details"`
	Name        string        `json:"Name"`
	SpaceID     string        `json:"SpaceId,omitempty"`

	resources.Resource
}

func Add added in v2.33.0

func Add(client newclient.Client, resource *Resource) (*Resource, error)

Add creates a new resource.

func GetByID added in v2.33.0

func GetByID(client newclient.Client, spaceID string, ID string) (*Resource, error)

GetByID returns the Git credential that matches the input ID. If one cannot be found, it returns nil and an error.

func NewResource

func NewResource(name string, credential GitCredential) *Resource

func Update added in v2.33.0

func Update(client newclient.Client, gitCredential *Resource) (*Resource, error)

Update modifies a Git credential based on the one provided as input.

func (*Resource) GetName

func (r *Resource) GetName() string

GetName returns the name of the resource.

func (*Resource) SetName

func (r *Resource) SetName(name string)

SetName sets the name of the resource.

func (*Resource) UnmarshalJSON

func (r *Resource) UnmarshalJSON(b []byte) error

UnmarshalJSON sets the resource to its representation in JSON.

type Service

type Service struct {
	services.CanDeleteService
}

func NewService

func NewService(sling *sling.Sling, uriTemplate string) *Service

NewService returns a service with a preconfigured client.

func (*Service) Add deprecated

func (s *Service) Add(resource *Resource) (*Resource, error)

Add creates a new resource.

Deprecated: use credentials.Add

func (*Service) Get deprecated

func (s *Service) Get(query Query) (*resources.Resources[*Resource], error)

Get returns a collection of environments based on the criteria defined by its input query parameter. If an error occurs, an empty collection is returned along with the associated error.

Deprecated: use credentials.Get

func (*Service) GetByID deprecated

func (s *Service) GetByID(id string) (*Resource, error)

GetByID returns the Git credential that matches the input ID. If one cannot be found, it returns nil and an error.

Deprecated: use credentials.GetByID

func (*Service) GetByIDOrName

func (s *Service) GetByIDOrName(idOrName string) (*Resource, error)

func (*Service) GetByName

func (s *Service) GetByName(name string) (*Resource, error)

func (*Service) GetByPartialName

func (s *Service) GetByPartialName(partialName string) ([]*Resource, error)

func (*Service) Update deprecated

func (s *Service) Update(gitCredential *Resource) (*Resource, error)

Update modifies a Git credential based on the one provided as input.

Deprecated: use credentials.Update

type Type

type Type string

type UsernamePassword

type UsernamePassword struct {
	Password *core.SensitiveValue `json:"Password"`
	Username string               `json:"Username"`
	// contains filtered or unexported fields
}

UsernamePassword defines a username-password Git credential.

func NewUsernamePassword

func NewUsernamePassword(username string, password *core.SensitiveValue) *UsernamePassword

NewUsernamePassword creates and initializes an username-password Git credential.

func (*UsernamePassword) Type added in v2.12.0

func (u *UsernamePassword) Type() Type

Type returns the type for this Git credential.

Jump to

Keyboard shortcuts

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