contract

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2018 License: BSD-3-Clause Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitModels

func InitModels()

InitModels initialize models in mongo, if required.

Types

type Contract

type Contract struct {
	ID           bson.ObjectId `json:"-" bson:"_id,omitempty"`
	Content      string        `json:"content"`
	ContractType string        `json:"contractType"`
	Expires      db.DateTime   `json:"expires"`
	Extends      []string      `json:"extends"`
	Invalidates  []string      `json:"invalidates"`
	Parties      []Party       `json:"parties"`
	ContractId   string        `json:"contractId"`
	Signatures   []Signature   `json:"signatures"`
}

type ContractSigningRequest

type ContractSigningRequest struct {
	Id         bson.ObjectId `json:"-" bson:"_id,omitempty"`
	ContractId string        `json:"contractId"`
	Party      string        `json:"party"`
}

type Manager

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

Manager is used to store organizations

func NewManager

func NewManager(r *http.Request) *Manager

NewManager creates and initializes a new Manager

func (*Manager) AddSignature

func (m *Manager) AddSignature(contractID string, signature Signature) (err error)

AddSignature adds a signature to a contract

func (*Manager) Delete

func (m *Manager) Delete(contractid string) (err error)

Delete contract

func (*Manager) Exists

func (m *Manager) Exists(contractID string) (bool, error)

Exists checks if a contract with this contractId already exists.

func (*Manager) Get

func (m *Manager) Get(contractid string) (contract *Contract, err error)

Get contract

func (*Manager) GetByIncludedParty

func (m *Manager) GetByIncludedParty(party *Party, start int, max int, includeExpired bool) (contracts []Contract, err error)

GetByIncludedParty Get contracts that include the included party

func (*Manager) IsParticipant

func (m *Manager) IsParticipant(contractID string, name string) (isparticipant bool, err error)

IsParticipant check if name is participant in contract with id contractID

func (*Manager) Save

func (m *Manager) Save(contract *Contract) (err error)

Save contract

type Party

type Party struct {
	Type string
	Name string
}

type Signature

type Signature struct {
	Date      db.DateTime `json:"date"`
	PublicKey string      `json:"publicKey"`
	Signature string      `json:"signature"`
	SignedBy  string      `json:"signedBy"`
}

Jump to

Keyboard shortcuts

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