-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
591 additions
and
794 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Run SQS Client" type="GoApplicationRunConfiguration" factoryName="Go Application"> | ||
<configuration default="false" name="Run SQS Client" type="GoApplicationRunConfiguration" factoryName="Go Application" editBeforeRun="true"> | ||
<module name="statemachine" /> | ||
<working_directory value="$PROJECT_DIR$" /> | ||
<parameters value="-endpoint http://localhost:4566 -q events -dest 4deabf91-4da3-4813-842b-d01d13d4dfa6 -evt accept" /> | ||
<parameters value="-endpoint http://localhost:4566 -q events -dest 674ab2cf-f8e3-40c2-95d7-1eaa0cec7bf4 -evt sign" /> | ||
<kind value="FILE" /> | ||
<package value="github.com/massenz/go-statemachine/clients" /> | ||
<directory value="$PROJECT_DIR$" /> | ||
<filePath value="$PROJECT_DIR$/clients/sqs_client.go" /> | ||
<filePath value="$PROJECT_DIR$/clients/sqs_client.go|$PROJECT_DIR$/clients/orders.go" /> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,3 @@ | ||
<!-- | ||
~ Copyright (c) 2022 AlertAvert.com. All rights reserved. | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
~ | ||
~ Author: Marco Massenzio ([email protected]) | ||
--> | ||
|
||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Run Server" type="GoApplicationRunConfiguration" factoryName="Go Application"> | ||
<module name="statemachine" /> | ||
|
@@ -28,7 +10,7 @@ | |
<kind value="FILE" /> | ||
<package value="github.com/massenz/go-statemachine/cmd" /> | ||
<directory value="$PROJECT_DIR$" /> | ||
<filePath value="$PROJECT_DIR$/cmd/server.go" /> | ||
<filePath value="$PROJECT_DIR$/cmd/main.go" /> | ||
<method v="2" /> | ||
</configuration> | ||
</component> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,12 @@ | ||
<!-- | ||
~ Copyright (c) 2022 AlertAvert.com. All rights reserved. | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
~ | ||
~ Author: Marco Massenzio ([email protected]) | ||
--> | ||
|
||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Run gRPC Client" type="GoApplicationRunConfiguration" factoryName="Go Application" editBeforeRun="true"> | ||
<module name="statemachine" /> | ||
<working_directory value="$PROJECT_DIR$" /> | ||
<parameters value="-addr :7398 -dest 3 -evt ship" /> | ||
<parameters value="-addr :7398 -dest 674ab2cf-f8e3-40c2-95d7-1eaa0cec7bf4 -evt ship" /> | ||
<kind value="FILE" /> | ||
<package value="github.com/massenz/go-statemachine/clients" /> | ||
<directory value="$PROJECT_DIR$" /> | ||
<filePath value="$PROJECT_DIR$/clients/grpc_client.go" /> | ||
<filePath value="$PROJECT_DIR$/clients/grpc_client.go|$PROJECT_DIR$/clients/orders.go" /> | ||
<method v="2" /> | ||
</configuration> | ||
</component> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Build configuration | ||
|
||
version = 0.5.0 | ||
version = 0.5.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (c) 2022 AlertAvert.com. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* Author: Marco Massenzio ([email protected]) | ||
*/ | ||
|
||
package main | ||
|
||
import ( | ||
"encoding/json" | ||
"time" | ||
) | ||
|
||
type OrderDetails struct { | ||
OrderId string | ||
CustomerId string | ||
OrderDate time.Time | ||
OrderTotal float64 | ||
} | ||
|
||
func NewOrderDetails(orderId, customerId string, orderTotal float64) *OrderDetails { | ||
return &OrderDetails{ | ||
OrderId: orderId, | ||
CustomerId: customerId, | ||
OrderDate: time.Now(), | ||
OrderTotal: orderTotal, | ||
} | ||
} | ||
|
||
func (o *OrderDetails) String() string { | ||
res, error := json.Marshal(o) | ||
if error != nil { | ||
panic(error) | ||
} | ||
return string(res) | ||
} |
Oops, something went wrong.