View company_fetch.go
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
func (d *DynamoDBCompanyRepository) GetCompanies(ctx context.Context, companyIds []string) ([]models.Company, error) { | |
var keys []map[string]*dynamodb.AttributeValue | |
for _, c := range companyIds { | |
key := models.GetCompanyKey(c) | |
m := map[string]*dynamodb.AttributeValue{ | |
"PK": { | |
S: aws.String(key), | |
}, | |
"SK": { |
View aws_sns_cli.sh
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
# List topics | |
aws sns list-topics | |
# Create topic | |
aws sns create-topic --name test-topic | |
# Subscribe | |
aws sns subscribe --topic-arn arn:aws:sns:us-west-2:123456789012:the-topic --protocol sqs --notification-endpoint http://some-queu-url | |
# List subscriptions | |
aws sns list-subscriptions | |
# Post a message to a Topic | |
aws sns publish --topic-arn arn:aws:sns:us-west-2:123456789012:topic --message "{\"event\":{\"type\":\"TeamUpdate\",\"id\":1,\"name\":\"New Team Name\"}}" |
View user_role.go
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
type UserRole struct { | |
EntityType string `dynamodbav:"EntityType"` | |
Roles []Role `dynamodbav:"Roles"` | |
} | |
type Role struct { | |
Id int | |
Name string | |
} |
View user_role.json
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
{ | |
"Roles": { | |
"1": { | |
"name": "Role number 1", | |
"id": 1 | |
}, | |
"2": { | |
"name": "Role number 2", | |
"id": 2 | |
} |
View logstash-tcp.conf
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
input { | |
tcp { | |
port => "5000" | |
codec => json_lines | |
} | |
} | |
output { | |
stdout {} | |
} |
View logback-tcp.xml
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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | |
<layout class="ch.qos.logback.classic.PatternLayout"> | |
<Pattern> | |
%green(%d{yyyy-MM-dd HH:mm:ss}) %magenta([%thread]) %blue(%-5level) %yellow(%logger{36}) - %msg%n | |
</Pattern> | |
</layout> | |
</appender> |
View logging-example.java
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
package com.logging-example | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.web.bind.annotation.*; | |
@RestController | |
@RequestMapping("/logging-example") |