internal

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SDKLanguage           = "Go"
	DefaultRequestLibrary = "net/http"
)

Variables

View Source
var SDKSemverVersion string

Functions

func ImportedFunctions

func ImportedFunctions() []extism.HostFunction

ImportedFunctions returns all functions 1Password SDK core must import.

func ReleaseCore

func ReleaseCore()

Types

type ClientConfig

type ClientConfig struct {
	SAToken               string  `json:"serviceAccountToken"`
	Language              string  `json:"programmingLanguage"`
	SDKVersion            string  `json:"sdkVersion"`
	IntegrationName       string  `json:"integrationName"`
	IntegrationVersion    string  `json:"integrationVersion"`
	RequestLibraryName    string  `json:"requestLibraryName"`
	RequestLibraryVersion string  `json:"requestLibraryVersion"`
	SystemOS              string  `json:"os"`
	SystemOSVersion       string  `json:"osVersion"`
	SystemArch            string  `json:"architecture"`
	AccountName           *string `json:"account_name"`
}

ClientConfig contains information required for creating a client.

func NewDefaultConfig

func NewDefaultConfig() ClientConfig

type Core

type Core interface {
	InitClient(ctx context.Context, config []byte) ([]byte, error)
	Invoke(ctx context.Context, invokeConfig []byte) ([]byte, error)
	ReleaseClient(clientID []byte)
}

type CoreWrapper added in v0.4.0

type CoreWrapper struct {
	InnerCore Core
}

func GetExtismCore added in v0.4.0

func GetExtismCore() (*CoreWrapper, error)

GetExtismCore initializes the shared core once and returns the already existing one on subsequent calls.

func GetSharedLibCore added in v0.4.0

func GetSharedLibCore(accountName string) (*CoreWrapper, error)

func (*CoreWrapper) InitClient added in v0.4.0

func (c *CoreWrapper) InitClient(ctx context.Context, config ClientConfig) (*uint64, error)

InitClient creates a client instance in the current core module and returns its unique ID.

func (*CoreWrapper) Invoke added in v0.4.0

func (c *CoreWrapper) Invoke(ctx context.Context, invokeConfig InvokeConfig) (*string, error)

Invoke calls specified business logic from core

func (*CoreWrapper) ReleaseClient added in v0.4.0

func (c *CoreWrapper) ReleaseClient(clientID uint64)

ReleaseClient releases memory in the core associated with the given client ID.

type ExtismCore added in v0.4.0

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

ExtismCore implements Core in such a way that all created client instances share the same core resources.

func (*ExtismCore) InitClient added in v0.4.0

func (c *ExtismCore) InitClient(ctx context.Context, config []byte) ([]byte, error)

InitClient creates a client instance in the current core module and returns its unique ID.

func (*ExtismCore) Invoke added in v0.4.0

func (c *ExtismCore) Invoke(ctx context.Context, invokeConfig []byte) ([]byte, error)

Invoke calls specified business logic from core

func (*ExtismCore) ReleaseClient added in v0.4.0

func (c *ExtismCore) ReleaseClient(clientID []byte)

ReleaseClient releases memory in the core associated with the given client ID.

type InnerClient

type InnerClient struct {
	ID     uint64
	Config ClientConfig
	Core   CoreWrapper
}

InnerClient represents the sdk-core client on which calls will be made.

type Invocation

type Invocation struct {
	ClientID   *uint64    `json:"clientId,omitempty"`
	Parameters Parameters `json:"parameters"`
}

Invocation holds the information required for invoking SDK functionality.

type InvokeConfig

type InvokeConfig struct {
	Invocation Invocation `json:"invocation"`
}

InvokeConfig specifies over the FFI on which client the specified method should be invoked on.

type Parameters added in v0.1.2

type Parameters struct {
	MethodName       string                 `json:"name"`
	SerializedParams map[string]interface{} `json:"parameters"`
}

type Request added in v0.4.0

type Request struct {
	Kind        string `json:"kind"`
	AccountName string `json:"account_name"`
	Payload     []byte `json:"payload"`
}

type Response added in v0.4.0

type Response struct {
	Success bool   `json:"success"`
	Payload []byte `json:"payload"`
}

func (Response) Error added in v0.4.0

func (r Response) Error() string

type SharedLibCore added in v0.4.0

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

func (*SharedLibCore) InitClient added in v0.4.0

func (slc *SharedLibCore) InitClient(ctx context.Context, config []byte) ([]byte, error)

InitClient creates a client instance in the current core module and returns its unique ID.

func (*SharedLibCore) Invoke added in v0.4.0

func (slc *SharedLibCore) Invoke(ctx context.Context, invokeConfig []byte) ([]byte, error)

Invoke performs an SDK operation.

func (*SharedLibCore) ReleaseClient added in v0.4.0

func (slc *SharedLibCore) ReleaseClient(clientID []byte)

ReleaseClient releases memory in the core associated with the given client ID.

Jump to

Keyboard shortcuts

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