provider

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MapBoxEndpoint is the fqdn used to talk to bitbucket
	MapBoxEndpoint string = "https://api.mapbox.com/"
)

Variables

This section is empty.

Functions

func New

func New(version string) func() provider.Provider

func NewTokenResource

func NewTokenResource() resource.Resource

Types

type Client

type Client struct {
	AccessToken *string
	HTTPClient  *http.Client
}

Client is the base internal Client to talk to bitbuckets API. This should be a username and password the password should be a app-password.

func (*Client) Delete

func (c *Client) Delete(endpoint string) (*http.Response, error)

Delete is just a helper to Do but with a DELETE verb

func (*Client) Do

func (c *Client) Do(method, endpoint string, payload *bytes.Buffer, contentType string) (*http.Response, error)

Do Will just call the bitbucket api but also add auth to it and some extra headers

func (*Client) Get

func (c *Client) Get(endpoint string) (*http.Response, error)

Get is just a helper method to do but with a GET verb

func (*Client) Patch

func (c *Client) Patch(endpoint string, jsonpayload *bytes.Buffer) (*http.Response, error)

Post is just a helper method to do but with a PATCH verb

func (*Client) Post

func (c *Client) Post(endpoint string, jsonpayload *bytes.Buffer) (*http.Response, error)

Post is just a helper method to do but with a POST verb

func (*Client) Put

func (c *Client) Put(endpoint string, jsonpayload *bytes.Buffer) (*http.Response, error)

Put is just a helper method to do but with a PUT verb

func (*Client) PutOnly

func (c *Client) PutOnly(endpoint string) (*http.Response, error)

PutOnly is just a helper method to do but with a PUT verb and a nil body

type Error

type Error struct {
	APIError struct {
		Message string `json:"message,omitempty"`
	} `json:"error,omitempty"`
	Type       string `json:"type,omitempty"`
	StatusCode int
	Endpoint   string
}

Error represents a error from the bitbucket api.

func (Error) Error

func (e Error) Error() string

type MapBoxProvider

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

MapBoxProvider defines the provider implementation.

func (*MapBoxProvider) Configure

func (*MapBoxProvider) DataSources

func (p *MapBoxProvider) DataSources(ctx context.Context) []func() datasource.DataSource

func (*MapBoxProvider) Metadata

func (*MapBoxProvider) Resources

func (p *MapBoxProvider) Resources(ctx context.Context) []func() resource.Resource

func (*MapBoxProvider) Schema

type MapBoxProviderModel

type MapBoxProviderModel struct {
	AccessToken types.String `tfsdk:"access_token"`
}

MapBoxProviderModel describes the provider data model.

type TokenResource

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

TokenResource defines the resource implementation.

func (*TokenResource) Configure

func (*TokenResource) Create

func (*TokenResource) Delete

func (*TokenResource) ImportState

func (*TokenResource) Metadata

func (*TokenResource) Read

func (*TokenResource) Schema

func (*TokenResource) Update

type TokenResourceModel

type TokenResourceModel struct {
	AllowedUrls types.Set    `tfsdk:"allowed_urls"`
	Id          types.String `tfsdk:"id"`
	Note        types.String `tfsdk:"note"`
	Scopes      types.Set    `tfsdk:"scopes"`
	Token       types.String `tfsdk:"token"`
	Username    types.String `tfsdk:"username"`
}

TokenResourceModel describes the resource data model.

Jump to

Keyboard shortcuts

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