Documentation
¶
Index ¶
- Variables
- func Execute(deps *std.Deps, _ types.Env, messageInfo types.MessageInfo, ...) (*types.Response, error)
- func Instantiate(_ *std.Deps, _ types.Env, _ types.MessageInfo, _ []byte) (*types.Response, error)
- func Migrate(_ *std.Deps, _ types.Env, _ []byte) (*types.Response, error)
- func Query(deps *std.Deps, env types.Env, messageBytes []byte) ([]byte, error)
- type ExecuteMsg
- type MsgCreateIdentity
- type MsgDelete
- type MsgUpdateCity
- type Person
- type PersonStateHandler
- func (x PersonStateHandler) Create(storage std.Storage, o Person) error
- func (x PersonStateHandler) Delete(storage std.Storage, o Person) error
- func (x PersonStateHandler) Read(storage std.Storage, address string) (Person, error)
- func (x PersonStateHandler) Update(storage std.Storage, address string, f func(old *Person) (*Person, error)) (err error)
- type QueryIdentity
- type QueryMsg
Constants ¶
This section is empty.
Variables ¶
var ( // ErrPersonNotFound is returned when the object is not found. ErrPersonNotFound = errors.New("src: Person not found") // ErrPersonAlreadyExists is returned when the object already exists. ErrPersonAlreadyExists = errors.New("src: Person already exists") )
var (
ErrUnknownRequest = errors.New("unknown request")
)
var ( // PersonState provides access to the Person namespaced storage. PersonState = PersonStateHandler{/* contains filtered or unexported fields */} )
Functions ¶
func Instantiate ¶
Types ¶
type ExecuteMsg ¶
type ExecuteMsg struct { CreateIdentity *MsgCreateIdentity `json:"create_identity"` UpdateCity *MsgUpdateCity `json:"update_city"` DeleteIdentity *MsgDelete `json:"delete_identity"` }
ExecuteMsg is used to execute state transitions on the identity contract
func (ExecuteMsg) MarshalJSON ¶
func (v ExecuteMsg) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (ExecuteMsg) MarshalTinyJSON ¶
func (v ExecuteMsg) MarshalTinyJSON(w *jwriter.Writer)
MarshalTinyJSON supports tinyjson.Marshaler interface
func (*ExecuteMsg) UnmarshalJSON ¶
func (v *ExecuteMsg) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*ExecuteMsg) UnmarshalTinyJSON ¶
func (v *ExecuteMsg) UnmarshalTinyJSON(l *jlexer.Lexer)
UnmarshalTinyJSON supports tinyjson.Unmarshaler interface
type MsgCreateIdentity ¶
type MsgCreateIdentity struct { Name string `json:"name"` Surname string `json:"surname"` City string `json:"city"` PostalCode int32 `json:"postal_code"` }
func (MsgCreateIdentity) MarshalJSON ¶
func (v MsgCreateIdentity) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (MsgCreateIdentity) MarshalTinyJSON ¶
func (v MsgCreateIdentity) MarshalTinyJSON(w *jwriter.Writer)
MarshalTinyJSON supports tinyjson.Marshaler interface
func (*MsgCreateIdentity) UnmarshalJSON ¶
func (v *MsgCreateIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*MsgCreateIdentity) UnmarshalTinyJSON ¶
func (v *MsgCreateIdentity) UnmarshalTinyJSON(l *jlexer.Lexer)
UnmarshalTinyJSON supports tinyjson.Unmarshaler interface
type MsgDelete ¶
type MsgDelete struct { }
func (MsgDelete) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (MsgDelete) MarshalTinyJSON ¶
MarshalTinyJSON supports tinyjson.Marshaler interface
func (*MsgDelete) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
func (*MsgDelete) UnmarshalTinyJSON ¶
UnmarshalTinyJSON supports tinyjson.Unmarshaler interface
type MsgUpdateCity ¶
func (MsgUpdateCity) MarshalJSON ¶
func (v MsgUpdateCity) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (MsgUpdateCity) MarshalTinyJSON ¶
func (v MsgUpdateCity) MarshalTinyJSON(w *jwriter.Writer)
MarshalTinyJSON supports tinyjson.Marshaler interface
func (*MsgUpdateCity) UnmarshalJSON ¶
func (v *MsgUpdateCity) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*MsgUpdateCity) UnmarshalTinyJSON ¶
func (v *MsgUpdateCity) UnmarshalTinyJSON(l *jlexer.Lexer)
UnmarshalTinyJSON supports tinyjson.Unmarshaler interface
type Person ¶
type Person struct { Address string `json:"address" orm:"primaryKey"` Name string Surname string City string PostalCode int32 }
Person keeps track of the real identity of an address
func (Person) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (Person) MarshalTinyJSON ¶
MarshalTinyJSON supports tinyjson.Marshaler interface
func (*Person) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
func (*Person) UnmarshalTinyJSON ¶
UnmarshalTinyJSON supports tinyjson.Unmarshaler interface
type PersonStateHandler ¶
type PersonStateHandler struct {
// contains filtered or unexported fields
}
PersonStateHandler provides ORM functionality around Person.
func (PersonStateHandler) Create ¶
func (x PersonStateHandler) Create(storage std.Storage, o Person) error
Create handles creation of Person objects. Returns ErrPersonAlreadyExists in case the object exists.
func (PersonStateHandler) Delete ¶
func (x PersonStateHandler) Delete(storage std.Storage, o Person) error
Delete deletes an instance of Person given its Address. Returns ErrPersonNotFound in case no record is found.
func (PersonStateHandler) Read ¶
Read returns Person given its Address. Returns ErrPersonNotFound in case nothing is found.
func (PersonStateHandler) Update ¶
func (x PersonStateHandler) Update(storage std.Storage, address string, f func(old *Person) (*Person, error)) (err error)
Update updates an instance of Person, given its Address by running the provided function f. If f passes a nil Person it means the object was not found. Returning a nil Person from f will cause no updates in the object.
type QueryIdentity ¶
type QueryIdentity struct {
ID string `json:"id"`
}
func (QueryIdentity) MarshalJSON ¶
func (v QueryIdentity) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (QueryIdentity) MarshalTinyJSON ¶
func (v QueryIdentity) MarshalTinyJSON(w *jwriter.Writer)
MarshalTinyJSON supports tinyjson.Marshaler interface
func (*QueryIdentity) UnmarshalJSON ¶
func (v *QueryIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*QueryIdentity) UnmarshalTinyJSON ¶
func (v *QueryIdentity) UnmarshalTinyJSON(l *jlexer.Lexer)
UnmarshalTinyJSON supports tinyjson.Unmarshaler interface
type QueryMsg ¶
type QueryMsg struct {
Identity *QueryIdentity `json:"identity"`
}
func (QueryMsg) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (QueryMsg) MarshalTinyJSON ¶
MarshalTinyJSON supports tinyjson.Marshaler interface
func (*QueryMsg) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
func (*QueryMsg) UnmarshalTinyJSON ¶
UnmarshalTinyJSON supports tinyjson.Unmarshaler interface