client

package
v0.0.0-...-6d02989 Latest Latest
Warning

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

Go to latest
Published: May 24, 2019 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const CreateLinkMutation = `mutation CreateLinkMutation ($link: JSON!) {
	createLink(input: {link: $link}) {
		trace {
			rowId
		}
	}
}`

CreateLinkMutation is the mutation sent to create a link.

View Source
const CreateLinksMutation = `mutation CreateLinksMutation ($links: [CreateLinkInput!]) {
	createLinks(input: $links) {
		links {
			traceId
		}
	}
}`

CreateLinksMutation is the mutation sent to create multiple links.

View Source
const RecipientsKeysQuery = `` /* 185-byte string literal not displayed */

RecipientsKeysQuery is the query sent to fetch the public keys of the workflow participants from trace API.

Variables

View Source
var (
	// ErrNotDecryptor is returned when the connected service is not a decryptor.
	ErrNotDecryptor = errors.New("connected service is not a decryptor")
)

Functions

This section is empty.

Types

type AccountClient

type AccountClient interface {
	// CallAccountGql makes a call to the Account graphql endpoint.
	CallAccountGql(ctx context.Context, query string, variables map[string]interface{}, rsp interface{}) error
}

AccountClient defines all the possible interactions with Account.

type Config

type Config struct {
	// TraceUrl is the URL to trace.
	TraceURL string `toml:"trace_url" comment:"The URL of Stratumn Trace APIs."`
	// AccountUrl is the URL to account.
	AccountURL string `toml:"account_url" comment:"The URL of Stratumn Account APIs."`

	// SigningPrivateKey is pretty well named.
	SigningPrivateKey string `toml:"signing_private_key" comment:"The signing private key."`

	// The name of the decryption service.
	Decryption string `toml:"decryption" comment:"The name of the decryption service."`

	// ConfigVersion is the version of the configuration file.
	ConfigVersion int `toml:"configuration_version" comment:"The version of the service configuration."`
}

Config contains configuration options for the Ping service.

type CreateLinkPayload

type CreateLinkPayload struct {
	CreateLink struct {
		Trace struct {
			RowID string
		}
	}
}

CreateLinkPayload is the type returned by CreateLink.

type CreateLinksPayload

type CreateLinksPayload struct {
	CreateLinks struct {
		Links []struct {
			TraceID string
		}
	}
}

CreateLinksPayload is the type returned by CreateLinks.

type RecipientsKeysRsp

type RecipientsKeysRsp struct {
	WorkflowByRowID *struct {
		Groups struct {
			Nodes []struct {
				Owner struct {
					EncryptionKey struct {
						PublicKey string
						RowID     string
					}
				}
			}
		}
	}
}

RecipientsKeysRsp is the structure of the response of the recipientsKeysQuery query.

type Service

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

Service is the Ping service.

func (*Service) Config

func (s *Service) Config() interface{}

Config returns the current service configuration or creates one with good default values.

func (*Service) Desc

func (s *Service) Desc() string

Desc returns a description of what the service does.

func (*Service) Expose

func (s *Service) Expose() interface{}

Expose exposes the stratumn client to other services. It exposes the Stratumn client.

func (*Service) ID

func (s *Service) ID() string

ID returns the unique identifier of the service.

func (*Service) Migrations

func (s *Service) Migrations() []cfg.MigrateHandler

Migrations is the services migrations.

func (*Service) Name

func (s *Service) Name() string

Name returns the human friendly name of the service.

func (*Service) Needs

func (s *Service) Needs() map[string]struct{}

Needs returns the set of services this service depends on.

func (*Service) Plug

func (s *Service) Plug(exposed map[string]interface{}) error

Plug sets the connected services.

func (*Service) Run

func (s *Service) Run(ctx context.Context, running, stopping func()) error

Run starts the service.

func (*Service) SetConfig

func (s *Service) SetConfig(config interface{}) error

SetConfig configures the service.

func (*Service) VersionKey

func (s *Service) VersionKey() string

VersionKey is the version key.

type StratumnClient

type StratumnClient interface {
	TraceClient
	AccountClient
}

StratumnClient is the client interface to Stratumn services.

type TraceClient

type TraceClient interface {
	// CallTraceGql makes a call to the Trace graphql endpoint.
	CallTraceGql(ctx context.Context, query string, variables map[string]interface{}, rsp interface{}) error
	CreateLink(ctx context.Context, link *chainscript.Link) (*CreateLinkPayload, error)
	CreateLinks(ctx context.Context, links []*chainscript.Link) (*CreateLinksPayload, error)

	GetRecipientsPublicKeys(ctx context.Context, workflowID string) ([]*csutils.PublicKeyInfo, error)
	SignLink(link *chainscript.Link) error
}

TraceClient defines all the possible interactions with Trace.

Directories

Path Synopsis
Package mockclient is a generated GoMock package.
Package mockclient is a generated GoMock package.

Jump to

Keyboard shortcuts

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