This file contains hidden or 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 main | |
| import ( | |
| "context" | |
| "io/ioutil" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/signal" | |
| "syscall" |
This file contains hidden or 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 testutils | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "io/ioutil" | |
| "path" | |
| "path/filepath" | |
| "runtime" | |
| "testing" |
This file contains hidden or 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 library | |
| import "time" | |
| var fakeTime time.Time | |
| func SetFakeTime(t time.Time) { | |
| fakeTime = t | |
| } |
This file contains hidden or 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 DatastoreWithContext(ctx context.Context) context.Context { | |
| ds, err := aedatastore.FromContext(ctx) | |
| if err != nil { | |
| panic(err) | |
| } | |
| ds.AppendMiddleware(localcache.New( | |
| localcache.WithLogger(func(ctx context.Context, format string, args ...interface{}) { | |
| fmt.Println(fmt.Sprintf(format, args...)) | |
| }), |
This file contains hidden or 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 (repo videoRepository) getVideosByPublishedAt(ctx context.Context, so *entity.SearchOptions) ([]*entity.Video, string, error) { | |
| g, err := infrastructure.BoomFromContext(ctx) | |
| if err != nil { | |
| return nil, "", err | |
| } | |
| query := g.Client.NewQuery("Video").Filter("Enabled = ", true).Limit(so.Paging.Limit).Order("-PublishedAt").KeysOnly() | |
| if so.Paging.Cursor != "" { | |
| cursor, err := g.DecodeCursor(so.Paging.Cursor) | |
| if err != nil { | |
| return nil, "", err |
This file contains hidden or 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 (repo videoRepository) getVideosByPublishedAt(ctx context.Context, so *entity.SearchOptions) ([]*entity.Video, string, error) { | |
| var vs []*entity.Video | |
| g, err := infrastructure.BoomFromContext(ctx) | |
| if err != nil { | |
| return nil, "", err | |
| } | |
| query := g.Client.NewQuery("Video").Filter("Enabled = ", true).Limit(so.Paging.Limit).Order("-PublishedAt") | |
| if so.Paging.Cursor != "" { | |
| cursor, err := g.DecodeCursor(so.Paging.Cursor) | |
| if err != nil { |
This file contains hidden or 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 main | |
| import ( | |
| "bytes" | |
| "os" | |
| "time" | |
| vegeta "github.com/tsenart/vegeta/lib" | |
| ) |
This file contains hidden or 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
| // StartStatusSubscription ... ライブ動画の放送状況の監視 | |
| func (s *liveProgramService) StartStatusSubscription(ctx context.Context) { | |
| s.subLock.Do(func() { | |
| sub, err := s.sub.GetSubscriber() | |
| if err != nil { | |
| panic(err) | |
| } | |
| go func(sub *redis.PubSub) { | |
| defer sub.Close() | |
| for { |
This file contains hidden or 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
| files="./*.mp4" | |
| for filepath in $files; do | |
| fname_ext="${filepath##*/}" | |
| fname="${fname_ext%.*}" | |
| echo $fname | |
| ffmpeg -i "${fname}.mp4" -vcodec h264 -acodec aac "${fname}_comp.mp4" | |
| done |
This file contains hidden or 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 main | |
| import ( | |
| "fmt" | |
| ) | |
| type Language struct { | |
| ID int | |
| Code string | |
| } |
NewerOlder