fabcar

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 32 Imported by: 0

README

Fabcar CCkit Chaincode

Fabcar CCkit is modification of Hyperledger fabric-samples fabcar chaincode

Fabcar Hyperledger Fabric Chaincode (FHF) short description:

  1. FHF is made without code generating
  2. At FHF you can create cat at once with method 'CreateCar'. Payload example:
{
  "car_number": "CAR1",
  "make": "Toyota",
  "model": "Prius",
  "colour": "blue",
  "owner": "Tomoko"
}
  1. Then you can get car with method 'QueryCar'. Payload example:
{
  "car_number": "CAR1"
}
  1. Or get all cars with method 'QueryAllCars' without payload

  2. Last method is 'ChangeCarOwner' to change car owner. Payload example:

{
  "car_number": "CAR1",
  "new_owner": "Brad"
}

Fabcar CCkit Chaincode (FCk) has four entities: Maker, Car, Owner and Detail. FCk has some difference from FHF:

  1. FCk gateway was generated with proto
  2. You can not create car at once, because before car's maker have to be created and put at BC state. Chaincode state stored as serialized protobuf Use method 'CreateMaker', payload example:
{
  "name": "Toyota",
  "country": "Japan",
  "foundation_year,omitempty": "1937" // it must be more than 1886, because this year was founded the oldest automaker - Mercedes-Benz
}
  1. You can get (method 'GetMaker') or delete (method 'DeleteMaker') maker by its name. For example:
{
  "name": "Toyota"
}
  1. And get all cars with method 'ListMakers' without payload

  2. Now your car can be created with 'CreateCar' method, for example:

{
  "make": "Toyota", // if maker is not created programm will return error
  "model": "Prius",
  "colour": "blue",
  "number": 111111,
  "owners": [
    {
      "first_name": "Tomoko",
      "second_name": "Uemura",
      "vehicle_passport": "bbb222"
    }
  ],
  "details": [
    {
      "type": WHEELS,
      "make": "Michelin"
    },
    {
      "type": BATTERY,
      "make": "BYD"
    }
  ]
}

The response is:

{
  "car": {
    "id": ["Toyota", "Prius", "111111"],
    "make": "",
    "model": "Prius",
    "colour": "blue",
    "number": 111111,
    "owners_quantity": 1
  },
  "owners": {
    "items": [
      {
        "car_id": ["Toyota", "Prius", "111111"],
        "first_name": "Tomoko",
        "second_name": "Uemura",
        "vehicle_passport": "bbb222"
      }
    ]
  },
  "details": {
    "items": [
      {
        "car_id": ["Toyota", "Prius", "111111"],
        "type": WHEELS,
        "make": "Michelin"
      },
      {
        "car_id": ["Toyota", "Prius", "111111"],
        "type": BATTERY,
        "make": "BYD"
      }
    ]
  }
}
  1. Car updating makes with 'UpdateCar', payload:
{
  "id": ["Toyota", "Prius", "111111"],
  "color": "red",
  "owners": [
    {
      "car_id": ["Toyota", "Prius", "111111"],
      "first_name": "Tomoko",
      "second_name": "Uemura",
      "vehicle_passport": "ccc333"
    },
    {
      "car_id": ["Toyota", "Prius", "111111"],
      "first_name": "Michel",
      "second_name": "Uemura",
      "vehicle_passport": "ddd444"
    }
  ],
  "details": [
    {
      "car_id": ["Toyota", "Prius", "111111"],
      "type": BATTERY,
      "make": "Panasonic"
    }
  ]
}

The response is:

{
  "car": {
    "id": ["Toyota", "Prius", "111111"],
    "make": "",
    "model": "Prius",
    "colour": "red", // it was 'blue'
    "number": 111111,
    "owners_quantity": 2 // become more
  },
  "owners": {
    "items": [ // become more
      {
        "car_id": ["Toyota", "Prius", "111111"],
        "first_name": "Tomoko",
        "second_name": "Uemura",
        "vehicle_passport": "ccc333" // it was 'bbb222'
      },
      { // it was added
        "car_id": ["Toyota", "Prius", "111111"],
        "first_name": "Michel",
        "second_name": "Tailor",
        "vehicle_passport": "ddd444"
      }
    ]
  },
  "details": {
    "items": [
      {
        "car_id": ["Toyota", "Prius", "111111"],
        "type": WHEELS,
        "make": "Michelin"
      },
      {
        "car_id": ["Toyota", "Prius", "111111"],
        "type": BATTERY,
        "make": "Panasonic" // it was 'BYD'
      }
    ]
  }
}
  1. Also, you can delete car with 'DeleteCar', the response is like from 'UpdateCar' method (point 5)

  2. If you would like to get car, use 'GetCar' to get it without owners and details or 'GetCarView' with them. Request:

{
  "id": ["Toyota", "Prius", "111111"]
}
  1. To get all cars use 'ListCars' without payload

  2. Also, car owner can be updated without car changing ('UpdateCarOwners' method):

{
  "car_id": ["Toyota", "Prius", "111111"],
  "owners": [
    {
      "first_name": "Tomoko",
      "second_name": "Uemura",
      "vehicle_passport": "eee555"
    },
    {
      "first_name": "Adriana",
      "second_name": "Grande",
      "vehicle_passport": "fff666"
    }
  ]
}

The response:

{
  "items": [
    {
      "car_id": ["Toyota", "Prius", "111111"],
      "first_name": "Tomoko",
      "second_name": "Uemura",
      "vehicle_passport": "eee555" // it was 'ccc333'
    },
    { // without changes
      "car_id": ["Toyota", "Prius", "111111"],
      "first_name": "Michel",
      "second_name": "Uemura",
      "vehicle_passport": "ddd444"
    },
    { // was added
      "car_id": ["Toyota", "Prius", "111111"],
      "first_name": "Adriana",
      "second_name": "Grande",
      "vehicle_passport": "fff666"
    }
  ]
}
  1. To delete ('DeleteCarOwner') or get ('GetCarOwner') car owner use the same payload:
{
  "car_id": ["Toyota", "Prius", "111111"],
  "first_name": "Tomoko",
  "second_name": "Uemura"
}
  1. Also, you can update car detail ('UpdateCarDetails') without car changes, for example:
{
  "car_id": ["Toyota", "Prius", "111111"],
  "details": [
     {
        "type": WHEELS, 
        "make": "Michelin"
     },
     {
        "type": BATTERY,
        "make": "Contemporary Amperex Technology"
     }
  ]
}

The response:

{
   "items": [
      { // without changes
         "car_id": ["Toyota", "Prius", "111111"],
         "type": WHEELS,
         "make": "Michelin"
      },
      {
         "car_id": ["Toyota", "Prius", "111111"],
         "type": BATTERY,
         "make": "Contemporary Amperex Technology" // it was 'Panasonic'
      }
   ]
}
  1. To delete ('DeleteCarDetail') or get ('GetCarDetail') car owner use the same payload:
{
  "car_id": ["Toyota", "Prius", "111111"],
  "type": BATTERY
}
  1. And, of course, you can get list of car owners (method 'ListCarOwners') or list of car details (method 'ListCarDetails') by car id. Use payload:
{
   "id": ["Toyota", "Prius", "111111"] 
}

Documentation

Overview

Package fabcar contains

  • chaincode methods names {service_name}Chaincode_{method_name}
  • chaincode interface definition {service_name}Chaincode
  • chaincode gateway definition {service_name}}Gateway
  • chaincode service to cckit router registration func

Package fabcar is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (

	// FabCarServiceChaincodeMethodPrefix allows to use multiple services with same method names in one chaincode
	FabCarServiceChaincodeMethodPrefix = ""

	FabCarServiceChaincode_CreateMaker = FabCarServiceChaincodeMethodPrefix + "CreateMaker"

	FabCarServiceChaincode_DeleteMaker = FabCarServiceChaincodeMethodPrefix + "DeleteMaker"

	FabCarServiceChaincode_GetMaker = FabCarServiceChaincodeMethodPrefix + "GetMaker"

	FabCarServiceChaincode_ListMakers = FabCarServiceChaincodeMethodPrefix + "ListMakers"

	FabCarServiceChaincode_CreateCar = FabCarServiceChaincodeMethodPrefix + "CreateCar"

	FabCarServiceChaincode_UpdateCar = FabCarServiceChaincodeMethodPrefix + "UpdateCar"

	FabCarServiceChaincode_DeleteCar = FabCarServiceChaincodeMethodPrefix + "DeleteCar"

	FabCarServiceChaincode_GetCar = FabCarServiceChaincodeMethodPrefix + "GetCar"

	FabCarServiceChaincode_GetCarView = FabCarServiceChaincodeMethodPrefix + "GetCarView"

	FabCarServiceChaincode_ListCars = FabCarServiceChaincodeMethodPrefix + "ListCars"

	FabCarServiceChaincode_UpdateCarOwners = FabCarServiceChaincodeMethodPrefix + "UpdateCarOwners"

	FabCarServiceChaincode_DeleteCarOwner = FabCarServiceChaincodeMethodPrefix + "DeleteCarOwner"

	FabCarServiceChaincode_GetCarOwner = FabCarServiceChaincodeMethodPrefix + "GetCarOwner"

	FabCarServiceChaincode_ListCarOwners = FabCarServiceChaincodeMethodPrefix + "ListCarOwners"

	FabCarServiceChaincode_UpdateCarDetails = FabCarServiceChaincodeMethodPrefix + "UpdateCarDetails"

	FabCarServiceChaincode_DeleteCarDetail = FabCarServiceChaincodeMethodPrefix + "DeleteCarDetail"

	FabCarServiceChaincode_GetCarDetail = FabCarServiceChaincodeMethodPrefix + "GetCarDetail"

	FabCarServiceChaincode_ListCarDetails = FabCarServiceChaincodeMethodPrefix + "ListCarDetails"
)

FabCarServiceChaincode method names

View Source
const ChaincodeName = `fabcar`

Variables

View Source
var (
	DetailType_name = map[int32]string{
		0: "WHEELS",
		1: "BATTERY",
	}
	DetailType_value = map[string]int32{
		"WHEELS":  0,
		"BATTERY": 1,
	}
)

Enum value maps for DetailType.

View Source
var (
	StateMappings = m.StateMappings{}.
					Add(&Maker{},
			m.PKeySchema(&MakerName{}),
			m.List(&Makers{})).
		Add(&Car{},
			m.PKeySchema(&CarId{}),
			m.List(&Cars{})).
		Add(&CarOwner{},
			m.PKeySchema(&CarOwnerId{}),
			m.List(&CarOwners{})).
		Add(&CarDetail{},
			m.PKeySchema(&CarDetailId{}),
			m.List(&CarDetails{}))

	EventMappings = m.EventMappings{}.
					Add(&MakerCreated{}).
					Add(&MakerDeleted{}).
					Add(&CarCreated{}).
					Add(&CarDeleted{}).
					Add(&CarUpdated{}).
					Add(&CarOwnerDeleted{}).
					Add(&CarOwnersUpdated{}).
					Add(&CarDetailDeleted{}).
					Add(&CarDetailsUpdated{})
)
View Source
var FabCarServiceSwagger []byte
View Source
var File_fabcar_fabcar_proto protoreflect.FileDescriptor

Functions

func ChaincodeInitFunc

func ChaincodeInitFunc() func(router.Context) (interface{}, error)

func CreateCarID

func CreateCarID(car *Car) []string

func Event

func Event(ctx router.Context) state.Event

func New

func New() (*router.Chaincode, error)

func RegisterFabCarServiceChaincode

func RegisterFabCarServiceChaincode(r *cckit_router.Group, cc FabCarServiceChaincode) error

RegisterFabCarServiceChaincode registers service methods as chaincode router handlers

func RegisterFabCarServiceHandler

func RegisterFabCarServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterFabCarServiceHandler registers the http handlers for service FabCarService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterFabCarServiceHandlerClient

func RegisterFabCarServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client FabCarServiceClient) error

RegisterFabCarServiceHandlerClient registers the http handlers for service FabCarService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "FabCarServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "FabCarServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "FabCarServiceClient" to call the correct interceptors.

func RegisterFabCarServiceHandlerFromEndpoint

func RegisterFabCarServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterFabCarServiceHandlerFromEndpoint is same as RegisterFabCarServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterFabCarServiceHandlerServer

func RegisterFabCarServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FabCarServiceServer) error

RegisterFabCarServiceHandlerServer registers the http handlers for service FabCarService to "mux". UnaryRPC :call FabCarServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterFabCarServiceHandlerFromEndpoint instead.

func RegisterFabCarServiceServer

func RegisterFabCarServiceServer(s *grpc.Server, srv FabCarServiceServer)

func State

func State(ctx router.Context) m.MappedState

Types

type Car

type Car struct {
	Id        []string               `protobuf:"bytes,1,rep,name=id,proto3" json:"id,omitempty"`
	Make      string                 `protobuf:"bytes,2,opt,name=make,proto3" json:"make,omitempty"`
	Model     string                 `protobuf:"bytes,3,opt,name=model,proto3" json:"model,omitempty"`
	Colour    string                 `protobuf:"bytes,4,opt,name=colour,proto3" json:"colour,omitempty"`
	Number    uint64                 `protobuf:"varint,5,opt,name=number,proto3" json:"number,omitempty"`
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Car) Descriptor deprecated

func (*Car) Descriptor() ([]byte, []int)

Deprecated: Use Car.ProtoReflect.Descriptor instead.

func (*Car) GetColour

func (x *Car) GetColour() string

func (*Car) GetId

func (x *Car) GetId() []string

func (*Car) GetMake

func (x *Car) GetMake() string

func (*Car) GetModel

func (x *Car) GetModel() string

func (*Car) GetNumber

func (x *Car) GetNumber() uint64

func (*Car) GetUpdatedAt

func (x *Car) GetUpdatedAt() *timestamppb.Timestamp

func (*Car) ProtoMessage

func (*Car) ProtoMessage()

func (*Car) ProtoReflect

func (x *Car) ProtoReflect() protoreflect.Message

func (*Car) Reset

func (x *Car) Reset()

func (*Car) String

func (x *Car) String() string

func (*Car) Validate

func (this *Car) Validate() error

type CarCreated

type CarCreated struct {
	Id     []string `protobuf:"bytes,1,rep,name=id,proto3" json:"id,omitempty"`
	Make   string   `protobuf:"bytes,2,opt,name=make,proto3" json:"make,omitempty"`
	Model  string   `protobuf:"bytes,3,opt,name=model,proto3" json:"model,omitempty"`
	Colour string   `protobuf:"bytes,4,opt,name=colour,proto3" json:"colour,omitempty"`
	Number uint64   `protobuf:"varint,5,opt,name=number,proto3" json:"number,omitempty"`
	// contains filtered or unexported fields
}

func (*CarCreated) Descriptor deprecated

func (*CarCreated) Descriptor() ([]byte, []int)

Deprecated: Use CarCreated.ProtoReflect.Descriptor instead.

func (*CarCreated) GetColour

func (x *CarCreated) GetColour() string

func (*CarCreated) GetId

func (x *CarCreated) GetId() []string

func (*CarCreated) GetMake

func (x *CarCreated) GetMake() string

func (*CarCreated) GetModel

func (x *CarCreated) GetModel() string

func (*CarCreated) GetNumber

func (x *CarCreated) GetNumber() uint64

func (*CarCreated) ProtoMessage

func (*CarCreated) ProtoMessage()

func (*CarCreated) ProtoReflect

func (x *CarCreated) ProtoReflect() protoreflect.Message

func (*CarCreated) Reset

func (x *CarCreated) Reset()

func (*CarCreated) String

func (x *CarCreated) String() string

func (*CarCreated) Validate

func (this *CarCreated) Validate() error

type CarDeleted

type CarDeleted struct {
	Id      []string    `protobuf:"bytes,1,rep,name=id,proto3" json:"id,omitempty"`
	Make    string      `protobuf:"bytes,2,opt,name=make,proto3" json:"make,omitempty"`
	Model   string      `protobuf:"bytes,3,opt,name=model,proto3" json:"model,omitempty"`
	Colour  string      `protobuf:"bytes,4,opt,name=colour,proto3" json:"colour,omitempty"`
	Number  uint64      `protobuf:"varint,5,opt,name=number,proto3" json:"number,omitempty"`
	Owners  *CarOwners  `protobuf:"bytes,6,opt,name=owners,proto3" json:"owners,omitempty"`
	Details *CarDetails `protobuf:"bytes,7,opt,name=details,proto3" json:"details,omitempty"`
	// contains filtered or unexported fields
}

func (*CarDeleted) Descriptor deprecated

func (*CarDeleted) Descriptor() ([]byte, []int)

Deprecated: Use CarDeleted.ProtoReflect.Descriptor instead.

func (*CarDeleted) GetColour

func (x *CarDeleted) GetColour() string

func (*CarDeleted) GetDetails

func (x *CarDeleted) GetDetails() *CarDetails

func (*CarDeleted) GetId

func (x *CarDeleted) GetId() []string

func (*CarDeleted) GetMake

func (x *CarDeleted) GetMake() string

func (*CarDeleted) GetModel

func (x *CarDeleted) GetModel() string

func (*CarDeleted) GetNumber

func (x *CarDeleted) GetNumber() uint64

func (*CarDeleted) GetOwners

func (x *CarDeleted) GetOwners() *CarOwners

func (*CarDeleted) ProtoMessage

func (*CarDeleted) ProtoMessage()

func (*CarDeleted) ProtoReflect

func (x *CarDeleted) ProtoReflect() protoreflect.Message

func (*CarDeleted) Reset

func (x *CarDeleted) Reset()

func (*CarDeleted) String

func (x *CarDeleted) String() string

func (*CarDeleted) Validate

func (this *CarDeleted) Validate() error

type CarDetail

type CarDetail struct {
	CarId     []string               `protobuf:"bytes,1,rep,name=car_id,json=carId,proto3" json:"car_id,omitempty"`
	Type      DetailType             `protobuf:"varint,2,opt,name=type,proto3,enum=examples.fabcar.DetailType" json:"type,omitempty"`
	Make      string                 `protobuf:"bytes,3,opt,name=make,proto3" json:"make,omitempty"`
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

func (*CarDetail) Descriptor deprecated

func (*CarDetail) Descriptor() ([]byte, []int)

Deprecated: Use CarDetail.ProtoReflect.Descriptor instead.

func (*CarDetail) GetCarId

func (x *CarDetail) GetCarId() []string

func (*CarDetail) GetMake

func (x *CarDetail) GetMake() string

func (*CarDetail) GetType

func (x *CarDetail) GetType() DetailType

func (*CarDetail) GetUpdatedAt

func (x *CarDetail) GetUpdatedAt() *timestamppb.Timestamp

func (*CarDetail) ProtoMessage

func (*CarDetail) ProtoMessage()

func (*CarDetail) ProtoReflect

func (x *CarDetail) ProtoReflect() protoreflect.Message

func (*CarDetail) Reset

func (x *CarDetail) Reset()

func (*CarDetail) String

func (x *CarDetail) String() string

func (*CarDetail) Validate

func (this *CarDetail) Validate() error

type CarDetailDeleted

type CarDetailDeleted struct {
	Detail *CarDetail `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail,omitempty"`
	// contains filtered or unexported fields
}

func (*CarDetailDeleted) Descriptor deprecated

func (*CarDetailDeleted) Descriptor() ([]byte, []int)

Deprecated: Use CarDetailDeleted.ProtoReflect.Descriptor instead.

func (*CarDetailDeleted) GetDetail

func (x *CarDetailDeleted) GetDetail() *CarDetail

func (*CarDetailDeleted) ProtoMessage

func (*CarDetailDeleted) ProtoMessage()

func (*CarDetailDeleted) ProtoReflect

func (x *CarDetailDeleted) ProtoReflect() protoreflect.Message

func (*CarDetailDeleted) Reset

func (x *CarDetailDeleted) Reset()

func (*CarDetailDeleted) String

func (x *CarDetailDeleted) String() string

func (*CarDetailDeleted) Validate

func (this *CarDetailDeleted) Validate() error

type CarDetailId

type CarDetailId struct {
	CarId []string   `protobuf:"bytes,1,rep,name=car_id,json=carId,proto3" json:"car_id,omitempty"`
	Type  DetailType `protobuf:"varint,2,opt,name=type,proto3,enum=examples.fabcar.DetailType" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*CarDetailId) Descriptor deprecated

func (*CarDetailId) Descriptor() ([]byte, []int)

Deprecated: Use CarDetailId.ProtoReflect.Descriptor instead.

func (*CarDetailId) GetCarId

func (x *CarDetailId) GetCarId() []string

func (*CarDetailId) GetType

func (x *CarDetailId) GetType() DetailType

func (*CarDetailId) ProtoMessage

func (*CarDetailId) ProtoMessage()

func (*CarDetailId) ProtoReflect

func (x *CarDetailId) ProtoReflect() protoreflect.Message

func (*CarDetailId) Reset

func (x *CarDetailId) Reset()

func (*CarDetailId) String

func (x *CarDetailId) String() string

func (*CarDetailId) Validate

func (this *CarDetailId) Validate() error

type CarDetails

type CarDetails struct {
	Items []*CarDetail `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*CarDetails) Descriptor deprecated

func (*CarDetails) Descriptor() ([]byte, []int)

Deprecated: Use CarDetails.ProtoReflect.Descriptor instead.

func (*CarDetails) GetItems

func (x *CarDetails) GetItems() []*CarDetail

func (*CarDetails) ProtoMessage

func (*CarDetails) ProtoMessage()

func (*CarDetails) ProtoReflect

func (x *CarDetails) ProtoReflect() protoreflect.Message

func (*CarDetails) Reset

func (x *CarDetails) Reset()

func (*CarDetails) String

func (x *CarDetails) String() string

func (*CarDetails) Validate

func (this *CarDetails) Validate() error

type CarDetailsUpdated

type CarDetailsUpdated struct {
	Details *CarDetails `protobuf:"bytes,1,opt,name=details,proto3" json:"details,omitempty"`
	// contains filtered or unexported fields
}

func (*CarDetailsUpdated) Descriptor deprecated

func (*CarDetailsUpdated) Descriptor() ([]byte, []int)

Deprecated: Use CarDetailsUpdated.ProtoReflect.Descriptor instead.

func (*CarDetailsUpdated) GetDetails

func (x *CarDetailsUpdated) GetDetails() *CarDetails

func (*CarDetailsUpdated) ProtoMessage

func (*CarDetailsUpdated) ProtoMessage()

func (*CarDetailsUpdated) ProtoReflect

func (x *CarDetailsUpdated) ProtoReflect() protoreflect.Message

func (*CarDetailsUpdated) Reset

func (x *CarDetailsUpdated) Reset()

func (*CarDetailsUpdated) String

func (x *CarDetailsUpdated) String() string

func (*CarDetailsUpdated) Validate

func (this *CarDetailsUpdated) Validate() error

type CarId

type CarId struct {
	Id []string `protobuf:"bytes,1,rep,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*CarId) Descriptor deprecated

func (*CarId) Descriptor() ([]byte, []int)

Deprecated: Use CarId.ProtoReflect.Descriptor instead.

func (*CarId) GetId

func (x *CarId) GetId() []string

func (*CarId) ProtoMessage

func (*CarId) ProtoMessage()

func (*CarId) ProtoReflect

func (x *CarId) ProtoReflect() protoreflect.Message

func (*CarId) Reset

func (x *CarId) Reset()

func (*CarId) String

func (x *CarId) String() string

func (*CarId) Validate

func (this *CarId) Validate() error

type CarOwner

type CarOwner struct {
	CarId           []string               `protobuf:"bytes,1,rep,name=car_id,json=carId,proto3" json:"car_id,omitempty"`
	FirstName       string                 `protobuf:"bytes,2,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
	SecondName      string                 `protobuf:"bytes,3,opt,name=second_name,json=secondName,proto3" json:"second_name,omitempty"`
	VehiclePassport string                 `protobuf:"bytes,4,opt,name=vehicle_passport,json=vehiclePassport,proto3" json:"vehicle_passport,omitempty"`
	UpdatedAt       *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

func (*CarOwner) Descriptor deprecated

func (*CarOwner) Descriptor() ([]byte, []int)

Deprecated: Use CarOwner.ProtoReflect.Descriptor instead.

func (*CarOwner) GetCarId

func (x *CarOwner) GetCarId() []string

func (*CarOwner) GetFirstName

func (x *CarOwner) GetFirstName() string

func (*CarOwner) GetSecondName

func (x *CarOwner) GetSecondName() string

func (*CarOwner) GetUpdatedAt

func (x *CarOwner) GetUpdatedAt() *timestamppb.Timestamp

func (*CarOwner) GetVehiclePassport

func (x *CarOwner) GetVehiclePassport() string

func (*CarOwner) ProtoMessage

func (*CarOwner) ProtoMessage()

func (*CarOwner) ProtoReflect

func (x *CarOwner) ProtoReflect() protoreflect.Message

func (*CarOwner) Reset

func (x *CarOwner) Reset()

func (*CarOwner) String

func (x *CarOwner) String() string

func (*CarOwner) Validate

func (this *CarOwner) Validate() error

type CarOwnerDeleted

type CarOwnerDeleted struct {
	Owner *CarOwner `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
	// contains filtered or unexported fields
}

func (*CarOwnerDeleted) Descriptor deprecated

func (*CarOwnerDeleted) Descriptor() ([]byte, []int)

Deprecated: Use CarOwnerDeleted.ProtoReflect.Descriptor instead.

func (*CarOwnerDeleted) GetOwner

func (x *CarOwnerDeleted) GetOwner() *CarOwner

func (*CarOwnerDeleted) ProtoMessage

func (*CarOwnerDeleted) ProtoMessage()

func (*CarOwnerDeleted) ProtoReflect

func (x *CarOwnerDeleted) ProtoReflect() protoreflect.Message

func (*CarOwnerDeleted) Reset

func (x *CarOwnerDeleted) Reset()

func (*CarOwnerDeleted) String

func (x *CarOwnerDeleted) String() string

func (*CarOwnerDeleted) Validate

func (this *CarOwnerDeleted) Validate() error

type CarOwnerId

type CarOwnerId struct {
	CarId      []string `protobuf:"bytes,1,rep,name=car_id,json=carId,proto3" json:"car_id,omitempty"`
	FirstName  string   `protobuf:"bytes,2,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
	SecondName string   `protobuf:"bytes,3,opt,name=second_name,json=secondName,proto3" json:"second_name,omitempty"`
	// contains filtered or unexported fields
}

func (*CarOwnerId) Descriptor deprecated

func (*CarOwnerId) Descriptor() ([]byte, []int)

Deprecated: Use CarOwnerId.ProtoReflect.Descriptor instead.

func (*CarOwnerId) GetCarId

func (x *CarOwnerId) GetCarId() []string

func (*CarOwnerId) GetFirstName

func (x *CarOwnerId) GetFirstName() string

func (*CarOwnerId) GetSecondName

func (x *CarOwnerId) GetSecondName() string

func (*CarOwnerId) ProtoMessage

func (*CarOwnerId) ProtoMessage()

func (*CarOwnerId) ProtoReflect

func (x *CarOwnerId) ProtoReflect() protoreflect.Message

func (*CarOwnerId) Reset

func (x *CarOwnerId) Reset()

func (*CarOwnerId) String

func (x *CarOwnerId) String() string

func (*CarOwnerId) Validate

func (this *CarOwnerId) Validate() error

type CarOwners

type CarOwners struct {
	Items []*CarOwner `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*CarOwners) Descriptor deprecated

func (*CarOwners) Descriptor() ([]byte, []int)

Deprecated: Use CarOwners.ProtoReflect.Descriptor instead.

func (*CarOwners) GetItems

func (x *CarOwners) GetItems() []*CarOwner

func (*CarOwners) ProtoMessage

func (*CarOwners) ProtoMessage()

func (*CarOwners) ProtoReflect

func (x *CarOwners) ProtoReflect() protoreflect.Message

func (*CarOwners) Reset

func (x *CarOwners) Reset()

func (*CarOwners) String

func (x *CarOwners) String() string

func (*CarOwners) Validate

func (this *CarOwners) Validate() error

type CarOwnersUpdated

type CarOwnersUpdated struct {
	Owners *CarOwners `protobuf:"bytes,1,opt,name=owners,proto3" json:"owners,omitempty"`
	// contains filtered or unexported fields
}

func (*CarOwnersUpdated) Descriptor deprecated

func (*CarOwnersUpdated) Descriptor() ([]byte, []int)

Deprecated: Use CarOwnersUpdated.ProtoReflect.Descriptor instead.

func (*CarOwnersUpdated) GetOwners

func (x *CarOwnersUpdated) GetOwners() *CarOwners

func (*CarOwnersUpdated) ProtoMessage

func (*CarOwnersUpdated) ProtoMessage()

func (*CarOwnersUpdated) ProtoReflect

func (x *CarOwnersUpdated) ProtoReflect() protoreflect.Message

func (*CarOwnersUpdated) Reset

func (x *CarOwnersUpdated) Reset()

func (*CarOwnersUpdated) String

func (x *CarOwnersUpdated) String() string

func (*CarOwnersUpdated) Validate

func (this *CarOwnersUpdated) Validate() error

type CarUpdated

type CarUpdated struct {
	Id     []string `protobuf:"bytes,1,rep,name=id,proto3" json:"id,omitempty"`
	Colour string   `protobuf:"bytes,2,opt,name=colour,proto3" json:"colour,omitempty"`
	// contains filtered or unexported fields
}

func (*CarUpdated) Descriptor deprecated

func (*CarUpdated) Descriptor() ([]byte, []int)

Deprecated: Use CarUpdated.ProtoReflect.Descriptor instead.

func (*CarUpdated) GetColour

func (x *CarUpdated) GetColour() string

func (*CarUpdated) GetId

func (x *CarUpdated) GetId() []string

func (*CarUpdated) ProtoMessage

func (*CarUpdated) ProtoMessage()

func (*CarUpdated) ProtoReflect

func (x *CarUpdated) ProtoReflect() protoreflect.Message

func (*CarUpdated) Reset

func (x *CarUpdated) Reset()

func (*CarUpdated) String

func (x *CarUpdated) String() string

func (*CarUpdated) Validate

func (this *CarUpdated) Validate() error

type CarView

type CarView struct {
	Car     *Car        `protobuf:"bytes,1,opt,name=car,proto3" json:"car,omitempty"`
	Owners  *CarOwners  `protobuf:"bytes,2,opt,name=owners,proto3" json:"owners,omitempty"`
	Details *CarDetails `protobuf:"bytes,3,opt,name=details,proto3" json:"details,omitempty"`
	// contains filtered or unexported fields
}

func (*CarView) Descriptor deprecated

func (*CarView) Descriptor() ([]byte, []int)

Deprecated: Use CarView.ProtoReflect.Descriptor instead.

func (*CarView) GetCar

func (x *CarView) GetCar() *Car

func (*CarView) GetDetails

func (x *CarView) GetDetails() *CarDetails

func (*CarView) GetOwners

func (x *CarView) GetOwners() *CarOwners

func (*CarView) ProtoMessage

func (*CarView) ProtoMessage()

func (*CarView) ProtoReflect

func (x *CarView) ProtoReflect() protoreflect.Message

func (*CarView) Reset

func (x *CarView) Reset()

func (*CarView) String

func (x *CarView) String() string

func (*CarView) Validate

func (this *CarView) Validate() error

type Cars

type Cars struct {
	Items []*Car `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*Cars) Descriptor deprecated

func (*Cars) Descriptor() ([]byte, []int)

Deprecated: Use Cars.ProtoReflect.Descriptor instead.

func (*Cars) GetItems

func (x *Cars) GetItems() []*Car

func (*Cars) ProtoMessage

func (*Cars) ProtoMessage()

func (*Cars) ProtoReflect

func (x *Cars) ProtoReflect() protoreflect.Message

func (*Cars) Reset

func (x *Cars) Reset()

func (*Cars) String

func (x *Cars) String() string

func (*Cars) Validate

func (this *Cars) Validate() error

type CreateCarRequest

type CreateCarRequest struct {
	Make    string          `protobuf:"bytes,1,opt,name=make,proto3" json:"make,omitempty"`
	Model   string          `protobuf:"bytes,2,opt,name=model,proto3" json:"model,omitempty"`
	Colour  string          `protobuf:"bytes,3,opt,name=colour,proto3" json:"colour,omitempty"`
	Number  uint64          `protobuf:"varint,4,opt,name=number,proto3" json:"number,omitempty"`
	Owners  []*SetCarOwner  `protobuf:"bytes,5,rep,name=owners,proto3" json:"owners,omitempty"`
	Details []*SetCarDetail `protobuf:"bytes,6,rep,name=details,proto3" json:"details,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateCarRequest) Descriptor deprecated

func (*CreateCarRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateCarRequest.ProtoReflect.Descriptor instead.

func (*CreateCarRequest) GetColour

func (x *CreateCarRequest) GetColour() string

func (*CreateCarRequest) GetDetails

func (x *CreateCarRequest) GetDetails() []*SetCarDetail

func (*CreateCarRequest) GetMake

func (x *CreateCarRequest) GetMake() string

func (*CreateCarRequest) GetModel

func (x *CreateCarRequest) GetModel() string

func (*CreateCarRequest) GetNumber

func (x *CreateCarRequest) GetNumber() uint64

func (*CreateCarRequest) GetOwners

func (x *CreateCarRequest) GetOwners() []*SetCarOwner

func (*CreateCarRequest) ProtoMessage

func (*CreateCarRequest) ProtoMessage()

func (*CreateCarRequest) ProtoReflect

func (x *CreateCarRequest) ProtoReflect() protoreflect.Message

func (*CreateCarRequest) Reset

func (x *CreateCarRequest) Reset()

func (*CreateCarRequest) String

func (x *CreateCarRequest) String() string

func (*CreateCarRequest) Validate

func (this *CreateCarRequest) Validate() error

type CreateMakerRequest

type CreateMakerRequest struct {
	Name           string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Country        string `protobuf:"bytes,2,opt,name=country,proto3" json:"country,omitempty"`
	FoundationYear uint64 `protobuf:"varint,3,opt,name=foundation_year,json=foundationYear,proto3" json:"foundation_year,omitempty"` // in 1886 was founded the oldest automaker - Mercedes-Benz
	// contains filtered or unexported fields
}

Entities

func (*CreateMakerRequest) Descriptor deprecated

func (*CreateMakerRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateMakerRequest.ProtoReflect.Descriptor instead.

func (*CreateMakerRequest) GetCountry

func (x *CreateMakerRequest) GetCountry() string

func (*CreateMakerRequest) GetFoundationYear

func (x *CreateMakerRequest) GetFoundationYear() uint64

func (*CreateMakerRequest) GetName

func (x *CreateMakerRequest) GetName() string

func (*CreateMakerRequest) ProtoMessage

func (*CreateMakerRequest) ProtoMessage()

func (*CreateMakerRequest) ProtoReflect

func (x *CreateMakerRequest) ProtoReflect() protoreflect.Message

func (*CreateMakerRequest) Reset

func (x *CreateMakerRequest) Reset()

func (*CreateMakerRequest) String

func (x *CreateMakerRequest) String() string

func (*CreateMakerRequest) Validate

func (this *CreateMakerRequest) Validate() error

type DetailType

type DetailType int32

Dictionaries

const (
	DetailType_WHEELS  DetailType = 0
	DetailType_BATTERY DetailType = 1
)

func (DetailType) Descriptor

func (DetailType) Descriptor() protoreflect.EnumDescriptor

func (DetailType) Enum

func (x DetailType) Enum() *DetailType

func (DetailType) EnumDescriptor deprecated

func (DetailType) EnumDescriptor() ([]byte, []int)

Deprecated: Use DetailType.Descriptor instead.

func (DetailType) Number

func (x DetailType) Number() protoreflect.EnumNumber

func (DetailType) String

func (x DetailType) String() string

func (DetailType) Type

type FabCarService

type FabCarService struct{}

func (*FabCarService) CreateCar

func (f *FabCarService) CreateCar(ctx router.Context, req *CreateCarRequest) (*CarView, error)

func (*FabCarService) CreateMaker

func (f *FabCarService) CreateMaker(ctx router.Context, req *CreateMakerRequest) (*Maker, error)

func (*FabCarService) DeleteCar

func (f *FabCarService) DeleteCar(ctx router.Context, id *CarId) (*CarView, error)

func (*FabCarService) DeleteCarDetail

func (f *FabCarService) DeleteCarDetail(ctx router.Context, id *CarDetailId) (*CarDetail, error)

func (*FabCarService) DeleteCarOwner

func (f *FabCarService) DeleteCarOwner(ctx router.Context, id *CarOwnerId) (*CarOwner, error)

func (*FabCarService) DeleteMaker

func (f *FabCarService) DeleteMaker(ctx router.Context, name *MakerName) (*Maker, error)

func (*FabCarService) GetCar

func (f *FabCarService) GetCar(ctx router.Context, id *CarId) (*Car, error)

func (*FabCarService) GetCarDetail

func (f *FabCarService) GetCarDetail(ctx router.Context, id *CarDetailId) (*CarDetail, error)

func (*FabCarService) GetCarOwner

func (f *FabCarService) GetCarOwner(ctx router.Context, id *CarOwnerId) (*CarOwner, error)

func (*FabCarService) GetCarView

func (f *FabCarService) GetCarView(ctx router.Context, id *CarId) (*CarView, error)

func (*FabCarService) GetMaker

func (f *FabCarService) GetMaker(ctx router.Context, name *MakerName) (*Maker, error)

func (*FabCarService) ListCarDetails

func (f *FabCarService) ListCarDetails(ctx router.Context, id *CarId) (*CarDetails, error)

func (*FabCarService) ListCarOwners

func (f *FabCarService) ListCarOwners(ctx router.Context, id *CarId) (*CarOwners, error)

func (*FabCarService) ListCars

func (f *FabCarService) ListCars(ctx router.Context, _ *emptypb.Empty) (*Cars, error)

func (*FabCarService) ListMakers

func (f *FabCarService) ListMakers(ctx router.Context, _ *emptypb.Empty) (*Makers, error)

func (*FabCarService) UpdateCar

func (f *FabCarService) UpdateCar(ctx router.Context, req *UpdateCarRequest) (*CarView, error)

func (*FabCarService) UpdateCarDetails

func (f *FabCarService) UpdateCarDetails(ctx router.Context, req *UpdateCarDetailsRequest) (*CarDetails, error)

func (*FabCarService) UpdateCarOwners

func (f *FabCarService) UpdateCarOwners(ctx router.Context, req *UpdateCarOwnersRequest) (*CarOwners, error)

type FabCarServiceChaincode

FabCarServiceChaincode chaincode methods interface

type FabCarServiceChaincodeLocalResolver

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

FabCarServiceChaincodeResolver interface for service resolver

func (*FabCarServiceChaincodeLocalResolver) Resolve

type FabCarServiceChaincodeLocatorResolver

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

FabCarServiceChaincodeResolver interface for service resolver

func (*FabCarServiceChaincodeLocatorResolver) Resolve

type FabCarServiceChaincodeResolver

type FabCarServiceChaincodeResolver interface {
	Resolve(ctx cckit_router.Context) (FabCarServiceChaincode, error)
}

FabCarServiceChaincodeResolver interface for service resolver

type FabCarServiceChaincodeStubInvoker

type FabCarServiceChaincodeStubInvoker struct {
	Invoker cckit_gateway.ChaincodeStubInvoker
}

func (*FabCarServiceChaincodeStubInvoker) CreateCar

func (*FabCarServiceChaincodeStubInvoker) CreateMaker

func (*FabCarServiceChaincodeStubInvoker) DeleteCar

func (*FabCarServiceChaincodeStubInvoker) DeleteCarDetail

func (*FabCarServiceChaincodeStubInvoker) DeleteCarOwner

func (*FabCarServiceChaincodeStubInvoker) DeleteMaker

func (*FabCarServiceChaincodeStubInvoker) GetCar

func (*FabCarServiceChaincodeStubInvoker) GetCarDetail

func (*FabCarServiceChaincodeStubInvoker) GetCarOwner

func (*FabCarServiceChaincodeStubInvoker) GetCarView

func (*FabCarServiceChaincodeStubInvoker) GetMaker

func (*FabCarServiceChaincodeStubInvoker) ListCarDetails

func (*FabCarServiceChaincodeStubInvoker) ListCarOwners

func (*FabCarServiceChaincodeStubInvoker) ListCars

func (*FabCarServiceChaincodeStubInvoker) ListMakers

func (*FabCarServiceChaincodeStubInvoker) UpdateCar

func (*FabCarServiceChaincodeStubInvoker) UpdateCarDetails

func (*FabCarServiceChaincodeStubInvoker) UpdateCarOwners

type FabCarServiceClient

type FabCarServiceClient interface {
	CreateMaker(ctx context.Context, in *CreateMakerRequest, opts ...grpc.CallOption) (*Maker, error)
	DeleteMaker(ctx context.Context, in *MakerName, opts ...grpc.CallOption) (*Maker, error)
	GetMaker(ctx context.Context, in *MakerName, opts ...grpc.CallOption) (*Maker, error)
	ListMakers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Makers, error)
	CreateCar(ctx context.Context, in *CreateCarRequest, opts ...grpc.CallOption) (*CarView, error)
	UpdateCar(ctx context.Context, in *UpdateCarRequest, opts ...grpc.CallOption) (*CarView, error)
	DeleteCar(ctx context.Context, in *CarId, opts ...grpc.CallOption) (*CarView, error)
	GetCar(ctx context.Context, in *CarId, opts ...grpc.CallOption) (*Car, error)
	GetCarView(ctx context.Context, in *CarId, opts ...grpc.CallOption) (*CarView, error)
	ListCars(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Cars, error)
	UpdateCarOwners(ctx context.Context, in *UpdateCarOwnersRequest, opts ...grpc.CallOption) (*CarOwners, error)
	DeleteCarOwner(ctx context.Context, in *CarOwnerId, opts ...grpc.CallOption) (*CarOwner, error)
	GetCarOwner(ctx context.Context, in *CarOwnerId, opts ...grpc.CallOption) (*CarOwner, error)
	ListCarOwners(ctx context.Context, in *CarId, opts ...grpc.CallOption) (*CarOwners, error)
	UpdateCarDetails(ctx context.Context, in *UpdateCarDetailsRequest, opts ...grpc.CallOption) (*CarDetails, error)
	DeleteCarDetail(ctx context.Context, in *CarDetailId, opts ...grpc.CallOption) (*CarDetail, error)
	GetCarDetail(ctx context.Context, in *CarDetailId, opts ...grpc.CallOption) (*CarDetail, error)
	ListCarDetails(ctx context.Context, in *CarId, opts ...grpc.CallOption) (*CarDetails, error)
}

FabCarServiceClient is the client API for FabCarService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type FabCarServiceGateway

type FabCarServiceGateway struct {
	ChaincodeInstance cckit_gateway.ChaincodeInstance
}

gateway implementation gateway can be used as kind of SDK, GRPC or REST server ( via grpc-gateway or clay )

func NewFabCarServiceGateway

func NewFabCarServiceGateway(sdk cckit_sdk.SDK, channel, chaincode string, opts ...cckit_gateway.Opt) *FabCarServiceGateway

NewFabCarServiceGateway creates gateway to access chaincode method via chaincode service

func NewFabCarServiceGatewayFromInstance

func NewFabCarServiceGatewayFromInstance(chaincodeInstance cckit_gateway.ChaincodeInstance) *FabCarServiceGateway

func (*FabCarServiceGateway) CreateCar

func (*FabCarServiceGateway) CreateMaker

func (c *FabCarServiceGateway) CreateMaker(ctx context.Context, in *CreateMakerRequest) (*Maker, error)

func (*FabCarServiceGateway) DeleteCar

func (c *FabCarServiceGateway) DeleteCar(ctx context.Context, in *CarId) (*CarView, error)

func (*FabCarServiceGateway) DeleteCarDetail

func (c *FabCarServiceGateway) DeleteCarDetail(ctx context.Context, in *CarDetailId) (*CarDetail, error)

func (*FabCarServiceGateway) DeleteCarOwner

func (c *FabCarServiceGateway) DeleteCarOwner(ctx context.Context, in *CarOwnerId) (*CarOwner, error)

func (*FabCarServiceGateway) DeleteMaker

func (c *FabCarServiceGateway) DeleteMaker(ctx context.Context, in *MakerName) (*Maker, error)

func (*FabCarServiceGateway) GetCar

func (c *FabCarServiceGateway) GetCar(ctx context.Context, in *CarId) (*Car, error)

func (*FabCarServiceGateway) GetCarDetail

func (c *FabCarServiceGateway) GetCarDetail(ctx context.Context, in *CarDetailId) (*CarDetail, error)

func (*FabCarServiceGateway) GetCarOwner

func (c *FabCarServiceGateway) GetCarOwner(ctx context.Context, in *CarOwnerId) (*CarOwner, error)

func (*FabCarServiceGateway) GetCarView

func (c *FabCarServiceGateway) GetCarView(ctx context.Context, in *CarId) (*CarView, error)

func (*FabCarServiceGateway) GetMaker

func (c *FabCarServiceGateway) GetMaker(ctx context.Context, in *MakerName) (*Maker, error)

func (*FabCarServiceGateway) Invoker

func (*FabCarServiceGateway) ListCarDetails

func (c *FabCarServiceGateway) ListCarDetails(ctx context.Context, in *CarId) (*CarDetails, error)

func (*FabCarServiceGateway) ListCarOwners

func (c *FabCarServiceGateway) ListCarOwners(ctx context.Context, in *CarId) (*CarOwners, error)

func (*FabCarServiceGateway) ListCars

func (c *FabCarServiceGateway) ListCars(ctx context.Context, in *emptypb.Empty) (*Cars, error)

func (*FabCarServiceGateway) ListMakers

func (c *FabCarServiceGateway) ListMakers(ctx context.Context, in *emptypb.Empty) (*Makers, error)

func (*FabCarServiceGateway) ServiceDef

ServiceDef returns service definition

func (*FabCarServiceGateway) UpdateCar

func (*FabCarServiceGateway) UpdateCarDetails

func (c *FabCarServiceGateway) UpdateCarDetails(ctx context.Context, in *UpdateCarDetailsRequest) (*CarDetails, error)

func (*FabCarServiceGateway) UpdateCarOwners

func (c *FabCarServiceGateway) UpdateCarOwners(ctx context.Context, in *UpdateCarOwnersRequest) (*CarOwners, error)

type FabCarServiceServer

type FabCarServiceServer interface {
	CreateMaker(context.Context, *CreateMakerRequest) (*Maker, error)
	DeleteMaker(context.Context, *MakerName) (*Maker, error)
	GetMaker(context.Context, *MakerName) (*Maker, error)
	ListMakers(context.Context, *emptypb.Empty) (*Makers, error)
	CreateCar(context.Context, *CreateCarRequest) (*CarView, error)
	UpdateCar(context.Context, *UpdateCarRequest) (*CarView, error)
	DeleteCar(context.Context, *CarId) (*CarView, error)
	GetCar(context.Context, *CarId) (*Car, error)
	GetCarView(context.Context, *CarId) (*CarView, error)
	ListCars(context.Context, *emptypb.Empty) (*Cars, error)
	UpdateCarOwners(context.Context, *UpdateCarOwnersRequest) (*CarOwners, error)
	DeleteCarOwner(context.Context, *CarOwnerId) (*CarOwner, error)
	GetCarOwner(context.Context, *CarOwnerId) (*CarOwner, error)
	ListCarOwners(context.Context, *CarId) (*CarOwners, error)
	UpdateCarDetails(context.Context, *UpdateCarDetailsRequest) (*CarDetails, error)
	DeleteCarDetail(context.Context, *CarDetailId) (*CarDetail, error)
	GetCarDetail(context.Context, *CarDetailId) (*CarDetail, error)
	ListCarDetails(context.Context, *CarId) (*CarDetails, error)
}

FabCarServiceServer is the server API for FabCarService service.

type Maker

type Maker struct {
	Name           string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Country        string `protobuf:"bytes,2,opt,name=country,proto3" json:"country,omitempty"`
	FoundationYear uint64 `protobuf:"varint,3,opt,name=foundation_year,json=foundationYear,proto3" json:"foundation_year,omitempty"`
	// contains filtered or unexported fields
}

func (*Maker) Descriptor deprecated

func (*Maker) Descriptor() ([]byte, []int)

Deprecated: Use Maker.ProtoReflect.Descriptor instead.

func (*Maker) GetCountry

func (x *Maker) GetCountry() string

func (*Maker) GetFoundationYear

func (x *Maker) GetFoundationYear() uint64

func (*Maker) GetName

func (x *Maker) GetName() string

func (*Maker) ProtoMessage

func (*Maker) ProtoMessage()

func (*Maker) ProtoReflect

func (x *Maker) ProtoReflect() protoreflect.Message

func (*Maker) Reset

func (x *Maker) Reset()

func (*Maker) String

func (x *Maker) String() string

func (*Maker) Validate

func (this *Maker) Validate() error

type MakerCreated

type MakerCreated struct {
	Name           string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Country        string `protobuf:"bytes,2,opt,name=country,proto3" json:"country,omitempty"`
	FoundationYear uint64 `protobuf:"varint,3,opt,name=foundation_year,json=foundationYear,proto3" json:"foundation_year,omitempty"`
	// contains filtered or unexported fields
}

Events

func (*MakerCreated) Descriptor deprecated

func (*MakerCreated) Descriptor() ([]byte, []int)

Deprecated: Use MakerCreated.ProtoReflect.Descriptor instead.

func (*MakerCreated) GetCountry

func (x *MakerCreated) GetCountry() string

func (*MakerCreated) GetFoundationYear

func (x *MakerCreated) GetFoundationYear() uint64

func (*MakerCreated) GetName

func (x *MakerCreated) GetName() string

func (*MakerCreated) ProtoMessage

func (*MakerCreated) ProtoMessage()

func (*MakerCreated) ProtoReflect

func (x *MakerCreated) ProtoReflect() protoreflect.Message

func (*MakerCreated) Reset

func (x *MakerCreated) Reset()

func (*MakerCreated) String

func (x *MakerCreated) String() string

func (*MakerCreated) Validate

func (this *MakerCreated) Validate() error

type MakerDeleted

type MakerDeleted struct {
	Name           string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Country        string `protobuf:"bytes,2,opt,name=country,proto3" json:"country,omitempty"`
	FoundationYear uint64 `protobuf:"varint,3,opt,name=foundation_year,json=foundationYear,proto3" json:"foundation_year,omitempty"`
	// contains filtered or unexported fields
}

func (*MakerDeleted) Descriptor deprecated

func (*MakerDeleted) Descriptor() ([]byte, []int)

Deprecated: Use MakerDeleted.ProtoReflect.Descriptor instead.

func (*MakerDeleted) GetCountry

func (x *MakerDeleted) GetCountry() string

func (*MakerDeleted) GetFoundationYear

func (x *MakerDeleted) GetFoundationYear() uint64

func (*MakerDeleted) GetName

func (x *MakerDeleted) GetName() string

func (*MakerDeleted) ProtoMessage

func (*MakerDeleted) ProtoMessage()

func (*MakerDeleted) ProtoReflect

func (x *MakerDeleted) ProtoReflect() protoreflect.Message

func (*MakerDeleted) Reset

func (x *MakerDeleted) Reset()

func (*MakerDeleted) String

func (x *MakerDeleted) String() string

func (*MakerDeleted) Validate

func (this *MakerDeleted) Validate() error

type MakerName

type MakerName struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*MakerName) Descriptor deprecated

func (*MakerName) Descriptor() ([]byte, []int)

Deprecated: Use MakerName.ProtoReflect.Descriptor instead.

func (*MakerName) GetName

func (x *MakerName) GetName() string

func (*MakerName) ProtoMessage

func (*MakerName) ProtoMessage()

func (*MakerName) ProtoReflect

func (x *MakerName) ProtoReflect() protoreflect.Message

func (*MakerName) Reset

func (x *MakerName) Reset()

func (*MakerName) String

func (x *MakerName) String() string

func (*MakerName) Validate

func (this *MakerName) Validate() error

type Makers

type Makers struct {
	Items []*Maker `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*Makers) Descriptor deprecated

func (*Makers) Descriptor() ([]byte, []int)

Deprecated: Use Makers.ProtoReflect.Descriptor instead.

func (*Makers) GetItems

func (x *Makers) GetItems() []*Maker

func (*Makers) ProtoMessage

func (*Makers) ProtoMessage()

func (*Makers) ProtoReflect

func (x *Makers) ProtoReflect() protoreflect.Message

func (*Makers) Reset

func (x *Makers) Reset()

func (*Makers) String

func (x *Makers) String() string

func (*Makers) Validate

func (this *Makers) Validate() error

type Mapper

type Mapper struct {
	// main entry
	Car *Car

	// secondary entities
	Owners  []*CarOwner
	Details []*CarDetail

	State *mapping.EntryMapper
}

func (*Mapper) CreateCar

func (m *Mapper) CreateCar(ctx router.Context, req *CreateCarRequest)

func (*Mapper) SetCar

func (m *Mapper) SetCar(ctx router.Context, req *UpdateCarRequest)

func (*Mapper) SetCarDetails

func (m *Mapper) SetCarDetails(ctx router.Context, reqs []*SetCarDetail)

func (*Mapper) SetCarOwners

func (m *Mapper) SetCarOwners(ctx router.Context, reqs []*SetCarOwner)

func (*Mapper) View

func (m *Mapper) View() *CarView

type SetCarDetail

type SetCarDetail struct {
	Type DetailType `protobuf:"varint,1,opt,name=type,proto3,enum=examples.fabcar.DetailType" json:"type,omitempty"`
	Make string     `protobuf:"bytes,2,opt,name=make,proto3" json:"make,omitempty"`
	// contains filtered or unexported fields
}

func (*SetCarDetail) Descriptor deprecated

func (*SetCarDetail) Descriptor() ([]byte, []int)

Deprecated: Use SetCarDetail.ProtoReflect.Descriptor instead.

func (*SetCarDetail) GetMake

func (x *SetCarDetail) GetMake() string

func (*SetCarDetail) GetType

func (x *SetCarDetail) GetType() DetailType

func (*SetCarDetail) ProtoMessage

func (*SetCarDetail) ProtoMessage()

func (*SetCarDetail) ProtoReflect

func (x *SetCarDetail) ProtoReflect() protoreflect.Message

func (*SetCarDetail) Reset

func (x *SetCarDetail) Reset()

func (*SetCarDetail) String

func (x *SetCarDetail) String() string

func (*SetCarDetail) Validate

func (this *SetCarDetail) Validate() error

type SetCarOwner

type SetCarOwner struct {
	FirstName       string `protobuf:"bytes,1,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
	SecondName      string `protobuf:"bytes,2,opt,name=second_name,json=secondName,proto3" json:"second_name,omitempty"`
	VehiclePassport string `protobuf:"bytes,3,opt,name=vehicle_passport,json=vehiclePassport,proto3" json:"vehicle_passport,omitempty"`
	// contains filtered or unexported fields
}

func (*SetCarOwner) Descriptor deprecated

func (*SetCarOwner) Descriptor() ([]byte, []int)

Deprecated: Use SetCarOwner.ProtoReflect.Descriptor instead.

func (*SetCarOwner) GetFirstName

func (x *SetCarOwner) GetFirstName() string

func (*SetCarOwner) GetSecondName

func (x *SetCarOwner) GetSecondName() string

func (*SetCarOwner) GetVehiclePassport

func (x *SetCarOwner) GetVehiclePassport() string

func (*SetCarOwner) ProtoMessage

func (*SetCarOwner) ProtoMessage()

func (*SetCarOwner) ProtoReflect

func (x *SetCarOwner) ProtoReflect() protoreflect.Message

func (*SetCarOwner) Reset

func (x *SetCarOwner) Reset()

func (*SetCarOwner) String

func (x *SetCarOwner) String() string

func (*SetCarOwner) Validate

func (this *SetCarOwner) Validate() error

type UnimplementedFabCarServiceServer

type UnimplementedFabCarServiceServer struct {
}

UnimplementedFabCarServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedFabCarServiceServer) CreateCar

func (*UnimplementedFabCarServiceServer) CreateMaker

func (*UnimplementedFabCarServiceServer) DeleteCar

func (*UnimplementedFabCarServiceServer) DeleteCarDetail

func (*UnimplementedFabCarServiceServer) DeleteCarOwner

func (*UnimplementedFabCarServiceServer) DeleteMaker

func (*UnimplementedFabCarServiceServer) GetCar

func (*UnimplementedFabCarServiceServer) GetCarDetail

func (*UnimplementedFabCarServiceServer) GetCarOwner

func (*UnimplementedFabCarServiceServer) GetCarView

func (*UnimplementedFabCarServiceServer) GetMaker

func (*UnimplementedFabCarServiceServer) ListCarDetails

func (*UnimplementedFabCarServiceServer) ListCarOwners

func (*UnimplementedFabCarServiceServer) ListCars

func (*UnimplementedFabCarServiceServer) ListMakers

func (*UnimplementedFabCarServiceServer) UpdateCar

func (*UnimplementedFabCarServiceServer) UpdateCarDetails

func (*UnimplementedFabCarServiceServer) UpdateCarOwners

type UpdateCarDetailsRequest

type UpdateCarDetailsRequest struct {
	CarId   []string        `protobuf:"bytes,1,rep,name=car_id,json=carId,proto3" json:"car_id,omitempty"`
	Details []*SetCarDetail `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateCarDetailsRequest) Descriptor deprecated

func (*UpdateCarDetailsRequest) Descriptor() ([]byte, []int)

Deprecated: Use UpdateCarDetailsRequest.ProtoReflect.Descriptor instead.

func (*UpdateCarDetailsRequest) GetCarId

func (x *UpdateCarDetailsRequest) GetCarId() []string

func (*UpdateCarDetailsRequest) GetDetails

func (x *UpdateCarDetailsRequest) GetDetails() []*SetCarDetail

func (*UpdateCarDetailsRequest) ProtoMessage

func (*UpdateCarDetailsRequest) ProtoMessage()

func (*UpdateCarDetailsRequest) ProtoReflect

func (x *UpdateCarDetailsRequest) ProtoReflect() protoreflect.Message

func (*UpdateCarDetailsRequest) Reset

func (x *UpdateCarDetailsRequest) Reset()

func (*UpdateCarDetailsRequest) String

func (x *UpdateCarDetailsRequest) String() string

func (*UpdateCarDetailsRequest) Validate

func (this *UpdateCarDetailsRequest) Validate() error

type UpdateCarOwnersRequest

type UpdateCarOwnersRequest struct {
	CarId  []string       `protobuf:"bytes,1,rep,name=car_id,json=carId,proto3" json:"car_id,omitempty"`
	Owners []*SetCarOwner `protobuf:"bytes,2,rep,name=owners,proto3" json:"owners,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateCarOwnersRequest) Descriptor deprecated

func (*UpdateCarOwnersRequest) Descriptor() ([]byte, []int)

Deprecated: Use UpdateCarOwnersRequest.ProtoReflect.Descriptor instead.

func (*UpdateCarOwnersRequest) GetCarId

func (x *UpdateCarOwnersRequest) GetCarId() []string

func (*UpdateCarOwnersRequest) GetOwners

func (x *UpdateCarOwnersRequest) GetOwners() []*SetCarOwner

func (*UpdateCarOwnersRequest) ProtoMessage

func (*UpdateCarOwnersRequest) ProtoMessage()

func (*UpdateCarOwnersRequest) ProtoReflect

func (x *UpdateCarOwnersRequest) ProtoReflect() protoreflect.Message

func (*UpdateCarOwnersRequest) Reset

func (x *UpdateCarOwnersRequest) Reset()

func (*UpdateCarOwnersRequest) String

func (x *UpdateCarOwnersRequest) String() string

func (*UpdateCarOwnersRequest) Validate

func (this *UpdateCarOwnersRequest) Validate() error

type UpdateCarRequest

type UpdateCarRequest struct {
	Id      []string        `protobuf:"bytes,1,rep,name=id,proto3" json:"id,omitempty"`
	Color   string          `protobuf:"bytes,2,opt,name=color,proto3" json:"color,omitempty"`
	Owners  []*SetCarOwner  `protobuf:"bytes,3,rep,name=owners,proto3" json:"owners,omitempty"`
	Details []*SetCarDetail `protobuf:"bytes,4,rep,name=details,proto3" json:"details,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateCarRequest) Descriptor deprecated

func (*UpdateCarRequest) Descriptor() ([]byte, []int)

Deprecated: Use UpdateCarRequest.ProtoReflect.Descriptor instead.

func (*UpdateCarRequest) GetColor

func (x *UpdateCarRequest) GetColor() string

func (*UpdateCarRequest) GetDetails

func (x *UpdateCarRequest) GetDetails() []*SetCarDetail

func (*UpdateCarRequest) GetId

func (x *UpdateCarRequest) GetId() []string

func (*UpdateCarRequest) GetOwners

func (x *UpdateCarRequest) GetOwners() []*SetCarOwner

func (*UpdateCarRequest) ProtoMessage

func (*UpdateCarRequest) ProtoMessage()

func (*UpdateCarRequest) ProtoReflect

func (x *UpdateCarRequest) ProtoReflect() protoreflect.Message

func (*UpdateCarRequest) Reset

func (x *UpdateCarRequest) Reset()

func (*UpdateCarRequest) String

func (x *UpdateCarRequest) String() string

func (*UpdateCarRequest) Validate

func (this *UpdateCarRequest) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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