credentials

package
v2.17.5 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 9 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 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 NewResource

func NewResource(name string, credential GitCredential) *Resource

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

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

Add creates a new resource.

func (*Service) Get

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.

func (*Service) GetByID

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.

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

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

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

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