client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ModeCompletion     = "COMPLETION"
	ModeCode           = "CODE"
	ModeInlineCode     = "INLINE_CODE"
	ModeEditCode       = "EDIT_CODE"
	ModeDocument       = "DOCUMENT"
	ModeUnitTest       = "UNIT_TEST"
	ModeMigrateSyntax  = "MIGRATE_SYNTAX"
	ModeRefactorNaming = "REFACTOR_NAMING"
	ModeFixSyntax      = "FIX_SYNTAX"

	StatusInProgress = "IN_PROGRESS"
	StatusCompleted  = "COMPLETED"
	StatusFailed     = "FAILED"
	StatusTimedOut   = "TIMED_OUT"
)
View Source
const (
	LanguageC          = "C"
	LanguageCPP        = "CPP"
	LanguageJavaScript = "JAVASCRIPT"
	LanguagePHP        = "PHP"
	LanguageJava       = "JAVA"
	LanguageCSharp     = "CSHARP"
	LanguageGo         = "GO"
	LanguageKotlin     = "KOTLIN"
	LanguageTypeScript = "TYPESCRIPT"
	LanguageRust       = "RUST"
)
View Source
const (
	ModifyNone    = "NONE"
	ModifyReplace = "REPLACE"
)

Variables

View Source
var (
	Version string = "1.0.0"
	Build   string = "20240405"
)

Functions

This section is empty.

Types

type Client

type Client interface {
	Process(ctx context.Context, request *ProcessRequest) (*ProcessResponse, error)
}

func NewClient

func NewClient(config Config) (Client, error)

type ClientError

type ClientError interface {
	error
	Unwrap() error
}

func NewClientError

func NewClientError(message string) ClientError

func NewClientErrorWithCause

func NewClientErrorWithCause(message string, cause error) ClientError

type Config

type Config struct {
	ApiKey                        string
	Endpoint                      *string
	EnableCompression             *bool
	MinimumCompressionPayloadSize *int
}

type Error

type Error struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type Input

type Input struct {
	Source string `json:"source"`
}

type Options added in v0.0.8

type Options struct {
	LanguageVersion *string `json:"languageVersion"`
	Framework       *string `json:"framework"`
	Modify          *string `json:"modify"`
	CodePath        *string `json:"codePath"`
	ContextId       *string `json:"contextId"`
	Model           *string `json:"model"`
}

type Output

type Output struct {
	Source string `json:"source"`
}

type ProcessRequest added in v1.0.0

type ProcessRequest struct {
	Mode     string   `json:"mode"`
	Language string   `json:"language"`
	Input    Input    `json:"input"`
	Options  *Options `json:"options"`
}

type ProcessResponse added in v1.0.0

type ProcessResponse struct {
	Source string `json:"source"`
}

Jump to

Keyboard shortcuts

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