Skip to content

Instantly share code, notes, and snippets.

View zzerjae's full-sized avatar
🤖
fun coding

Marco Jaeho Cho zzerjae

🤖
fun coding
View GitHub Profile
package worker
...
type DB interface {
FindMatchedUsers(title string, regionIdsByRange [][]int64) ([][]model.Matched, error)
}
...
package model
type Matched struct {
...
}
package worker
...
type Matched struct {
...
}
...
package worker
type mockRegionService struct{}
func (m *mockRegionService) GetRegionIdsByRange(_ int64, publishRange int) ([]int64, error) {
switch publishRange {
case 1:
return []int64{1234, 1235, 1236}, nil
case 2:
return []int64{1234, 1235, 1236, 1300, 1301, 1302}, nil
package worker
func TestWorker_listRegionIdsByPublishRange(t *testing.T) {
type fields struct {
RegionSvc RegionService
NotificationSvc NotificationService
UserSvc UserService
DB DB
}
type args struct {
package worker
type NewArticleEvent struct {
RegionId int64
PublishRange int
WriterId int64
ArticleId int64
Title string
}
package worker
type NewArticleEvent struct {
RegionId int64
PublishRange int
WriterId int64
ArticleId int64
Title string
}
package worker
type NewArticleEvent struct {
RegionId int64
PublishRange int
WriterId int64
ArticleId int64
Title string
}
package main
type User struct {
id int64
name string
}
type DB interface {
GetUser(id int64) (*User, error)
}
@zzerjae
zzerjae / index.js
Last active March 9, 2021 11:51
sample code - Resizing Images with Amazon CloudFront & Lambda@Edge
'use strict';
const querystring = require('querystring');
const aws = require('aws-sdk');
const s3 = new aws.S3({
region: 'ap-northeast-2',
signatureVersion: 'v4'
});
const sharp = require('sharp');