Documentation
¶
Index ¶
- Constants
- Variables
- func NewInsecureGrpcConn(ctx context.Context) (*grpc.ClientConn, error)
- func NewSecureGrpcConnection(ctx context.Context) (*grpc.ClientConn, error)
- type Client
- func (c *Client) CreateResource(p plan.Definition) (plan.Definition, error)
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) ParseResponseBody(resp *http.Response) ([]byte, error)
- func (c *Client) Request(method string, url string, data io.Reader) (*http.Request, error)
- func (c *Client) Status() ([]byte, error)
- type Error
Constants ¶
View Source
const (
ResourcesCreateEndpoint = "create"
)
Variables ¶
View Source
var ( // ErrRequestFailed is returned in the instance a // http request does not return a 200 ErrRequestFailed = errors.New("failed request not successful") // ErrNotFound is returned in the instance a // http request returns a 404 ErrNotFound = errors.New("resource not found") )
Functions ¶
func NewInsecureGrpcConn ¶
func NewInsecureGrpcConn(ctx context.Context) (*grpc.ClientConn, error)
func NewSecureGrpcConnection ¶
func NewSecureGrpcConnection(ctx context.Context) (*grpc.ClientConn, error)
Types ¶
type Client ¶
Client implements a api client
func NewClient ¶
func NewClient() *Client
NewClient returns a new client for access the ai-platform API client
func NewClientWithToken ¶
NewClientWithToken returns a new client for access the ai-platform API client and reads the JWT token from settings
func (*Client) CreateResource ¶
func (c *Client) CreateResource(p plan.Definition) (plan.Definition, error)
func (*Client) ParseResponseBody ¶
ParseResponseBody takes an http response and turns the body to a *[]byte pointer
func (*Client) Request ¶
Request builds a request to execute, this will also add the JWT token if one is set up in the client.
Strong Argument: that this should return and error an never make a request IF there is no token set? I'm open
Source Files
¶
Click to show internal directories.
Click to hide internal directories.