Documentation ¶
Index ¶
- Variables
- func ApiAdd(sling *sling.Sling, inputStruct interface{}, resource interface{}, path string) (interface{}, error)
- func ApiAddWithResponseStatus(sling *sling.Sling, inputStruct interface{}, resource interface{}, path string, ...) (interface{}, error)
- func ApiDelete(sling *sling.Sling, path string) error
- func ApiPost(sling *sling.Sling, inputStruct interface{}, resource interface{}, path string) (interface{}, error)
- func ApiPostNew[TResponse any](httpClient *http.Client, absoluteUrl *url.URL, apiKey string, ...) (*TResponse, error)
- func ApiUpdate(sling *sling.Sling, inputStruct interface{}, resource interface{}, path string) (interface{}, error)
- func GetAddPath(s IService, resource resources.IResource) (string, error)
- func GetAllPath(s IService) (string, error)
- func GetByIDPath(s IService, id string) (string, error)
- func GetByIDsPath(s IService, ids []string) (string, error)
- func GetByNamePath(s IService, name string) (string, error)
- func GetByPartialNamePath(s IService, name string) (string, error)
- func GetPagedResponse[T any](s IService, path string) ([]*T, error)
- func GetPath(s IService) (string, error)
- func GetUpdatePath(s IService, resource resources.IResource) (string, error)
- func IsNil(i interface{}) bool
- func LoadNextPage(pagedResults resources.PagedResults) (string, bool)
- func NewServiceTests(t *testing.T, service IService, uriTemplate string, ServiceName string)
- func ValidateInternalState(s IService) error
- type CanDeleteService
- type IService
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrItemNotFound = errors.New("cannot find the item")
ErrItemNotFound is an OctopusDeploy error returned an item cannot be found.
Functions ¶
func ApiAdd ¶
func ApiAdd(sling *sling.Sling, inputStruct interface{}, resource interface{}, path string) (interface{}, error)
Generic OctopusDeploy API Add Function. Expects a 201 response.
func ApiAddWithResponseStatus ¶
func ApiAddWithResponseStatus(sling *sling.Sling, inputStruct interface{}, resource interface{}, path string, httpStatus int) (interface{}, error)
ApiAddWithResponseStatus function with defined response.
func ApiPost ¶
func ApiPost(sling *sling.Sling, inputStruct interface{}, resource interface{}, path string) (interface{}, error)
ApiPost post to octopus and expect a 200 response code.
func ApiPostNew ¶ added in v2.6.0
func ApiPostNew[TResponse any](httpClient *http.Client, absoluteUrl *url.URL, apiKey string, requestPayload any) (*TResponse, error)
ApiPost post some JSON to octopus and expect a 200 response code.
func ApiUpdate ¶
func ApiUpdate(sling *sling.Sling, inputStruct interface{}, resource interface{}, path string) (interface{}, error)
Generic OctopusDeploy API Update Function.
func GetAllPath ¶
func GetPagedResponse ¶ added in v2.3.0
func LoadNextPage ¶
func LoadNextPage(pagedResults resources.PagedResults) (string, bool)
LoadNextPage checks if the next page should be loaded from the API. Returns the new path and a bool if the next page should be checked.
func NewServiceTests ¶
func ValidateInternalState ¶
Types ¶
type CanDeleteService ¶
type CanDeleteService struct {
Service
}
func (*CanDeleteService) DeleteByID ¶
func (s *CanDeleteService) DeleteByID(id string) error
DeleteByID deletes the resource that matches the input ID.
type IService ¶
type IService interface { GetBasePath() string GetClient() *sling.Sling GetName() string GetPath() string GetURITemplate() *uritemplates.UriTemplate }
IService defines the contract for all services that communicate with the Octopus API.
type Service ¶
type Service struct { BasePath string Name string Path string Sling *sling.Sling URITemplate *uritemplates.UriTemplate }
func (*Service) GetBasePath ¶
func (*Service) GetURITemplate ¶
func (s *Service) GetURITemplate() *uritemplates.UriTemplate
Click to show internal directories.
Click to hide internal directories.