Documentation ¶
Index ¶
- Constants
- Variables
- func ValidateToken(authorization string) (string, error)
- type Client
- type ClientArgs
- type ClientCategoryChannels
- func (c ClientCategoryChannels) Create(ctx context.Context, channelType types.ChannelType, state map[string]any, ...) (*types.Channel, error)
- func (c ClientCategoryChannels) Delete(ctx context.Context, id string, opts ...ClientOption) error
- func (c ClientCategoryChannels) Get(ctx context.Context, id string, opts ...ClientOption) (*types.Channel, error)
- func (c ClientCategoryChannels) GetAll() *Paginator[*types.Channel]
- func (c ClientCategoryChannels) GetStats(ctx context.Context, id string, opts ...ClientOption) (*types.Stats, error)
- func (c ClientCategoryChannels) PatchState(ctx context.Context, id string, state map[string]any, opts ...ClientOption) error
- func (c ClientCategoryChannels) PublishMessage(ctx context.Context, channelId, eventName string, data any, ...) error
- func (c ClientCategoryChannels) SetState(ctx context.Context, id string, state map[string]any, opts ...ClientOption) error
- func (c ClientCategoryChannels) SubscribeToken(ctx context.Context, channelId, token string, opts ...ClientOption) error
- func (c ClientCategoryChannels) SubscribeTokens(ctx context.Context, channelId string, tokens []string, opts ...ClientOption) error
- type ClientCategoryChannelsTokens
- func (t ClientCategoryChannelsTokens) Create(ctx context.Context, state map[string]any, opts ...ClientOption) (*types.ChannelToken, error)
- func (t ClientCategoryChannelsTokens) Delete(ctx context.Context, id string, opts ...ClientOption) error
- func (t ClientCategoryChannelsTokens) Get(ctx context.Context, id string, opts ...ClientOption) (*types.ChannelToken, error)
- func (t ClientCategoryChannelsTokens) GetAll(ctx context.Context, opts ...ClientOption) ([]*types.ChannelToken, error)
- func (t ClientCategoryChannelsTokens) IsOnline(ctx context.Context, id string, opts ...ClientOption) (bool, error)
- func (t ClientCategoryChannelsTokens) PublishDirectMessage(ctx context.Context, id, eventName string, data any, opts ...ClientOption) error
- func (t ClientCategoryChannelsTokens) SetState(ctx context.Context, id string, state map[string]any, opts ...ClientOption) error
- type ClientCategoryIgnite
- type ClientCategoryIgniteContainers
- func (c ClientCategoryIgniteContainers) Create(ctx context.Context, deploymentId string, opts ...ClientOption) (*types.Container, error)
- func (c ClientCategoryIgniteContainers) Delete(ctx context.Context, id string, opts ...ClientOption) error
- func (c ClientCategoryIgniteContainers) DeleteAndRecreate(ctx context.Context, id string, opts ...ClientOption) error
- func (c ClientCategoryIgniteContainers) GetLogs(id string, limit int, ascOrder bool) *Paginator[*types.ContainerLog]
- func (c ClientCategoryIgniteContainers) Start(ctx context.Context, id string, opts ...ClientOption) error
- func (c ClientCategoryIgniteContainers) Stop(ctx context.Context, id string, opts ...ClientOption) error
- type ClientCategoryIgniteDeployments
- func (c ClientCategoryIgniteDeployments) Create(ctx context.Context, deployment *types.DeploymentConfig, opts ...ClientOption) (*types.Deployment, error)
- func (c ClientCategoryIgniteDeployments) CreateGateway(ctx context.Context, opts types.GatewayCreationOptions, ...) (*types.Gateway, error)
- func (c ClientCategoryIgniteDeployments) Delete(ctx context.Context, id string, opts ...ClientOption) error
- func (c ClientCategoryIgniteDeployments) DeleteHealthCheck(ctx context.Context, deploymentId, healthCheckId string, opts ...ClientOption) error
- func (c ClientCategoryIgniteDeployments) Get(ctx context.Context, id string, opts ...ClientOption) (*types.Deployment, error)
- func (c ClientCategoryIgniteDeployments) GetAll(ctx context.Context, opts ...ClientOption) ([]*types.Deployment, error)
- func (c ClientCategoryIgniteDeployments) GetAllGateways(ctx context.Context, id string, opts ...ClientOption) ([]*types.Gateway, error)
- func (c ClientCategoryIgniteDeployments) GetByName(ctx context.Context, name string, opts ...ClientOption) (*types.Deployment, error)
- func (c ClientCategoryIgniteDeployments) GetContainers(ctx context.Context, id string, opts ...ClientOption) ([]*types.Container, error)
- func (c ClientCategoryIgniteDeployments) GetHealthChecks(ctx context.Context, deploymentId string, opts ...ClientOption) ([]*types.HealthCheck, error)
- func (c ClientCategoryIgniteDeployments) GetStorageStats(ctx context.Context, deploymentId string, opts ...ClientOption) (types.DeploymentStorageInfo, error)
- func (c ClientCategoryIgniteDeployments) HealthCheckStates(ctx context.Context, deploymentId string, opts ...ClientOption) ([]*types.HealthCheckState, error)
- func (c ClientCategoryIgniteDeployments) NewHealthCheck(ctx context.Context, createOpts types.HealthCheckCreateOpts, ...) (*types.HealthCheck, error)
- func (c ClientCategoryIgniteDeployments) Patch(ctx context.Context, id string, patchOpts types.IgniteDeploymentPatchOpts, ...) (*types.Deployment, error)deprecated
- func (c ClientCategoryIgniteDeployments) Scale(ctx context.Context, deploymentId string, containerCount uint, ...) ([]*types.Container, error)
- func (c ClientCategoryIgniteDeployments) Update(ctx context.Context, id string, updateOpts types.IgniteDeploymentUpdateOpts, ...) (*types.Deployment, error)
- func (c ClientCategoryIgniteDeployments) UpdateHealthCheck(ctx context.Context, updateOpts types.HealthCheckUpdateOpts, ...) (*types.HealthCheck, error)
- func (c ClientCategoryIgniteDeployments) VolumeVirtualFS(ctx context.Context, deploymentId, volumeId string, opts ...ClientOption) fs.FS
- type ClientCategoryIgniteGateways
- func (c ClientCategoryIgniteGateways) AddDomain(ctx context.Context, gatewayId string, domain string, opts ...ClientOption) error
- func (c ClientCategoryIgniteGateways) Delete(ctx context.Context, id string, opts ...ClientOption) error
- func (c ClientCategoryIgniteGateways) DeleteDomain(ctx context.Context, domainId string, opts ...ClientOption) error
- func (c ClientCategoryIgniteGateways) Get(ctx context.Context, id string, opts ...ClientOption) (*types.Gateway, error)
- func (c ClientCategoryIgniteGateways) GetDomain(ctx context.Context, domainId string, opts ...ClientOption) (*types.Domain, error)
- func (c ClientCategoryIgniteGateways) Update(ctx context.Context, id string, updateOpts types.IgniteGatewayUpdateOpts, ...) (*types.Gateway, error)
- type ClientCategoryPipe
- type ClientCategoryPipeRooms
- func (c ClientCategoryPipeRooms) Create(ctx context.Context, opts types.RoomCreationOptions, ...) (*types.Room, error)
- func (c ClientCategoryPipeRooms) Delete(ctx context.Context, id string, opts ...ClientOption) error
- func (c ClientCategoryPipeRooms) GetAll(ctx context.Context, opts ...ClientOption) ([]*types.Room, error)
- type ClientCategoryProjects
- type ClientCategoryProjectsSecrets
- func (c ClientCategoryProjectsSecrets) Create(ctx context.Context, key, value string, opts ...ClientOption) (*types.ProjectSecret, error)
- func (c ClientCategoryProjectsSecrets) Delete(ctx context.Context, id string, opts ...ClientOption) error
- func (c ClientCategoryProjectsSecrets) GetAll(ctx context.Context, opts ...ClientOption) ([]*types.ProjectSecret, error)
- type ClientCategoryProjectsTokens
- func (c ClientCategoryProjectsTokens) Create(ctx context.Context, permissions []types.ProjectPermission, ...) (*types.ProjectToken, error)
- func (c ClientCategoryProjectsTokens) Delete(ctx context.Context, id string, opts ...ClientOption) error
- func (c ClientCategoryProjectsTokens) GetAll(ctx context.Context, opts ...ClientOption) ([]*types.ProjectToken, error)
- type ClientCategoryRegistry
- type ClientCategoryRegistryImages
- func (c ClientCategoryRegistryImages) Delete(ctx context.Context, image string, opts ...ClientOption) error
- func (c ClientCategoryRegistryImages) GetAll(ctx context.Context, opts ...ClientOption) ([]*types.Image, error)
- func (c ClientCategoryRegistryImages) GetManifest(ctx context.Context, image string, opts ...ClientOption) ([]*types.ImageManifest, error)
- type ClientCategoryUsers
- type ClientCategoryUsersMe
- func (c ClientCategoryUsersMe) CreatePat(ctx context.Context, name string, opts ...ClientOption) (*types.UserPat, error)
- func (c ClientCategoryUsersMe) DeletePat(ctx context.Context, id string, opts ...ClientOption) error
- func (c ClientCategoryUsersMe) Get(ctx context.Context, opts ...ClientOption) (*types.UserMeInfo, error)
- func (c ClientCategoryUsersMe) GetAllPats(ctx context.Context, opts ...ClientOption) ([]*types.UserPat, error)
- type ClientOption
- type CustomHandler
- type Paginator
- type PlainText
- type ProcessedClientOpts
Constants ¶
const DefaultAPIBase = "https://api.hop.io/v1"
DefaultAPIBase is used to define the default base API URL.
const Version = "1.12.1"
Version is used to define a tagged version. This will be updated when a new version is released.
Variables ¶
var IDPrefixes = []string{
"user", "project", "pm", "role", "pi", "ptk", "pat", "container", "pipe_room", "deployment", "bearer",
"ptkid", "secret", "gateway", "domain", "leap_token", "build", "rollout", "health_check", "session",
}
IDPrefixes are allowed ID prefixes.
Functions ¶
func ValidateToken ¶
ValidateToken is used to validate a authentication token. Returns an error if the token is invalid.
Types ¶
type Client ¶
type Client struct { Pipe *ClientCategoryPipe Projects *ClientCategoryProjects Ignite *ClientCategoryIgnite Users *ClientCategoryUsers Registry *ClientCategoryRegistry Channels *ClientCategoryChannels // contains filtered or unexported fields }
Client is used to define the Hop client. Please use the NewClient function to create this!
func NewClient ¶
func NewClient(authorization string, opts ...ClientOption) (*Client, error)
NewClient is used to make a new Hop client.
func (*Client) AddClientOptions ¶
func (c *Client) AddClientOptions(opts ...ClientOption)
AddClientOptions is used to add any client options. These will be added before any others specified in functions.
func (*Client) SetAPIBase
deprecated
SetAPIBase is used to set the base API URL. This is probably something you do not need to use, however it is useful in testing the SDK. The base URL contains the domain and ends with /v1.
Deprecated: Use AddClientOptions with WithCustomAPIURL instead.
type ClientArgs ¶ added in v1.10.0
type ClientArgs struct { // Method is used to define the request method. Method string // Path is used to define the path (with the URL suffix including /api/vX removed). Path string // ResultKey is the key inside the "data" part of the JSON where the data is. ResultKey string // Query is any HTTP query parameters that should be sent. Query map[string]string // Body is the body to send. This should be json marshalled except for the PlainText type. Body any // Result is a pointer to where the result should be unmarshalled. Note that if this is nil, the // result body should be ignored. // *SPECIAL CASE:* If PassRequest is not nil, ignore this field and pass it to that. Result any // Ignore404 is whether a 404 should not be treated as an error. Ignore404 bool // PassRequest is a function used to pass a OK request to instead of closing it. // This is used for the filesystem since we need to pass around a context that constantly pulls more // information in some cases. PassRequest func(r *http.Response) }
ClientArgs is used to define the arguments from the function to the client.
type ClientCategoryChannels ¶
type ClientCategoryChannels struct { Tokens *ClientCategoryChannelsTokens // contains filtered or unexported fields }
ClientCategoryChannels is an auto-generated struct which is used to allow for simple categorisation of the APIs. It is public since it may be desired to store a reference to this somewhere, however, do NOT create a instance of this directly. Instead, call NewClient and then go to the field Channels.
func (ClientCategoryChannels) Create ¶
func (c ClientCategoryChannels) Create( ctx context.Context, channelType types.ChannelType, state map[string]any, id string, opts ...ClientOption, ) (*types.Channel, error)
Create is used to create a channel. The channelType argument should be the type of channel that you want to create, state should be a map that you want to associate with the channel, and id should be the ID you wish to specify (oe a blank string if you wish for this to be auto-generated).
func (ClientCategoryChannels) Delete ¶
func (c ClientCategoryChannels) Delete(ctx context.Context, id string, opts ...ClientOption) error
Delete is used to delete a channel.
func (ClientCategoryChannels) Get ¶
func (c ClientCategoryChannels) Get(ctx context.Context, id string, opts ...ClientOption) (*types.Channel, error)
Get is used to get a channel. Will throw types.NotFound if it was not found.
func (ClientCategoryChannels) GetAll ¶
func (c ClientCategoryChannels) GetAll() *Paginator[*types.Channel]
GetAll returns a paginator to get all the channels.
func (ClientCategoryChannels) GetStats ¶
func (c ClientCategoryChannels) GetStats(ctx context.Context, id string, opts ...ClientOption) (*types.Stats, error)
GetStats is used to get the stats of a channel.
func (ClientCategoryChannels) PatchState ¶
func (c ClientCategoryChannels) PatchState(ctx context.Context, id string, state map[string]any, opts ...ClientOption) error
PatchState is used to patch the state of a channel.
func (ClientCategoryChannels) PublishMessage ¶
func (c ClientCategoryChannels) PublishMessage(ctx context.Context, channelId, eventName string, data any, opts ...ClientOption) error
PublishMessage is used to publish an event to the channel.
func (ClientCategoryChannels) SetState ¶
func (c ClientCategoryChannels) SetState(ctx context.Context, id string, state map[string]any, opts ...ClientOption) error
SetState is used to set the state of a channel.
func (ClientCategoryChannels) SubscribeToken ¶
func (c ClientCategoryChannels) SubscribeToken(ctx context.Context, channelId, token string, opts ...ClientOption) error
SubscribeToken is used to subscribe a token to a channel.
func (ClientCategoryChannels) SubscribeTokens ¶
func (c ClientCategoryChannels) SubscribeTokens(ctx context.Context, channelId string, tokens []string, opts ...ClientOption) error
SubscribeTokens is used to subscribe many tokens to a channel.
type ClientCategoryChannelsTokens ¶
type ClientCategoryChannelsTokens struct {
// contains filtered or unexported fields
}
ClientCategoryChannelsTokens is an auto-generated struct which is used to allow for simple categorisation of the APIs. It is public since it may be desired to store a reference to this somewhere, however, do NOT create a instance of this directly. Instead, call NewClient and then go to the field Channels.Tokens.
func (ClientCategoryChannelsTokens) Create ¶
func (t ClientCategoryChannelsTokens) Create(ctx context.Context, state map[string]any, opts ...ClientOption) (*types.ChannelToken, error)
Create is used to create a new channel token. State is the map of the state of the token (this can be nil), and projectId is the project ID to associate the token with (this can be empty unless it is bearer or PAT auth).
func (ClientCategoryChannelsTokens) Delete ¶
func (t ClientCategoryChannelsTokens) Delete(ctx context.Context, id string, opts ...ClientOption) error
Delete is used to delete a channel token.
func (ClientCategoryChannelsTokens) Get ¶
func (t ClientCategoryChannelsTokens) Get(ctx context.Context, id string, opts ...ClientOption) (*types.ChannelToken, error)
Get is used to get a token by its ID.
func (ClientCategoryChannelsTokens) GetAll ¶
func (t ClientCategoryChannelsTokens) GetAll(ctx context.Context, opts ...ClientOption) ([]*types.ChannelToken, error)
GetAll gets all the tokens.
func (ClientCategoryChannelsTokens) IsOnline ¶
func (t ClientCategoryChannelsTokens) IsOnline(ctx context.Context, id string, opts ...ClientOption) (bool, error)
IsOnline is used to check if a token is online.
func (ClientCategoryChannelsTokens) PublishDirectMessage ¶
func (t ClientCategoryChannelsTokens) PublishDirectMessage( ctx context.Context, id, eventName string, data any, opts ...ClientOption, ) error
PublishDirectMessage is used to publish an event to the channel token.
func (ClientCategoryChannelsTokens) SetState ¶
func (t ClientCategoryChannelsTokens) SetState(ctx context.Context, id string, state map[string]any, opts ...ClientOption) error
SetState is used to set the state of a channel token.
type ClientCategoryIgnite ¶
type ClientCategoryIgnite struct { Gateways *ClientCategoryIgniteGateways Deployments *ClientCategoryIgniteDeployments Containers *ClientCategoryIgniteContainers // contains filtered or unexported fields }
ClientCategoryIgnite is an auto-generated struct which is used to allow for simple categorisation of the APIs. It is public since it may be desired to store a reference to this somewhere, however, do NOT create a instance of this directly. Instead, call NewClient and then go to the field Ignite.
type ClientCategoryIgniteContainers ¶
type ClientCategoryIgniteContainers struct {
// contains filtered or unexported fields
}
ClientCategoryIgniteContainers is an auto-generated struct which is used to allow for simple categorisation of the APIs. It is public since it may be desired to store a reference to this somewhere, however, do NOT create a instance of this directly. Instead, call NewClient and then go to the field Ignite.Containers.
func (ClientCategoryIgniteContainers) Create ¶
func (c ClientCategoryIgniteContainers) Create(ctx context.Context, deploymentId string, opts ...ClientOption) (*types.Container, error)
Create is used to create a container.
func (ClientCategoryIgniteContainers) Delete ¶
func (c ClientCategoryIgniteContainers) Delete(ctx context.Context, id string, opts ...ClientOption) error
Delete is used to delete a container by its ID.
func (ClientCategoryIgniteContainers) DeleteAndRecreate ¶ added in v1.11.0
func (c ClientCategoryIgniteContainers) DeleteAndRecreate(ctx context.Context, id string, opts ...ClientOption) error
DeleteAndRecreate is used to delete a container by its ID and then recreate it. This is another function to avoid a breaking change.
func (ClientCategoryIgniteContainers) GetLogs ¶
func (c ClientCategoryIgniteContainers) GetLogs(id string, limit int, ascOrder bool) *Paginator[*types.ContainerLog]
GetLogs is used to get a paginator for the logs of a container.
func (ClientCategoryIgniteContainers) Start ¶
func (c ClientCategoryIgniteContainers) Start(ctx context.Context, id string, opts ...ClientOption) error
Start is used to start a container by its ID.
func (ClientCategoryIgniteContainers) Stop ¶
func (c ClientCategoryIgniteContainers) Stop(ctx context.Context, id string, opts ...ClientOption) error
Stop is used to stop a container by its ID.
type ClientCategoryIgniteDeployments ¶
type ClientCategoryIgniteDeployments struct {
// contains filtered or unexported fields
}
ClientCategoryIgniteDeployments is an auto-generated struct which is used to allow for simple categorisation of the APIs. It is public since it may be desired to store a reference to this somewhere, however, do NOT create a instance of this directly. Instead, call NewClient and then go to the field Ignite.Deployments.
func (ClientCategoryIgniteDeployments) Create ¶
func (c ClientCategoryIgniteDeployments) Create( ctx context.Context, deployment *types.DeploymentConfig, opts ...ClientOption, ) (*types.Deployment, error)
Create is used to create a deployment.
func (ClientCategoryIgniteDeployments) CreateGateway ¶
func (c ClientCategoryIgniteDeployments) CreateGateway( ctx context.Context, opts types.GatewayCreationOptions, clientOpts ...ClientOption, ) (*types.Gateway, error)
CreateGateway is used to create a gateway attached to a deployment.
func (ClientCategoryIgniteDeployments) Delete ¶
func (c ClientCategoryIgniteDeployments) Delete(ctx context.Context, id string, opts ...ClientOption) error
Delete is used to delete a deployment by its ID.
func (ClientCategoryIgniteDeployments) DeleteHealthCheck ¶ added in v1.8.0
func (c ClientCategoryIgniteDeployments) DeleteHealthCheck( ctx context.Context, deploymentId, healthCheckId string, opts ...ClientOption, ) error
DeleteHealthCheck is used to delete a health check by its ID.
func (ClientCategoryIgniteDeployments) Get ¶
func (c ClientCategoryIgniteDeployments) Get(ctx context.Context, id string, opts ...ClientOption) (*types.Deployment, error)
Get is used to get a deployment by its ID.
func (ClientCategoryIgniteDeployments) GetAll ¶
func (c ClientCategoryIgniteDeployments) GetAll(ctx context.Context, opts ...ClientOption) ([]*types.Deployment, error)
GetAll is used to get all deployments.
func (ClientCategoryIgniteDeployments) GetAllGateways ¶
func (c ClientCategoryIgniteDeployments) GetAllGateways(ctx context.Context, id string, opts ...ClientOption) ([]*types.Gateway, error)
GetAllGateways is used to get all gateways attached to a deployment.
func (ClientCategoryIgniteDeployments) GetByName ¶
func (c ClientCategoryIgniteDeployments) GetByName(ctx context.Context, name string, opts ...ClientOption) (*types.Deployment, error)
GetByName is used to get a deployment by its name.
func (ClientCategoryIgniteDeployments) GetContainers ¶
func (c ClientCategoryIgniteDeployments) GetContainers(ctx context.Context, id string, opts ...ClientOption) ([]*types.Container, error)
GetContainers is used to get the containers of a deployment.
func (ClientCategoryIgniteDeployments) GetHealthChecks ¶ added in v1.8.0
func (c ClientCategoryIgniteDeployments) GetHealthChecks( ctx context.Context, deploymentId string, opts ...ClientOption, ) ([]*types.HealthCheck, error)
GetHealthChecks is used to get the health checks attached to a deployment ID.
func (ClientCategoryIgniteDeployments) GetStorageStats ¶ added in v1.8.0
func (c ClientCategoryIgniteDeployments) GetStorageStats( ctx context.Context, deploymentId string, opts ...ClientOption, ) (types.DeploymentStorageInfo, error)
GetStorageStats is used to get stats about storage.
func (ClientCategoryIgniteDeployments) HealthCheckStates ¶ added in v1.8.0
func (c ClientCategoryIgniteDeployments) HealthCheckStates( ctx context.Context, deploymentId string, opts ...ClientOption, ) ([]*types.HealthCheckState, error)
HealthCheckStates is used to get the state of health checks for a deployment.
func (ClientCategoryIgniteDeployments) NewHealthCheck ¶ added in v1.8.0
func (c ClientCategoryIgniteDeployments) NewHealthCheck( ctx context.Context, createOpts types.HealthCheckCreateOpts, opts ...ClientOption, ) (*types.HealthCheck, error)
NewHealthCheck is used to set a health check on a deployment. Returns the health check ID.
func (ClientCategoryIgniteDeployments) Patch
deprecated
func (c ClientCategoryIgniteDeployments) Patch( ctx context.Context, id string, patchOpts types.IgniteDeploymentPatchOpts, opts ...ClientOption, ) (*types.Deployment, error)
Patch is used to patch a deployment by its ID.
Deprecated: use Update instead.
func (ClientCategoryIgniteDeployments) Scale ¶ added in v1.4.0
func (c ClientCategoryIgniteDeployments) Scale( ctx context.Context, deploymentId string, containerCount uint, opts ...ClientOption, ) ([]*types.Container, error)
Scale is used to scale the container count of a deployment.
func (ClientCategoryIgniteDeployments) Update ¶ added in v1.4.0
func (c ClientCategoryIgniteDeployments) Update( ctx context.Context, id string, updateOpts types.IgniteDeploymentUpdateOpts, opts ...ClientOption, ) (*types.Deployment, error)
Update is used to update a deployment by its ID.
func (ClientCategoryIgniteDeployments) UpdateHealthCheck ¶ added in v1.8.0
func (c ClientCategoryIgniteDeployments) UpdateHealthCheck( ctx context.Context, updateOpts types.HealthCheckUpdateOpts, opts ...ClientOption, ) (*types.HealthCheck, error)
UpdateHealthCheck is used to update a health check.
func (ClientCategoryIgniteDeployments) VolumeVirtualFS ¶ added in v1.12.1
func (c ClientCategoryIgniteDeployments) VolumeVirtualFS( ctx context.Context, deploymentId, volumeId string, opts ...ClientOption, ) fs.FS
VolumeVirtualFS is used to make a fs.FS compatible virtual filesystem. Note that the context should live as long as the filesystem in this instance.
type ClientCategoryIgniteGateways ¶
type ClientCategoryIgniteGateways struct {
// contains filtered or unexported fields
}
ClientCategoryIgniteGateways is an auto-generated struct which is used to allow for simple categorisation of the APIs. It is public since it may be desired to store a reference to this somewhere, however, do NOT create a instance of this directly. Instead, call NewClient and then go to the field Ignite.Gateways.
func (ClientCategoryIgniteGateways) AddDomain ¶
func (c ClientCategoryIgniteGateways) AddDomain(ctx context.Context, gatewayId string, domain string, opts ...ClientOption) error
AddDomain is used to add a domain to the gateway. The parameter gatewayId is the ID of the gateway to add the domain to, and domain is the full name of the domain.
func (ClientCategoryIgniteGateways) Delete ¶ added in v1.6.0
func (c ClientCategoryIgniteGateways) Delete(ctx context.Context, id string, opts ...ClientOption) error
Delete is used to delete a gateway by its ID.
func (ClientCategoryIgniteGateways) DeleteDomain ¶ added in v1.9.0
func (c ClientCategoryIgniteGateways) DeleteDomain(ctx context.Context, domainId string, opts ...ClientOption) error
DeleteDomain is used to delete a domain by its ID.
func (ClientCategoryIgniteGateways) Get ¶
func (c ClientCategoryIgniteGateways) Get(ctx context.Context, id string, opts ...ClientOption) (*types.Gateway, error)
Get is used to get a gateway by its ID.
func (ClientCategoryIgniteGateways) GetDomain ¶ added in v1.9.0
func (c ClientCategoryIgniteGateways) GetDomain( ctx context.Context, domainId string, opts ...ClientOption, ) (*types.Domain, error)
GetDomain is used to get a domain by its ID.
func (ClientCategoryIgniteGateways) Update ¶ added in v1.7.0
func (c ClientCategoryIgniteGateways) Update( ctx context.Context, id string, updateOpts types.IgniteGatewayUpdateOpts, opts ...ClientOption, ) (*types.Gateway, error)
Update is used to update a gateway by its ID.
type ClientCategoryPipe ¶
type ClientCategoryPipe struct { Rooms *ClientCategoryPipeRooms // contains filtered or unexported fields }
ClientCategoryPipe is an auto-generated struct which is used to allow for simple categorisation of the APIs. It is public since it may be desired to store a reference to this somewhere, however, do NOT create a instance of this directly. Instead, call NewClient and then go to the field Pipe.
type ClientCategoryPipeRooms ¶
type ClientCategoryPipeRooms struct {
// contains filtered or unexported fields
}
ClientCategoryPipeRooms is an auto-generated struct which is used to allow for simple categorisation of the APIs. It is public since it may be desired to store a reference to this somewhere, however, do NOT create a instance of this directly. Instead, call NewClient and then go to the field Pipe.Rooms.
func (ClientCategoryPipeRooms) Create ¶
func (c ClientCategoryPipeRooms) Create( ctx context.Context, opts types.RoomCreationOptions, clientOpts ...ClientOption, ) (*types.Room, error)
Create is used to create a room.
func (ClientCategoryPipeRooms) Delete ¶
func (c ClientCategoryPipeRooms) Delete(ctx context.Context, id string, opts ...ClientOption) error
Delete is used to delete a room.
func (ClientCategoryPipeRooms) GetAll ¶
func (c ClientCategoryPipeRooms) GetAll(ctx context.Context, opts ...ClientOption) ([]*types.Room, error)
GetAll is used to get all rooms associated with a pipe.
type ClientCategoryProjects ¶
type ClientCategoryProjects struct { Tokens *ClientCategoryProjectsTokens Secrets *ClientCategoryProjectsSecrets // contains filtered or unexported fields }
ClientCategoryProjects is an auto-generated struct which is used to allow for simple categorisation of the APIs. It is public since it may be desired to store a reference to this somewhere, however, do NOT create a instance of this directly. Instead, call NewClient and then go to the field Projects.
func (ClientCategoryProjects) GetAllMembers ¶
func (c ClientCategoryProjects) GetAllMembers(ctx context.Context, opts ...ClientOption) ([]*types.ProjectMember, error)
GetAllMembers is used to get all members associated with a project. The project ID MUST be specified in client options (either at a client or function level).
func (ClientCategoryProjects) GetCurrentMember ¶
func (c ClientCategoryProjects) GetCurrentMember(ctx context.Context, opts ...ClientOption) (*types.ProjectMember, error)
GetCurrentMember is used to get the current member associated with a project. You cannot use this method with a project token. The project ID MUST be specified in client options (either at a client or function level).
type ClientCategoryProjectsSecrets ¶
type ClientCategoryProjectsSecrets struct {
// contains filtered or unexported fields
}
ClientCategoryProjectsSecrets is an auto-generated struct which is used to allow for simple categorisation of the APIs. It is public since it may be desired to store a reference to this somewhere, however, do NOT create a instance of this directly. Instead, call NewClient and then go to the field Projects.Secrets.
func (ClientCategoryProjectsSecrets) Create ¶
func (c ClientCategoryProjectsSecrets) Create(ctx context.Context, key, value string, opts ...ClientOption) (*types.ProjectSecret, error)
Create is used to create a project secret. The project ID MUST be specified in client options (either at a client or function level).
func (ClientCategoryProjectsSecrets) Delete ¶
func (c ClientCategoryProjectsSecrets) Delete(ctx context.Context, id string, opts ...ClientOption) error
Delete is used to delete a project secret.
func (ClientCategoryProjectsSecrets) GetAll ¶
func (c ClientCategoryProjectsSecrets) GetAll(ctx context.Context, opts ...ClientOption) ([]*types.ProjectSecret, error)
GetAll is used to get all project secrets. The project ID MUST be specified in client options (either at a client or function level).
type ClientCategoryProjectsTokens ¶
type ClientCategoryProjectsTokens struct {
// contains filtered or unexported fields
}
ClientCategoryProjectsTokens is an auto-generated struct which is used to allow for simple categorisation of the APIs. It is public since it may be desired to store a reference to this somewhere, however, do NOT create a instance of this directly. Instead, call NewClient and then go to the field Projects.Tokens.
func (ClientCategoryProjectsTokens) Create ¶
func (c ClientCategoryProjectsTokens) Create( ctx context.Context, permissions []types.ProjectPermission, opts ...ClientOption, ) (*types.ProjectToken, error)
Create is used to create a token. The project ID MUST be specified in client options (either at a client or function level).
func (ClientCategoryProjectsTokens) Delete ¶
func (c ClientCategoryProjectsTokens) Delete(ctx context.Context, id string, opts ...ClientOption) error
Delete is used to delete a token. The project ID MUST be specified in client options (either at a client or function level).
func (ClientCategoryProjectsTokens) GetAll ¶
func (c ClientCategoryProjectsTokens) GetAll(ctx context.Context, opts ...ClientOption) ([]*types.ProjectToken, error)
GetAll is used to get all tokens associated with a project. The project ID MUST be specified in client options (either at a client or function level).
type ClientCategoryRegistry ¶
type ClientCategoryRegistry struct { Images *ClientCategoryRegistryImages // contains filtered or unexported fields }
ClientCategoryRegistry is an auto-generated struct which is used to allow for simple categorisation of the APIs. It is public since it may be desired to store a reference to this somewhere, however, do NOT create a instance of this directly. Instead, call NewClient and then go to the field Registry.
type ClientCategoryRegistryImages ¶
type ClientCategoryRegistryImages struct {
// contains filtered or unexported fields
}
ClientCategoryRegistryImages is an auto-generated struct which is used to allow for simple categorisation of the APIs. It is public since it may be desired to store a reference to this somewhere, however, do NOT create a instance of this directly. Instead, call NewClient and then go to the field Registry.Images.
func (ClientCategoryRegistryImages) Delete ¶
func (c ClientCategoryRegistryImages) Delete(ctx context.Context, image string, opts ...ClientOption) error
Delete is used to delete an image.
func (ClientCategoryRegistryImages) GetAll ¶
func (c ClientCategoryRegistryImages) GetAll(ctx context.Context, opts ...ClientOption) ([]*types.Image, error)
GetAll is used to get all images in a project.
func (ClientCategoryRegistryImages) GetManifest ¶
func (c ClientCategoryRegistryImages) GetManifest(ctx context.Context, image string, opts ...ClientOption) ([]*types.ImageManifest, error)
GetManifest is used to get the manifest for an image.
type ClientCategoryUsers ¶
type ClientCategoryUsers struct { Me *ClientCategoryUsersMe // contains filtered or unexported fields }
ClientCategoryUsers is an auto-generated struct which is used to allow for simple categorisation of the APIs. It is public since it may be desired to store a reference to this somewhere, however, do NOT create a instance of this directly. Instead, call NewClient and then go to the field Users.
type ClientCategoryUsersMe ¶
type ClientCategoryUsersMe struct {
// contains filtered or unexported fields
}
ClientCategoryUsersMe is an auto-generated struct which is used to allow for simple categorisation of the APIs. It is public since it may be desired to store a reference to this somewhere, however, do NOT create a instance of this directly. Instead, call NewClient and then go to the field Users.Me.
func (ClientCategoryUsersMe) CreatePat ¶
func (c ClientCategoryUsersMe) CreatePat(ctx context.Context, name string, opts ...ClientOption) (*types.UserPat, error)
CreatePat is used to create a personal access token for the current user.
func (ClientCategoryUsersMe) DeletePat ¶
func (c ClientCategoryUsersMe) DeletePat(ctx context.Context, id string, opts ...ClientOption) error
DeletePat is used to delete a personal access token for the current user.
func (ClientCategoryUsersMe) Get ¶
func (c ClientCategoryUsersMe) Get(ctx context.Context, opts ...ClientOption) (*types.UserMeInfo, error)
Get is used to get the current user.
func (ClientCategoryUsersMe) GetAllPats ¶
func (c ClientCategoryUsersMe) GetAllPats(ctx context.Context, opts ...ClientOption) ([]*types.UserPat, error)
GetAllPats is used to get all personal access tokens for the current user.
type ClientOption ¶
type ClientOption interface {
// contains filtered or unexported methods
}
ClientOption is used to define am option that the client will consume when it is ran. You should not and cannot implement this interface. This is only designed as a signature for other options.
func WithCurlDebugWriter ¶ added in v1.9.0
func WithCurlDebugWriter(w io.Writer) ClientOption
WithCurlDebugWriter is used to write what the curl command for the request specified would be and a new line to an io.Writer.
func WithCustomAPIURL ¶ added in v1.4.0
func WithCustomAPIURL(apiBase string) ClientOption
WithCustomAPIURL Is used to return a ClientOption for calling the API with a specific API URL. By default, this is https://api.hop.io/v1.
func WithCustomHandler ¶ added in v1.10.0
func WithCustomHandler(fn CustomHandler) ClientOption
WithCustomHandler is used to define a custom Hop request handler.
func WithProjectID ¶
func WithProjectID(projectId string) ClientOption
WithProjectID Is used to return a ClientOption for calling the API with a specific project ID.
type CustomHandler ¶ added in v1.10.0
type CustomHandler func(ctx context.Context, a ClientArgs, opts ProcessedClientOpts) error
CustomHandler is used to define a custom handler for Hop requests.
type Paginator ¶
type Paginator[T any] struct { // contains filtered or unexported fields }
Paginator is used to create a way to access paginated API routes.
type PlainText ¶ added in v1.10.0
type PlainText []byte
PlainText is a special case for a body that should be sent as text/plain.
type ProcessedClientOpts ¶ added in v1.10.0
type ProcessedClientOpts struct { // ProjectID is the project iD this is relating to. Blank if not set. ProjectID string // CustomAPIURL is the last API URL that was swt. Blank if not set. CustomAPIURL string // CurlDebugWriters are writers that the curl command and new line of a request should be sent to. CurlDebugWriters []io.Writer // CustomHandler is used to define the custom handler for Hop requests. Nil if not set. CustomHandler CustomHandler }
ProcessedClientOpts is the result of all the client options that were passed in.