contract

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: BSD-3-Clause Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package contract implements generate smart contract for hyperledger sawtooth

  • Copyright © 2018. TIBCO Software Inc.
  • This file is subject to the license terms contained
  • in the license file that is distributed with this file.

Index

Constants

View Source
const CargoTomlTemplate = `` /* 333-byte string literal not displayed */

CargoTomlTemplate cargo toml template

View Source
const LibRsTemplate = `{{range $crate, $_ := .Crates}}extern crate {{$crate}};
{{end}}

{{range $use, $_ := .Uses}}use {{$use}};
{{end}}
`

LibRsTemplate lib.rs template

View Source
const MainRsTemplate = `` /* 277-byte string literal not displayed */

MainRsTemplate main.rs template

Variables

This section is empty.

Functions

func NewGenerator

func NewGenerator(opts *GenOptions) contract.Generator

NewGenerator is the generator constructor

Types

type CargoToml

type CargoToml struct {
	Name              string
	Version           string
	DovetailMacroPath string
	GitDependencies   []GitDependency
}

CargoToml struct for cargo toml template

type GenOptions

type GenOptions struct {
	TargetDir         string
	ModelFile         string
	DovetailMacroPath string
}

GenOptions defines the generator options

func NewGenOptions

func NewGenOptions(targetPath, modelFile, dovetailMacroPath string) *GenOptions

NewGenOptions is the options constructor

type Generator

type Generator struct {
	Opts *GenOptions
}

Generator defines the generator attributes

func (*Generator) Generate

func (d *Generator) Generate() error

Generate generates a smart contract for the given options

type GitDependency

type GitDependency struct {
	ID  string
	URL string
}

GitDependency struct for cargo toml template dependencies

type LibRs

type LibRs struct {
	Crates  map[string]struct{}
	Uses    map[string]struct{}
	Calls   map[string]struct{}
	Derives map[string]struct{}
}

LibRs struct for lib rs template

type MainRs

type MainRs struct {
	Crates  map[string]struct{}
	Uses    map[string]struct{}
	Calls   map[string]struct{}
	Derives map[string]struct{}
}

MainRs struct for main rs template

Jump to

Keyboard shortcuts

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