info

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 2 Imported by: 1

Documentation

Overview

Package info represents our SiteHost `/api` API endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a Service to work with API Jobs.

func New

func New(c *api.Client) *Client

New is an initialisation function.

func (*Client) Get

func (s *Client) Get(ctx context.Context) (response GetResponse, err error)

Get retrieves information about the current user's account using the "api/get_info.json" API endpoint. It creates a new HTTP GET request with the client's API key and sends it using the HTTP client. The function returns a GetResponse struct containing the API response data and an error if one occurred during the request.

type GetResponse

type GetResponse struct {
	Return struct {
		ClientID    string      `json:"client_id"`
		ContactID   interface{} `json:"contact_id"`
		Modules     []string    `json:"modules"`
		Roles       []string    `json:"roles"`
		Environment struct {
			GitBranch string `json:"git_branch"`
			Type      string `json:"type"`
		} `json:"environment"`
	} `json:"return"`
	Msg    string `json:"msg"`
	Status bool   `json:"status"`
}

GetResponse represents a result of a get API Info call.

Jump to

Keyboard shortcuts

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