sdk

package module
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: MIT Imports: 15 Imported by: 0

README

go-sdk

Golang SDK for communicating with Lyrid Platform

The SDK works under a singleton that manages Lyrid token and sessions internally. To download and use in your project: go get github.com/LyridInc/go-sdk

Then import in your project:

import "github.com/LyridInc/go-sdk"

Initialization:
You can initialize the SDK by calling:

sdk.GetInstance().Initialize(key, secret)

Where key and secret is the credentials from Lyrid. You can also use the SDK without initialization by setting LYRID_ACCESS and LYRID_SECRET as your environment variables.

Usage:

sdk.GetInstance().GetUserProfile() sdk.GetInstance().GetAccountProfile()

Simulating Serverless Function

The SDK allows you to simulates serverless function on a local machines by pointing to an endpoint instead of a Lyrid Serverless Function for development.

This helps the transition from local build into serverless functions to be seamless.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LyridClient

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

func GetInstance

func GetInstance() *LyridClient

func (*LyridClient) DisableSimulate

func (client *LyridClient) DisableSimulate()

func (*LyridClient) ExecuteApp

func (lc *LyridClient) ExecuteApp(AppName string, ModuleName string, Tag string, FunctionName string, Uri string, Method string, Body string) ([]byte, error)

func (*LyridClient) ExecuteFunction

func (lc *LyridClient) ExecuteFunction(FunctionId string, Framework string, Body string) ([]byte, error)

func (*LyridClient) ExecuteFunctionByName

func (lc *LyridClient) ExecuteFunctionByName(AppName string, ModuleName string, Tag string, FunctionName string, Body string) ([]byte, error)

POST /execute/:appname/:modulename/:tag/:functionname

func (*LyridClient) GetAccountPolicies

func (lc *LyridClient) GetAccountPolicies() []*model.Policy

func (*LyridClient) GetAccountProfile

func (lc *LyridClient) GetAccountProfile() []*model.Account

func (*LyridClient) GetApps

func (lc *LyridClient) GetApps() []*model.App

func (*LyridClient) GetFunctions

func (lc *LyridClient) GetFunctions(AppId string, ModuleId string, RevisionId string) []*model.Function

func (*LyridClient) GetLyraVersion

func (lc *LyridClient) GetLyraVersion() error

func (*LyridClient) GetLyridURL

func (client *LyridClient) GetLyridURL() string

func (*LyridClient) GetModulePolicies

func (lc *LyridClient) GetModulePolicies(ModuleId string) []*model.Policy

func (*LyridClient) GetModules

func (lc *LyridClient) GetModules(AppId string) []*model.Module

func (*LyridClient) GetPublishedApps

func (lc *LyridClient) GetPublishedApps() []*model.PublishedApp

func (*LyridClient) GetRevisions

func (lc *LyridClient) GetRevisions(AppId string, ModuleId string) []*model.ModuleRevision

func (*LyridClient) GetUserProfile

func (lc *LyridClient) GetUserProfile() *model.LyridUser

func (*LyridClient) Initialize

func (client *LyridClient) Initialize(access string, secret string) error

func (*LyridClient) SetLyridURL

func (client *LyridClient) SetLyridURL(url string)

func (*LyridClient) SimulateServerless

func (client *LyridClient) SimulateServerless(url string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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