binding

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 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 Application

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

Application API.

func (*Application) Bucket

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

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) 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) 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) Delete

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

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

func (*Bucket) Get

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

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

func (*Bucket) Put

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

Put writes to the bucket. The destination (path) 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) 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 {
	SoftError
	Path string
}

Conflict reports 409 error.

func (Conflict) Error

func (e Conflict) Error() string

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 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 Identity by ID.

func (*Identity) List

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

List 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 NotFound

type NotFound struct {
	SoftError
	Path string
}

NotFound reports 404 error.

func (NotFound) Error

func (e NotFound) Error() string

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) 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 RichClient

type RichClient struct {
	// Resources APIs.
	Application      Application
	Bucket           Bucket
	BusinessService  BusinessService
	Identity         Identity
	JobFunction      JobFunction
	Proxy            Proxy
	Stakeholder      Stakeholder
	StakeholderGroup StakeholderGroup
	Tag              Tag
	TagCategory      TagCategory
	Task             Task
	Dependency       Dependency
	// contains filtered or unexported fields
}

The RichClient provides API integration.

func New

func New(baseUrl string) (r *RichClient)

newRichClient builds a new RichClient object.

func (*RichClient) Client

func (h *RichClient) Client() *Client

Client provides the REST client.

func (*RichClient) Login

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

type SoftError

type SoftError struct {
	Reason string
}

SoftError A "soft" anticipated error.

func (*SoftError) Error

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

func (*SoftError) Is

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

func (*SoftError) Soft

func (e *SoftError) Soft() *SoftError

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) 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) 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 Task

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

Task 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.

Jump to

Keyboard shortcuts

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