api

package
v1.3.3-beta Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddScheduleRequest

type AddScheduleRequest struct {
	ProgramID  string `json:"program_id"`
	Type       string `json:"type"`
	Expression string `json:"expression"`
}

AddScheduleRequest request to add schedule/cron to a program

type CreateAPIKeyRequest

type CreateAPIKeyRequest struct {
	ProgramID   string `json:"program_id"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
}

CreateAPIKeyRequest request to create an api key for a program

type CreateAPIKeyResponse

type CreateAPIKeyResponse struct {
	Name        string `json:"name"`
	Description string `json:"description,omitmepty"`
	Prefix      string `json:"prefix"`
	APIKey      string `json:"api_key"`
	Created     string `json:"created"`
}

CreateAPIKeyResponse response to create api key request

type DeleteAPIKeyRequest

type DeleteAPIKeyRequest struct {
	ProgramID string
	Name      string
}

DeleteAPIKeyRequest request to delete an api key

type DeleteScheduleRequest

type DeleteScheduleRequest struct {
	ProgramID string
}

DeleteScheduleRequest request to delete a schedule/cron from a program

type DeployRequest

type DeployRequest struct {
	ProgramID   string            `json:"pid"`
	Changes     map[string]string `json:"change"`
	Deletions   []string          `json:"delete"`
	BinaryFiles map[string]string `json:"binary"`
	Account     string            `json:"-"`
	Region      string            `json:"-"`
}

DeployRequest deploy program request

type DeployResponse

type DeployResponse struct {
	ProgramID string `json:"program_id"`
}

DeployResponse deploy program response

type DetaClient

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

DetaClient client that talks with the deta api

func NewDetaClient

func NewDetaClient() *DetaClient

NewDetaClient new client to talk with the deta api

func (*DetaClient) AddSchedule

func (c *DetaClient) AddSchedule(req *AddScheduleRequest) error

AddSchedule add a schedule/cron to a program

func (*DetaClient) CreateAPIKey

func (c *DetaClient) CreateAPIKey(req *CreateAPIKeyRequest) (*CreateAPIKeyResponse, error)

CreateAPIKey create an api key for your program

func (*DetaClient) DeleteAPIKey

func (c *DetaClient) DeleteAPIKey(req *DeleteAPIKeyRequest) error

DeleteAPIKey delete an api key

func (*DetaClient) DeleteSchedule

func (c *DetaClient) DeleteSchedule(req *DeleteScheduleRequest) error

DeleteSchedule delete a schedule from a program

func (*DetaClient) Deploy

func (c *DetaClient) Deploy(r *DeployRequest) (*DeployResponse, error)

Deploy sends deploy request

func (*DetaClient) DownloadProgram

func (c *DetaClient) DownloadProgram(req *DownloadProgramRequest) (*DownloadProgramResponse, error)

DownloadProgram download all program files

func (*DetaClient) GetLogs

func (c *DetaClient) GetLogs(req *GetLogsRequest) (*GetLogsResponse, error)

func (*DetaClient) GetProgDetails

func (c *DetaClient) GetProgDetails(req *GetProgDetailsRequest) (*GetProgDetailsResponse, error)

GetProgDetails get program details

func (*DetaClient) GetProjects

func (c *DetaClient) GetProjects(req *GetProjectsRequest) (*GetProjectsResponse, error)

GetProjects gets projects

func (*DetaClient) GetSchedule

func (c *DetaClient) GetSchedule(req *GetScheduleRequest) (*GetScheduleResponse, error)

GetSchedule get a schedule for a program

func (*DetaClient) GetUserInfo

func (c *DetaClient) GetUserInfo() (*GetUserInfoResponse, error)

GetUserInfo gets user info

func (*DetaClient) InvokeProgram

func (c *DetaClient) InvokeProgram(req *InvokeProgRequest) (*InvokeProgResponse, error)

InvokeProgram invoke lambda program

func (*DetaClient) ListSpaces

func (c *DetaClient) ListSpaces() (ListSpacesResponse, error)

ListSpaces send list a spaces request

func (*DetaClient) NewProgram

func (c *DetaClient) NewProgram(r *NewProgramRequest) (*NewProgramResponse, error)

NewProgram sends a new program request

func (*DetaClient) UpdateAuth

func (c *DetaClient) UpdateAuth(req *UpdateAuthRequest) error

UpdateAuth update http auth (enable or disable) for a program

func (*DetaClient) UpdateProgDeps

func (c *DetaClient) UpdateProgDeps(req *UpdateProgDepsRequest) (*UpdateProgDepsResponse, error)

UpdateProgDeps update program dependencies

func (*DetaClient) UpdateProgEnvs

func (c *DetaClient) UpdateProgEnvs(req *UpdateProgEnvsRequest) error

UpdateProgEnvs update program environment variables

func (*DetaClient) UpdateProgName

func (c *DetaClient) UpdateProgName(req *UpdateProgNameRequest) error

UpdateProgName update program name

func (*DetaClient) UpdateProgRuntime

func (c *DetaClient) UpdateProgRuntime(req *UpdateProgRuntimeRequest) error

UpdateProgRuntime update program runtime

func (*DetaClient) UpdateVisorMode

func (c *DetaClient) UpdateVisorMode(req *UpdateVisorModeRequest) error

UpdateVisorMode updates the visor mode for a program

type DownloadProgramRequest

type DownloadProgramRequest struct {
	ProgramID string
	Runtime   string
	Account   string
	Region    string
}

DownloadProgramRequest download program request

type DownloadProgramResponse

type DownloadProgramResponse struct {
	ZipFile []byte
}

DownloadProgramResponse download program response

type GetLogsRequest

type GetLogsRequest struct {
	ProgramID string
	Start     int64
	End       int64
	LastToken string
}

GetLogsRequest to a micro

type GetLogsResponse

type GetLogsResponse struct {
	LastToken string    `json:"last_token"`
	Logs      []LogType `json:"logs"`
}

GetLogsResponse from a micro

type GetProgDetailsRequest

type GetProgDetailsRequest struct {
	Program string
	Project string
	Space   int64
}

GetProgDetailsRequest request to get program details

type GetProgDetailsResponse

type GetProgDetailsResponse struct {
	ID         string   `json:"id"`
	Space      int64    `json:"space"`
	Runtime    string   `json:"runtime"`
	Name       string   `json:"name"`
	Path       string   `json:"path"`
	Project    string   `json:"project"`
	Account    string   `json:"account"`
	Region     string   `json:"region"`
	Deps       []string `json:"deps"`
	Envs       []string `json:"envs"`
	Public     bool     `json:"public"`
	Visor      string   `json:"log_level"`
	ScheduleID int64    `json:"schedule_id"`
}

GetProgDetailsResponse response to get program details

type GetProjectsItem

type GetProjectsItem struct {
	ID          string `json:"id,omitempty"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Created     string `json:"created"`
}

GetProjectsItem an item in get projects response

type GetProjectsRequest

type GetProjectsRequest struct {
	SpaceID int64
}

GetProjectsRequest request to get your projects

type GetProjectsResponse

type GetProjectsResponse struct {
	Projects []*GetProjectsItem `json:"projects"`
}

GetProjectsResponse response to get projects request

type GetScheduleRequest

type GetScheduleRequest struct {
	ProgramID string
}

GetScheduleRequest request to get a schedule for a program

type GetScheduleResponse

type GetScheduleResponse struct {
	ScheduleID int64  `json:"id"`
	Type       string `json:"type"`
	Expression string `json:"expression"`
}

GetScheduleResponse response to get schedule request

type GetUserInfoResponse

type GetUserInfoResponse struct {
	DefaultSpace     int64
	DefaultSpaceName string
	DefaultProject   string
}

GetUserInfoResponse response to GetUserInfo request

type InvokeProgRequest

type InvokeProgRequest struct {
	ProgramID string `json:"-"`
	Action    string `json:"action,omitempty"`
	Body      string `json:"body,omitempty"`
}

InvokeProgRequest request to invoke a program

type InvokeProgResponse

type InvokeProgResponse struct {
	Logs    string `json:"logs"`
	Payload string `json:"payload"`
}

InvokeProgResponse response to invoke program request

type ListSpaceItem

type ListSpaceItem struct {
	SpaceID int64  `json:"spaceID"`
	Name    string `json:"name"`
	Role    string `json:"role"`
}

ListSpaceItem an item in ListSpacesResponse

type ListSpacesResponse

type ListSpacesResponse []ListSpaceItem

ListSpacesResponse response to list spaces request

type LogType

type LogType struct {
	Timestamp int64  `json:"timestamp"`
	Log       string `json:"log"`
}

LogType is a single log record from api

type NewProgramRequest

type NewProgramRequest struct {
	Space   int64   `json:"spaceID"`
	Project string  `json:"project"`
	Group   string  `json:"group"`
	Name    string  `json:"name"`
	Runtime string  `json:"runtime"`
	Fork    *string `json:"fork"`
}

NewProgramRequest request to create a new program

type NewProgramResponse

type NewProgramResponse struct {
	ID      string   `json:"id"`
	Space   int64    `json:"space"`
	Runtime string   `json:"runtime"`
	Name    string   `json:"name"`
	Path    string   `json:"path"`
	Project string   `json:"project"`
	Account string   `json:"account"`
	Region  string   `json:"region"`
	Deps    []string `json:"deps"`
	Envs    []string `json:"envs"`
	Public  bool     `json:"http_auth"`
	Visor   string   `json:"log_level"`
}

NewProgramResponse response to a new program request

type UpdateAuthRequest

type UpdateAuthRequest struct {
	ProgramID string `json:"-"`
	AuthValue bool   `json:"http_auth"`
}

UpdateAuthRequest request to update http auth for a program

type UpdateProgDepsRequest

type UpdateProgDepsRequest struct {
	ProgramID string `json:"program_id"`
	Command   string `json:"command"`
}

UpdateProgDepsRequest request to update program dependencies

type UpdateProgDepsResponse

type UpdateProgDepsResponse struct {
	Output   string `json:"output"`
	HasError bool   `json:"-"` // if the output has error
}

UpdateProgDepsResponse response to update program dependencies request

type UpdateProgEnvsRequest

type UpdateProgEnvsRequest struct {
	ProgramID string
	Account   string
	Region    string
	Vars      map[string]*string
}

UpdateProgEnvsRequest request to update program envs

type UpdateProgNameRequest

type UpdateProgNameRequest struct {
	ProgramID string `json:"-"`
	Name      string `json:"name"`
}

UpdateProgNameRequest request to update program name

type UpdateProgRuntimeRequest

type UpdateProgRuntimeRequest struct {
	ProgramID string `json:"-"`
	Runtime   string `json:"runtime"`
}

UpdateProgRuntimeRequest request to update program runtime

type UpdateVisorModeRequest

type UpdateVisorModeRequest struct {
	ProgramID string `json:"-"`
	Mode      string `json:"log_level"`
}

UpdateVisorModeRequest request to update visor mode

Jump to

Keyboard shortcuts

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