binding

package
v0.3.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 23 Imported by: 4

Documentation

Index

Constants

View Source
const (
	RetryLimit = 60
	RetryDelay = time.Second * 10
)

Variables

View Source
var (
	Settings = &settings.Settings
	Log      = logr.WithName("binding")
)

Functions

This section is empty.

Types

type Analysis added in v0.3.0

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

Analysis API.

func (*Analysis) Create added in v0.3.0

func (h *Analysis) Create(r *api.Analysis, encoding string, issues, deps io.Reader) (err error)

Create an analysis report.

type AppFacts added in v0.3.0

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

AppFacts sub-resource API. Provides association management of facts.

func (*AppFacts) Delete added in v0.3.0

func (h *AppFacts) Delete(name string) (err error)

Delete a fact.

func (*AppFacts) Get added in v0.3.0

func (h *AppFacts) Get(name string, value interface{}) (err error)

Get a fact.

func (*AppFacts) List added in v0.3.0

func (h *AppFacts) List() (facts api.FactMap, err error)

List facts.

func (*AppFacts) Replace added in v0.3.0

func (h *AppFacts) Replace(facts api.FactMap) (err error)

Replace facts.

func (*AppFacts) Set added in v0.3.0

func (h *AppFacts) Set(name string, value interface{}) (err error)

Set a fact (created as needed).

func (*AppFacts) Source added in v0.3.0

func (h *AppFacts) Source(source string)

Source sets the source for other operations on the facts.

type AppTags added in v0.3.0

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

AppTags sub-resource API. Provides association management of tags to applications by name.

func (*AppTags) Add added in v0.3.0

func (h *AppTags) Add(id uint) (err error)

Add associates a tag with the application.

func (*AppTags) Delete added in v0.3.0

func (h *AppTags) Delete(id uint) (err error)

Delete ensures the tag is not associated with the application.

func (*AppTags) Ensure added in v0.3.0

func (h *AppTags) Ensure(id uint) (err error)

Ensure ensures tag is associated with the application.

func (*AppTags) List added in v0.3.0

func (h *AppTags) List() (list []api.TagRef, err error)

List associated tags. Returns a list of tag names.

func (*AppTags) Replace added in v0.3.0

func (h *AppTags) Replace(ids []uint) (err error)

Replace the associated tags for the source with a new set. Returns an error if the source is not set.

func (*AppTags) Source added in v0.3.0

func (h *AppTags) Source(name string)

Source sets the source for other operations on the associated tags.

type Application

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

Application API.

func (*Application) Analysis added in v0.3.0

func (h *Application) Analysis(id uint) (a Analysis)

Analysis returns the analysis API.

func (*Application) Bucket

func (h *Application) Bucket(id uint) (b *BucketContent)

Bucket returns the bucket API.

func (*Application) Create

func (h *Application) Create(r *api.Application) (err error)

Create an Application.

func (*Application) Delete

func (h *Application) Delete(id uint) (err error)

Delete an Application.

func (*Application) Facts added in v0.3.0

func (h *Application) Facts(id uint) (f AppFacts)

Facts returns the tags API.

func (*Application) FindIdentity added in v0.3.0

func (h *Application) FindIdentity(id uint, kind string) (r *api.Identity, found bool, err error)

FindIdentity by kind.

func (*Application) Get

func (h *Application) Get(id uint) (r *api.Application, err error)

Get an Application by ID.

func (*Application) List

func (h *Application) List() (list []api.Application, err error)

List Applications.

func (*Application) Tags added in v0.3.0

func (h *Application) Tags(id uint) (tg AppTags)

Tags returns the tags API.

func (*Application) Update

func (h *Application) Update(r *api.Application) (err error)

Update an Application.

type Bucket

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

Bucket API.

func (*Bucket) Content added in v0.3.0

func (h *Bucket) Content(id uint) (b *BucketContent)

Content returns content API.

func (*Bucket) Create added in v0.3.0

func (h *Bucket) Create(r *api.Bucket) (err error)

Create a Bucket.

func (*Bucket) Delete

func (h *Bucket) Delete(id uint) (err error)

Delete a bucket.

func (*Bucket) Get

func (h *Bucket) Get(id uint) (r *api.Bucket, err error)

Get a bucket.

func (*Bucket) List added in v0.3.0

func (h *Bucket) List() (list []api.Bucket, err error)

List buckets.

type BucketContent added in v0.3.0

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

BucketContent API.

func (*BucketContent) Delete added in v0.3.0

func (h *BucketContent) Delete(path string) (err error)

Delete deletes content at the specified root. The source is relative to the bucket root.

func (*BucketContent) Get added in v0.3.0

func (h *BucketContent) Get(source, destination string) (err error)

Get reads from the bucket. The source (root) is relative to the bucket root.

func (*BucketContent) Put added in v0.3.0

func (h *BucketContent) Put(source, destination string) (err error)

Put writes to the bucket. The destination (root) is relative to the bucket root.

type BusinessService

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

BusinessService API.

func (*BusinessService) Create

func (h *BusinessService) Create(r *api.BusinessService) (err error)

Create a BusinessService.

func (*BusinessService) Delete

func (h *BusinessService) Delete(id uint) (err error)

Delete a BusinessService.

func (*BusinessService) Get

func (h *BusinessService) Get(id uint) (r *api.BusinessService, err error)

Get a BusinessService by ID.

func (*BusinessService) List

func (h *BusinessService) List() (list []api.BusinessService, err error)

List BusinessServices.

func (*BusinessService) Update

func (h *BusinessService) Update(r *api.BusinessService) (err error)

Update a BusinessService.

type Client

type Client struct {

	// Retry limit.
	Retry int
	// Error
	Error error
	// contains filtered or unexported fields
}

Client provides a REST client.

func NewClient

func NewClient(url, token string) (client *Client)

NewClient Constructs a new client

func (*Client) BucketGet

func (r *Client) BucketGet(source, destination string) (err error)

BucketGet downloads a file/directory. The source (path) is relative to the bucket root.

func (*Client) BucketPut

func (r *Client) BucketPut(source, destination string) (err error)

BucketPut uploads a file/directory. The destination (path) is relative to the bucket root.

func (*Client) Delete

func (r *Client) Delete(path string, params ...Param) (err error)

Delete a resource.

func (*Client) FileGet

func (r *Client) FileGet(path, destination string) (err error)

FileGet downloads a file.

func (*Client) FilePost added in v0.3.0

func (r *Client) FilePost(path, source string, object interface{}) (err error)

FilePost uploads a file. Returns the created File resource.

func (*Client) FilePut

func (r *Client) FilePut(path, source string, object interface{}) (err error)

FilePut uploads a file. Returns the created File resource.

func (*Client) FileSend

func (r *Client) FileSend(path, method string, fields []Field, object interface{}) (err error)

FileSend sends file upload from.

func (*Client) Get

func (r *Client) Get(path string, object interface{}, params ...Param) (err error)

Get a resource.

func (*Client) IsDir

func (r *Client) IsDir(path string, must bool) (b bool, err error)

IsDir determines if the path is a directory. The `must` specifies if the path must exist.

func (*Client) Post

func (r *Client) Post(path string, object interface{}) (err error)

Post a resource.

func (*Client) Put

func (r *Client) Put(path string, object interface{}, params ...Param) (err error)

Put a resource.

func (*Client) Reset

func (r *Client) Reset()

Reset the client.

func (*Client) SetToken

func (r *Client) SetToken(token string)

SetToken sets hub token on client

type Conflict

type Conflict struct {
	RestError
}

Conflict reports 409 error.

func (*Conflict) Is

func (e *Conflict) Is(err error) (matched bool)

type Dependency

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

Dependency API.

func (*Dependency) Create

func (h *Dependency) Create(r *api.Dependency) (err error)

Create a Dependency.

func (*Dependency) Delete

func (h *Dependency) Delete(id uint) (err error)

Delete a Dependency.

func (*Dependency) Get

func (h *Dependency) Get(id uint) (r *api.Dependency, err error)

Get a Dependency by ID.

func (*Dependency) List

func (h *Dependency) List() (list []api.Dependency, err error)

List Dependencies.

type Field

type Field struct {
	Name     string
	Path     string
	Reader   io.Reader
	Encoding string
}

Field file upload form field.

func (*Field) Write

func (f *Field) Write(writer io.Writer) (err error)

Write the field content. When Reader is not set, the path is opened and copied.

type File added in v0.3.0

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

File API.

func (*File) Delete added in v0.3.0

func (h *File) Delete(id uint) (err error)

Delete a file.

func (*File) Get added in v0.3.0

func (h *File) Get(id uint, destination string) (err error)

Get downloads a file.

func (*File) Put added in v0.3.0

func (h *File) Put(source string) (r *api.File, err error)

Put uploads a file.

type Filter added in v0.3.0

type Filter struct {
	qf.Filter
}

Filter

func (*Filter) Param added in v0.3.0

func (r *Filter) Param() (p Param)

Param returns a filter parameter.

type Identity

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

Identity API.

func (*Identity) Create

func (h *Identity) Create(r *api.Identity) (err error)

Create a Identity.

func (*Identity) Delete

func (h *Identity) Delete(id uint) (err error)

Delete a Identity.

func (*Identity) Get

func (h *Identity) Get(id uint) (r *api.Identity, err error)

Get a decrypted Identity by ID.

func (*Identity) List

func (h *Identity) List() (list []api.Identity, err error)

List decrypted Identities.

func (*Identity) Update

func (h *Identity) Update(r *api.Identity) (err error)

Update a Identity.

type JobFunction

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

JobFunction API.

func (*JobFunction) Create

func (h *JobFunction) Create(r *api.JobFunction) (err error)

Create a JobFunction.

func (*JobFunction) Delete

func (h *JobFunction) Delete(id uint) (err error)

Delete a JobFunction.

func (*JobFunction) Get

func (h *JobFunction) Get(id uint) (r *api.JobFunction, err error)

Get a JobFunction by ID.

func (*JobFunction) List

func (h *JobFunction) List() (list []api.JobFunction, err error)

List JobFunctions.

func (*JobFunction) Update

func (h *JobFunction) Update(r *api.JobFunction) (err error)

Update a JobFunction.

type MigrationWave added in v0.3.0

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

MigrationWave API.

func (*MigrationWave) Create added in v0.3.0

func (h *MigrationWave) Create(r *api.MigrationWave) (err error)

Create a MigrationWave.

func (*MigrationWave) Delete added in v0.3.0

func (h *MigrationWave) Delete(id uint) (err error)

Delete a MigrationWave.

func (*MigrationWave) Get added in v0.3.0

func (h *MigrationWave) Get(id uint) (r *api.MigrationWave, err error)

Get a MigrationWave by ID.

func (*MigrationWave) List added in v0.3.0

func (h *MigrationWave) List() (list []api.MigrationWave, err error)

List MigrationWaves.

func (*MigrationWave) Update added in v0.3.0

func (h *MigrationWave) Update(r *api.MigrationWave) (err error)

Update a MigrationWave.

type NotFound

type NotFound struct {
	RestError
}

NotFound reports 404 error.

func (*NotFound) Is

func (e *NotFound) Is(err error) (matched bool)

type Param

type Param struct {
	Key   string
	Value string
}

Param.

type Params

type Params map[string]interface{}

Params mapping.

type Path

type Path string

Path API path.

func (Path) Inject

func (s Path) Inject(p Params) (out string)

Inject named parameters.

type Proxy

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

Proxy API.

func (*Proxy) Create

func (h *Proxy) Create(r *api.Proxy) (err error)

Create a Proxy.

func (*Proxy) Delete

func (h *Proxy) Delete(id uint) (err error)

Delete a Proxy.

func (*Proxy) Find added in v0.3.0

func (h *Proxy) Find(kind string) (r *api.Proxy, err error)

Find by Kind. Returns nil when not found.

func (*Proxy) Get

func (h *Proxy) Get(id uint) (r *api.Proxy, err error)

Get a Proxy by ID.

func (*Proxy) List

func (h *Proxy) List() (list []api.Proxy, err error)

List Proxies.

func (*Proxy) Update

func (h *Proxy) Update(r *api.Proxy) (err error)

Update a Proxy.

type Questionnaire added in v0.3.0

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

Questionnaire API.

func (*Questionnaire) Create added in v0.3.0

func (h *Questionnaire) Create(r *api.Questionnaire) (err error)

Create a Questionnaire.

func (*Questionnaire) Delete added in v0.3.0

func (h *Questionnaire) Delete(id uint) (err error)

Delete a Questionnaire.

func (*Questionnaire) Get added in v0.3.0

func (h *Questionnaire) Get(id uint) (r *api.Questionnaire, err error)

Get a Questionnaire by ID.

func (*Questionnaire) List added in v0.3.0

func (h *Questionnaire) List() (list []api.Questionnaire, err error)

List Questionnaires.

func (*Questionnaire) Update added in v0.3.0

func (h *Questionnaire) Update(r *api.Questionnaire) (err error)

Update a Questionnaire.

type RestError added in v0.3.0

type RestError struct {
	Reason string
	Method string
	Path   string
	Status int
	Body   string
}

RestError reports REST errors.

func (*RestError) Error added in v0.3.0

func (e *RestError) Error() (s string)

func (*RestError) Is added in v0.3.0

func (e *RestError) Is(err error) (matched bool)

func (*RestError) With added in v0.3.0

func (e *RestError) With(r *http.Response)

type Review added in v0.3.0

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

Review API.

func (*Review) Copy added in v0.3.0

func (h *Review) Copy(reviewID uint, appID uint) (err error)

Copy a Review.

func (*Review) Create added in v0.3.0

func (h *Review) Create(r *api.Review) (err error)

Create a Review.

func (*Review) Delete added in v0.3.0

func (h *Review) Delete(id uint) (err error)

Delete a Review.

func (*Review) Get added in v0.3.0

func (h *Review) Get(id uint) (r *api.Review, err error)

Get a Review by ID.

func (*Review) List added in v0.3.0

func (h *Review) List() (list []api.Review, err error)

List Reviews.

func (*Review) Update added in v0.3.0

func (h *Review) Update(r *api.Review) (err error)

Update a Review.

type RichClient

type RichClient struct {
	// Resources APIs.
	Application      Application
	Bucket           Bucket
	BusinessService  BusinessService
	Dependency       Dependency
	File             File
	Identity         Identity
	JobFunction      JobFunction
	MigrationWave    MigrationWave
	Proxy            Proxy
	Questionnaire    Questionnaire
	Review           Review
	RuleSet          RuleSet
	Setting          Setting
	Stakeholder      Stakeholder
	StakeholderGroup StakeholderGroup
	Tag              Tag
	TagCategory      TagCategory
	Target           Target
	Task             Task
	Ticket           Ticket
	Tracker          Tracker

	// A REST client.
	Client *Client
}

The RichClient provides API integration.

func New

func New(baseUrl string) (r *RichClient)

New builds a new RichClient object.

func (*RichClient) Login

func (r *RichClient) Login(user, password string) (err error)

Login set token.

type RuleSet added in v0.3.0

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

RuleSet API.

func (*RuleSet) Create added in v0.3.0

func (h *RuleSet) Create(r *api.RuleSet) (err error)

Create a RuleSet.

func (*RuleSet) Delete added in v0.3.0

func (h *RuleSet) Delete(id uint) (err error)

Delete a RuleSet.

func (*RuleSet) Find added in v0.3.0

func (h *RuleSet) Find(filter Filter) (list []api.RuleSet, err error)

Find RuleSets with filter.

func (*RuleSet) Get added in v0.3.0

func (h *RuleSet) Get(id uint) (r *api.RuleSet, err error)

Get a RuleSet by ID.

func (*RuleSet) List added in v0.3.0

func (h *RuleSet) List() (list []api.RuleSet, err error)

List RuleSets.

func (*RuleSet) Update added in v0.3.0

func (h *RuleSet) Update(r *api.RuleSet) (err error)

Update a RuleSet.

type Setting added in v0.3.0

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

Setting API.

func (*Setting) Bool added in v0.3.0

func (h *Setting) Bool(key string) (b bool, err error)

Bool setting value.

func (*Setting) Get added in v0.3.0

func (h *Setting) Get(key string, v interface{}) (err error)

Get a setting by key.

func (*Setting) Int added in v0.3.0

func (h *Setting) Int(key string) (n int, err error)

Int setting value.

func (*Setting) Str added in v0.3.0

func (h *Setting) Str(key string) (s string, err error)

Str setting value.

type Stakeholder

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

Stakeholder API.

func (*Stakeholder) Create

func (h *Stakeholder) Create(r *api.Stakeholder) (err error)

Create a Stakeholder.

func (*Stakeholder) Delete

func (h *Stakeholder) Delete(id uint) (err error)

Delete a Stakeholder.

func (*Stakeholder) Get

func (h *Stakeholder) Get(id uint) (r *api.Stakeholder, err error)

Get a Stakeholder by ID.

func (*Stakeholder) List

func (h *Stakeholder) List() (list []api.Stakeholder, err error)

List Stakeholders.

func (*Stakeholder) Update

func (h *Stakeholder) Update(r *api.Stakeholder) (err error)

Update a Stakeholder.

type StakeholderGroup

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

StakeholderGroup API.

func (*StakeholderGroup) Create

func (h *StakeholderGroup) Create(r *api.StakeholderGroup) (err error)

Create a StakeholderGroup.

func (*StakeholderGroup) Delete

func (h *StakeholderGroup) Delete(id uint) (err error)

Delete a StakeholderGroup.

func (*StakeholderGroup) Get

func (h *StakeholderGroup) Get(id uint) (r *api.StakeholderGroup, err error)

Get a StakeholderGroup by ID.

func (*StakeholderGroup) List

func (h *StakeholderGroup) List() (list []api.StakeholderGroup, err error)

List StakeholderGroups.

func (*StakeholderGroup) Update

func (h *StakeholderGroup) Update(r *api.StakeholderGroup) (err error)

Update a StakeholderGroup.

type Tag

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

Tag API.

func (*Tag) Create

func (h *Tag) Create(r *api.Tag) (err error)

Create a Tag.

func (*Tag) Delete

func (h *Tag) Delete(id uint) (err error)

Delete a Tag.

func (*Tag) Ensure added in v0.3.0

func (h *Tag) Ensure(wanted *api.Tag) (err error)

Ensure a tag exists.

func (*Tag) Find added in v0.3.0

func (h *Tag) Find(name string, category uint) (r *api.Tag, found bool, err error)

Find by name and type.

func (*Tag) Get

func (h *Tag) Get(id uint) (r *api.Tag, err error)

Get a Tag by ID.

func (*Tag) List

func (h *Tag) List() (list []api.Tag, err error)

List Tags.

func (*Tag) Update

func (h *Tag) Update(r *api.Tag) (err error)

Update a Tag.

type TagCategory

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

TagCategory API.

func (*TagCategory) Create

func (h *TagCategory) Create(r *api.TagCategory) (err error)

Create a TagCategory.

func (*TagCategory) Delete

func (h *TagCategory) Delete(id uint) (err error)

Delete a TagCategory.

func (*TagCategory) Ensure added in v0.3.0

func (h *TagCategory) Ensure(wanted *api.TagCategory) (err error)

Ensure a tag-type exists.

func (*TagCategory) Find added in v0.3.0

func (h *TagCategory) Find(name string) (r *api.TagCategory, found bool, err error)

Find by name.

func (*TagCategory) Get

func (h *TagCategory) Get(id uint) (r *api.TagCategory, err error)

Get a TagCategory by ID.

func (*TagCategory) List

func (h *TagCategory) List() (list []api.TagCategory, err error)

List TagCategories.

func (*TagCategory) Update

func (h *TagCategory) Update(r *api.TagCategory) (err error)

Update a TagCategory.

type Target added in v0.3.0

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

Target API.

func (*Target) Create added in v0.3.0

func (h *Target) Create(r *api.Target) (err error)

Create a Target.

func (*Target) Delete added in v0.3.0

func (h *Target) Delete(id uint) (err error)

Delete a Target.

func (*Target) Get added in v0.3.0

func (h *Target) Get(id uint) (r *api.Target, err error)

Get a Target by ID.

func (*Target) List added in v0.3.0

func (h *Target) List() (list []api.Target, err error)

List Targets.

func (*Target) Update added in v0.3.0

func (h *Target) Update(r *api.Target) (err error)

Update a Target.

type Task

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

Task API.

func (*Task) Bucket added in v0.3.0

func (h *Task) Bucket(id uint) (b *BucketContent)

Bucket returns the bucket API.

func (*Task) Create

func (h *Task) Create(r *api.Task) (err error)

Create a Task.

func (*Task) Delete

func (h *Task) Delete(id uint) (err error)

Delete a Task.

func (*Task) Get

func (h *Task) Get(id uint) (r *api.Task, err error)

Get a Task by ID.

func (*Task) List

func (h *Task) List() (list []api.Task, err error)

List Tasks.

func (*Task) Update

func (h *Task) Update(r *api.Task) (err error)

Update a Task.

type Ticket added in v0.3.0

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

Ticket API.

func (*Ticket) Create added in v0.3.0

func (h *Ticket) Create(r *api.Ticket) (err error)

Create a Ticket.

func (*Ticket) Delete added in v0.3.0

func (h *Ticket) Delete(id uint) (err error)

Delete a Ticket.

func (*Ticket) Get added in v0.3.0

func (h *Ticket) Get(id uint) (r *api.Ticket, err error)

Get a Ticket by ID.

func (*Ticket) List added in v0.3.0

func (h *Ticket) List() (list []api.Ticket, err error)

List Tickets..

type Tracker added in v0.3.0

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

Tracker API.

func (*Tracker) Create added in v0.3.0

func (h *Tracker) Create(r *api.Tracker) (err error)

Create a Tracker.

func (*Tracker) Delete added in v0.3.0

func (h *Tracker) Delete(id uint) (err error)

Delete a Tracker.

func (*Tracker) Get added in v0.3.0

func (h *Tracker) Get(id uint) (r *api.Tracker, err error)

Get a Tracker by ID.

func (*Tracker) GetProjects added in v0.3.0

func (h *Tracker) GetProjects(id1 uint, id2 uint) (project api.Project, err error)

Get Projects.

func (*Tracker) List added in v0.3.0

func (h *Tracker) List() (list []api.Tracker, err error)

List Trackers.

func (*Tracker) ListProjectIssueTypes added in v0.3.0

func (h *Tracker) ListProjectIssueTypes(id1 uint, id2 uint) (issueType []api.IssueType, err error)

List Project Issue Types.

func (*Tracker) ListProjects added in v0.3.0

func (h *Tracker) ListProjects(id uint) (projectList []api.Project, err error)

List Projects.

func (*Tracker) Update added in v0.3.0

func (h *Tracker) Update(r *api.Tracker) (err error)

Update a Tracker.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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