repo
stringlengths
6
47
file_url
stringlengths
77
269
file_path
stringlengths
5
186
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-07 08:35:43
2026-01-07 08:55:24
truncated
bool
2 classes
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/instance_service_grpc.pb.go
proto/gen/api/v1/instance_service_grpc.pb.go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.0 // - protoc (unknown) // source: api/v1/instance_service.proto package apiv1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/st...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/attachment_service_grpc.pb.go
proto/gen/api/v1/attachment_service_grpc.pb.go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.0 // - protoc (unknown) // source: api/v1/attachment_service.proto package apiv1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/user_service.pb.go
proto/gen/api/v1/user_service.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 // protoc (unknown) // source: api/v1/user_service.proto package apiv1 import ( _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
true
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/memo_service_grpc.pb.go
proto/gen/api/v1/memo_service_grpc.pb.go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.0 // - protoc (unknown) // source: api/v1/memo_service.proto package apiv1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/auth_service_grpc.pb.go
proto/gen/api/v1/auth_service_grpc.pb.go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.0 // - protoc (unknown) // source: api/v1/auth_service.proto package apiv1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/memo_service.pb.gw.go
proto/gen/api/v1/memo_service.pb.gw.go
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. // source: api/v1/memo_service.proto /* Package apiv1 is a reverse proxy. It translates gRPC into RESTful JSON APIs. */ package apiv1 import ( "context" "errors" "io" "net/http" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecos...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
true
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/instance_service.pb.go
proto/gen/api/v1/instance_service.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 // protoc (unknown) // source: api/v1/instance_service.proto package apiv1 import ( _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "go...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
true
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/shortcut_service.pb.go
proto/gen/api/v1/shortcut_service.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 // protoc (unknown) // source: api/v1/shortcut_service.proto package apiv1 import ( _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "go...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/activity_service_grpc.pb.go
proto/gen/api/v1/activity_service_grpc.pb.go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.0 // - protoc (unknown) // source: api/v1/activity_service.proto package apiv1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/st...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/instance_service.pb.gw.go
proto/gen/api/v1/instance_service.pb.gw.go
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. // source: api/v1/instance_service.proto /* Package apiv1 is a reverse proxy. It translates gRPC into RESTful JSON APIs. */ package apiv1 import ( "context" "errors" "io" "net/http" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/common.pb.go
proto/gen/api/v1/common.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 // protoc (unknown) // source: api/v1/common.proto package apiv1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync ...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/memo_service.pb.go
proto/gen/api/v1/memo_service.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 // protoc (unknown) // source: api/v1/memo_service.proto package apiv1 import ( _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
true
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/idp_service.pb.go
proto/gen/api/v1/idp_service.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 // protoc (unknown) // source: api/v1/idp_service.proto package apiv1 import ( _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google....
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/shortcut_service_grpc.pb.go
proto/gen/api/v1/shortcut_service_grpc.pb.go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.0 // - protoc (unknown) // source: api/v1/shortcut_service.proto package apiv1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/st...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/idp_service_grpc.pb.go
proto/gen/api/v1/idp_service_grpc.pb.go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.0 // - protoc (unknown) // source: api/v1/idp_service.proto package apiv1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status"...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/user_service.pb.gw.go
proto/gen/api/v1/user_service.pb.gw.go
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. // source: api/v1/user_service.proto /* Package apiv1 is a reverse proxy. It translates gRPC into RESTful JSON APIs. */ package apiv1 import ( "context" "errors" "io" "net/http" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecos...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
true
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/idp_service.pb.gw.go
proto/gen/api/v1/idp_service.pb.gw.go
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. // source: api/v1/idp_service.proto /* Package apiv1 is a reverse proxy. It translates gRPC into RESTful JSON APIs. */ package apiv1 import ( "context" "errors" "io" "net/http" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosy...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/shortcut_service.pb.gw.go
proto/gen/api/v1/shortcut_service.pb.gw.go
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. // source: api/v1/shortcut_service.proto /* Package apiv1 is a reverse proxy. It translates gRPC into RESTful JSON APIs. */ package apiv1 import ( "context" "errors" "io" "net/http" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/auth_service.pb.go
proto/gen/api/v1/auth_service.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 // protoc (unknown) // source: api/v1/auth_service.proto package apiv1 import ( _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/attachment_service.pb.go
proto/gen/api/v1/attachment_service.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 // protoc (unknown) // source: api/v1/attachment_service.proto package apiv1 import ( _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/attachment_service.pb.gw.go
proto/gen/api/v1/attachment_service.pb.gw.go
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. // source: api/v1/attachment_service.proto /* Package apiv1 is a reverse proxy. It translates gRPC into RESTful JSON APIs. */ package apiv1 import ( "context" "errors" "io" "net/http" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grp...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/user_service_grpc.pb.go
proto/gen/api/v1/user_service_grpc.pb.go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.0 // - protoc (unknown) // source: api/v1/user_service.proto package apiv1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
true
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/activity_service.pb.go
proto/gen/api/v1/activity_service.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 // protoc (unknown) // source: api/v1/activity_service.proto package apiv1 import ( _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "go...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/activity_service.pb.gw.go
proto/gen/api/v1/activity_service.pb.gw.go
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. // source: api/v1/activity_service.proto /* Package apiv1 is a reverse proxy. It translates gRPC into RESTful JSON APIs. */ package apiv1 import ( "context" "errors" "io" "net/http" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/auth_service.pb.gw.go
proto/gen/api/v1/auth_service.pb.gw.go
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. // source: api/v1/auth_service.proto /* Package apiv1 is a reverse proxy. It translates gRPC into RESTful JSON APIs. */ package apiv1 import ( "context" "errors" "io" "net/http" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecos...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/apiv1connect/user_service.connect.go
proto/gen/api/v1/apiv1connect/user_service.connect.go
// Code generated by protoc-gen-connect-go. DO NOT EDIT. // // Source: api/v1/user_service.proto package apiv1connect import ( connect "connectrpc.com/connect" context "context" errors "errors" v1 "github.com/usememos/memos/proto/gen/api/v1" emptypb "google.golang.org/protobuf/types/known/emptypb" http "net/htt...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
true
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/apiv1connect/attachment_service.connect.go
proto/gen/api/v1/apiv1connect/attachment_service.connect.go
// Code generated by protoc-gen-connect-go. DO NOT EDIT. // // Source: api/v1/attachment_service.proto package apiv1connect import ( connect "connectrpc.com/connect" context "context" errors "errors" v1 "github.com/usememos/memos/proto/gen/api/v1" emptypb "google.golang.org/protobuf/types/known/emptypb" http "n...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/apiv1connect/activity_service.connect.go
proto/gen/api/v1/apiv1connect/activity_service.connect.go
// Code generated by protoc-gen-connect-go. DO NOT EDIT. // // Source: api/v1/activity_service.proto package apiv1connect import ( connect "connectrpc.com/connect" context "context" errors "errors" v1 "github.com/usememos/memos/proto/gen/api/v1" http "net/http" strings "strings" ) // This is a compile-time ass...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/apiv1connect/memo_service.connect.go
proto/gen/api/v1/apiv1connect/memo_service.connect.go
// Code generated by protoc-gen-connect-go. DO NOT EDIT. // // Source: api/v1/memo_service.proto package apiv1connect import ( connect "connectrpc.com/connect" context "context" errors "errors" v1 "github.com/usememos/memos/proto/gen/api/v1" emptypb "google.golang.org/protobuf/types/known/emptypb" http "net/htt...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/apiv1connect/idp_service.connect.go
proto/gen/api/v1/apiv1connect/idp_service.connect.go
// Code generated by protoc-gen-connect-go. DO NOT EDIT. // // Source: api/v1/idp_service.proto package apiv1connect import ( connect "connectrpc.com/connect" context "context" errors "errors" v1 "github.com/usememos/memos/proto/gen/api/v1" emptypb "google.golang.org/protobuf/types/known/emptypb" http "net/http...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/apiv1connect/shortcut_service.connect.go
proto/gen/api/v1/apiv1connect/shortcut_service.connect.go
// Code generated by protoc-gen-connect-go. DO NOT EDIT. // // Source: api/v1/shortcut_service.proto package apiv1connect import ( connect "connectrpc.com/connect" context "context" errors "errors" v1 "github.com/usememos/memos/proto/gen/api/v1" emptypb "google.golang.org/protobuf/types/known/emptypb" http "net...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/apiv1connect/auth_service.connect.go
proto/gen/api/v1/apiv1connect/auth_service.connect.go
// Code generated by protoc-gen-connect-go. DO NOT EDIT. // // Source: api/v1/auth_service.proto package apiv1connect import ( connect "connectrpc.com/connect" context "context" errors "errors" v1 "github.com/usememos/memos/proto/gen/api/v1" emptypb "google.golang.org/protobuf/types/known/emptypb" http "net/htt...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/api/v1/apiv1connect/instance_service.connect.go
proto/gen/api/v1/apiv1connect/instance_service.connect.go
// Code generated by protoc-gen-connect-go. DO NOT EDIT. // // Source: api/v1/instance_service.proto package apiv1connect import ( connect "connectrpc.com/connect" context "context" errors "errors" v1 "github.com/usememos/memos/proto/gen/api/v1" http "net/http" strings "strings" ) // This is a compile-time ass...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/user_setting.go
store/user_setting.go
package store import ( "context" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/types/known/timestamppb" storepb "github.com/usememos/memos/proto/gen/store" ) type UserSetting struct { UserID int32 Key storepb.UserSetting_Key Value string } type Find...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/driver.go
store/driver.go
package store import ( "context" "database/sql" ) // Driver is an interface for store driver. // It contains all methods that store database driver should implement. type Driver interface { GetDB() *sql.DB Close() error IsInitialized(ctx context.Context) (bool, error) // Activity model related methods. Creat...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/memo.go
store/memo.go
package store import ( "context" "errors" "github.com/usememos/memos/internal/base" storepb "github.com/usememos/memos/proto/gen/store" ) // Visibility is the type of a visibility. type Visibility string const ( // Public is the PUBLIC visibility. Public Visibility = "PUBLIC" // Protected is the PROTECTED v...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/cache.go
store/cache.go
package store import ( "fmt" ) func getUserSettingCacheKey(userID int32, key string) string { return fmt.Sprintf("%d-%s", userID, key) }
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/inbox.go
store/inbox.go
package store import ( "context" storepb "github.com/usememos/memos/proto/gen/store" ) // InboxStatus represents the status of an inbox notification. type InboxStatus string const ( // UNREAD indicates the notification has not been read by the user. UNREAD InboxStatus = "UNREAD" // ARCHIVED indicates the notif...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/attachment.go
store/attachment.go
package store import ( "context" "log/slog" "os" "path/filepath" "github.com/pkg/errors" "github.com/usememos/memos/internal/base" "github.com/usememos/memos/plugin/storage/s3" storepb "github.com/usememos/memos/proto/gen/store" ) type Attachment struct { // ID is the system generated unique identifier for...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/instance_setting.go
store/instance_setting.go
package store import ( "context" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protojson" storepb "github.com/usememos/memos/proto/gen/store" ) type InstanceSetting struct { Name string Value string Description string } type FindInstanceSetting struct { Name string } type Delet...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/memo_relation.go
store/memo_relation.go
package store import ( "context" ) type MemoRelationType string const ( // MemoRelationReference is the type for a reference memo relation. MemoRelationReference MemoRelationType = "REFERENCE" // MemoRelationComment is the type for a comment memo relation. MemoRelationComment MemoRelationType = "COMMENT" ) typ...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/reaction.go
store/reaction.go
package store import ( "context" ) type Reaction struct { ID int32 CreatedTs int64 CreatorID int32 // ContentID is the id of the content that the reaction is for. ContentID string ReactionType string } type FindReaction struct { ID *int32 CreatorID *int32 ContentID *string Con...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/idp.go
store/idp.go
package store import ( "context" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protojson" storepb "github.com/usememos/memos/proto/gen/store" ) type IdentityProvider struct { ID int32 Name string Type storepb.IdentityProvider_Type IdentifierFilter string ...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/store.go
store/store.go
package store import ( "time" "github.com/usememos/memos/internal/profile" "github.com/usememos/memos/store/cache" ) // Store provides database access to all raw objects. type Store struct { profile *profile.Profile driver Driver // Cache settings cacheConfig cache.Config // Caches instanceSettingCache *...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/migrator.go
store/migrator.go
package store import ( "context" "database/sql" "embed" "fmt" "io/fs" "log/slog" "path/filepath" "sort" "strconv" "strings" "github.com/pkg/errors" "github.com/usememos/memos/internal/version" storepb "github.com/usememos/memos/proto/gen/store" ) // Migration System Overview: // // The migration system...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/user.go
store/user.go
package store import ( "context" ) // Role is the type of a role. type Role string const ( // RoleHost is the HOST role. RoleHost Role = "HOST" // RoleAdmin is the ADMIN role. RoleAdmin Role = "ADMIN" // RoleUser is the USER role. RoleUser Role = "USER" ) func (e Role) String() string { switch e { case Rol...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/activity.go
store/activity.go
package store import ( "context" storepb "github.com/usememos/memos/proto/gen/store" ) type ActivityType string const ( ActivityTypeMemoComment ActivityType = "MEMO_COMMENT" ) func (t ActivityType) String() string { return string(t) } type ActivityLevel string const ( ActivityLevelInfo ActivityLevel = "INFO...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/common.go
store/common.go
package store import "google.golang.org/protobuf/encoding/protojson" var ( protojsonUnmarshaler = protojson.UnmarshalOptions{ AllowPartial: true, DiscardUnknown: true, } ) // RowStatus is the status for a row. type RowStatus string const ( // Normal is the status for a normal row. Normal RowStatus = "NORM...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/cache/cache.go
store/cache/cache.go
package cache import ( "context" "sync" "sync/atomic" "time" ) // Interface defines the operations a cache must support. type Interface interface { // Set adds a value to the cache with the default TTL. Set(ctx context.Context, key string, value any) // SetWithTTL adds a value to the cache with a custom TTL. ...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/cache/cache_test.go
store/cache/cache_test.go
package cache import ( "context" "fmt" "sync" "testing" "time" ) func TestCacheBasicOperations(t *testing.T) { ctx := context.Background() config := DefaultConfig() config.DefaultTTL = 100 * time.Millisecond config.CleanupInterval = 50 * time.Millisecond cache := New(config) defer cache.Close() // Test S...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/db.go
store/db/db.go
package db import ( "github.com/pkg/errors" "github.com/usememos/memos/internal/profile" "github.com/usememos/memos/store" "github.com/usememos/memos/store/db/mysql" "github.com/usememos/memos/store/db/postgres" "github.com/usememos/memos/store/db/sqlite" ) // NewDBDriver creates new db driver based on profile...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/postgres/user_setting.go
store/db/postgres/user_setting.go
package postgres import ( "context" "strings" "github.com/pkg/errors" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func (d *DB) UpsertUserSetting(ctx context.Context, upsert *store.UserSetting) (*store.UserSetting, error) { stmt := ` INSERT INTO user_setting ( u...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/postgres/memo.go
store/db/postgres/memo.go
package postgres import ( "context" "fmt" "strings" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protojson" "github.com/usememos/memos/plugin/filter" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func (d *DB) CreateMemo(ctx context.Context, create *s...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/postgres/postgres.go
store/db/postgres/postgres.go
package postgres import ( "context" "database/sql" "log" // Import the PostgreSQL driver. _ "github.com/lib/pq" "github.com/pkg/errors" "github.com/usememos/memos/internal/profile" "github.com/usememos/memos/store" ) type DB struct { db *sql.DB profile *profile.Profile } func NewDB(profile *profile....
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/postgres/memo_filter_test.go
store/db/postgres/memo_filter_test.go
package postgres import ( "context" "testing" "time" "github.com/stretchr/testify/require" "github.com/usememos/memos/plugin/filter" ) func TestConvertExprToSQL(t *testing.T) { tests := []struct { filter string want string args []any }{ { filter: `tag in ["tag1", "tag2"]`, want: "((memo.p...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/postgres/inbox.go
store/db/postgres/inbox.go
package postgres import ( "context" "fmt" "strings" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protojson" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func (d *DB) CreateInbox(ctx context.Context, create *store.Inbox) (*store.Inbox, error) { messa...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/postgres/attachment.go
store/db/postgres/attachment.go
package postgres import ( "context" "database/sql" "fmt" "strings" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protojson" "github.com/usememos/memos/plugin/filter" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func (d *DB) CreateAttachment(ctx cont...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/postgres/instance_setting.go
store/db/postgres/instance_setting.go
package postgres import ( "context" "strings" "github.com/usememos/memos/store" ) func (d *DB) UpsertInstanceSetting(ctx context.Context, upsert *store.InstanceSetting) (*store.InstanceSetting, error) { stmt := ` INSERT INTO instance_setting ( name, value, description ) VALUES ($1, $2, $3) ON CONFLICT...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/postgres/memo_relation.go
store/db/postgres/memo_relation.go
package postgres import ( "context" "fmt" "strings" "github.com/usememos/memos/plugin/filter" "github.com/usememos/memos/store" ) func (d *DB) UpsertMemoRelation(ctx context.Context, create *store.MemoRelation) (*store.MemoRelation, error) { stmt := ` INSERT INTO memo_relation ( memo_id, related_memo_i...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/postgres/reaction.go
store/db/postgres/reaction.go
package postgres import ( "context" "strings" "github.com/usememos/memos/store" ) func (d *DB) UpsertReaction(ctx context.Context, upsert *store.Reaction) (*store.Reaction, error) { fields := []string{"creator_id", "content_id", "reaction_type"} args := []interface{}{upsert.CreatorID, upsert.ContentID, upsert.R...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/postgres/idp.go
store/db/postgres/idp.go
package postgres import ( "context" "strings" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func (d *DB) CreateIdentityProvider(ctx context.Context, create *store.IdentityProvider) (*store.IdentityProvider, error) { fields := []string{"name", "type", "identifier_filter"...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/postgres/user.go
store/db/postgres/user.go
package postgres import ( "context" "fmt" "strings" "github.com/pkg/errors" "github.com/usememos/memos/store" ) func (d *DB) CreateUser(ctx context.Context, create *store.User) (*store.User, error) { fields := []string{"username", "role", "email", "nickname", "password_hash", "avatar_url"} args := []any{crea...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/postgres/activity.go
store/db/postgres/activity.go
package postgres import ( "context" "strings" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protojson" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func (d *DB) CreateActivity(ctx context.Context, create *store.Activity) (*store.Activity, error) { pay...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/postgres/common.go
store/db/postgres/common.go
package postgres import ( "fmt" "strings" "google.golang.org/protobuf/encoding/protojson" ) var ( protojsonUnmarshaler = protojson.UnmarshalOptions{ DiscardUnknown: true, } ) func placeholder(n int) string { return "$" + fmt.Sprint(n) } func placeholders(n int) string { list := []string{} for i := 0; i <...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/sqlite/user_setting.go
store/db/sqlite/user_setting.go
package sqlite import ( "context" "strings" "github.com/pkg/errors" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func (d *DB) UpsertUserSetting(ctx context.Context, upsert *store.UserSetting) (*store.UserSetting, error) { stmt := ` INSERT INTO user_setting ( use...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/sqlite/memo.go
store/db/sqlite/memo.go
package sqlite import ( "context" "fmt" "strings" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protojson" "github.com/usememos/memos/plugin/filter" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func (d *DB) CreateMemo(ctx context.Context, create *sto...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/sqlite/memo_filter_test.go
store/db/sqlite/memo_filter_test.go
package sqlite import ( "context" "testing" "time" "github.com/stretchr/testify/require" "github.com/usememos/memos/plugin/filter" ) func TestConvertExprToSQL(t *testing.T) { tests := []struct { filter string want string args []any }{ { filter: `tag in ["tag1", "tag2"]`, want: "((JSON_EXT...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/sqlite/inbox.go
store/db/sqlite/inbox.go
package sqlite import ( "context" "fmt" "strings" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protojson" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func (d *DB) CreateInbox(ctx context.Context, create *store.Inbox) (*store.Inbox, error) { message...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/sqlite/attachment.go
store/db/sqlite/attachment.go
package sqlite import ( "context" "database/sql" "fmt" "strings" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protojson" "github.com/usememos/memos/plugin/filter" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func (d *DB) CreateAttachment(ctx contex...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/sqlite/instance_setting.go
store/db/sqlite/instance_setting.go
package sqlite import ( "context" "strings" "github.com/usememos/memos/store" ) func (d *DB) UpsertInstanceSetting(ctx context.Context, upsert *store.InstanceSetting) (*store.InstanceSetting, error) { stmt := ` INSERT INTO instance_setting ( name, value, description ) VALUES (?, ?, ?) ON CONFLICT(name...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/sqlite/memo_relation.go
store/db/sqlite/memo_relation.go
package sqlite import ( "context" "fmt" "strings" "github.com/usememos/memos/plugin/filter" "github.com/usememos/memos/store" ) func (d *DB) UpsertMemoRelation(ctx context.Context, create *store.MemoRelation) (*store.MemoRelation, error) { stmt := ` INSERT INTO memo_relation ( memo_id, related_memo_id,...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/sqlite/reaction.go
store/db/sqlite/reaction.go
package sqlite import ( "context" "database/sql" "errors" "strings" "github.com/usememos/memos/store" ) func (d *DB) UpsertReaction(ctx context.Context, upsert *store.Reaction) (*store.Reaction, error) { fields := []string{"`creator_id`", "`content_id`", "`reaction_type`"} placeholder := []string{"?", "?", "?...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/sqlite/idp.go
store/db/sqlite/idp.go
package sqlite import ( "context" "fmt" "strings" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func (d *DB) CreateIdentityProvider(ctx context.Context, create *store.IdentityProvider) (*store.IdentityProvider, error) { placeholders := []string{"?", "?", "?", "?"} fie...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/sqlite/sqlite.go
store/db/sqlite/sqlite.go
package sqlite import ( "context" "database/sql" "github.com/pkg/errors" // Import the SQLite driver. _ "modernc.org/sqlite" "github.com/usememos/memos/internal/profile" "github.com/usememos/memos/store" ) type DB struct { db *sql.DB profile *profile.Profile } // NewDB opens a database specified by ...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/sqlite/user.go
store/db/sqlite/user.go
package sqlite import ( "context" "fmt" "strings" "github.com/pkg/errors" "github.com/usememos/memos/store" ) func (d *DB) CreateUser(ctx context.Context, create *store.User) (*store.User, error) { fields := []string{"`username`", "`role`", "`email`", "`nickname`", "`password_hash`, `avatar_url`"} placeholde...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/sqlite/activity.go
store/db/sqlite/activity.go
package sqlite import ( "context" "strings" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protojson" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func (d *DB) CreateActivity(ctx context.Context, create *store.Activity) (*store.Activity, error) { paylo...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/sqlite/common.go
store/db/sqlite/common.go
package sqlite import "google.golang.org/protobuf/encoding/protojson" var ( protojsonUnmarshaler = protojson.UnmarshalOptions{ DiscardUnknown: true, } )
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/mysql/user_setting.go
store/db/mysql/user_setting.go
package mysql import ( "context" "strings" "github.com/pkg/errors" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func (d *DB) UpsertUserSetting(ctx context.Context, upsert *store.UserSetting) (*store.UserSetting, error) { stmt := "INSERT INTO `user_setting` (`user_id`...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/mysql/mysql.go
store/db/mysql/mysql.go
package mysql import ( "context" "database/sql" "github.com/go-sql-driver/mysql" "github.com/pkg/errors" "github.com/usememos/memos/internal/profile" "github.com/usememos/memos/store" ) type DB struct { db *sql.DB profile *profile.Profile config *mysql.Config } func NewDB(profile *profile.Profile) (...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/mysql/memo.go
store/db/mysql/memo.go
package mysql import ( "context" "fmt" "strings" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protojson" "github.com/usememos/memos/plugin/filter" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func (d *DB) CreateMemo(ctx context.Context, create *stor...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/mysql/memo_filter_test.go
store/db/mysql/memo_filter_test.go
package mysql import ( "context" "testing" "time" "github.com/stretchr/testify/require" "github.com/usememos/memos/plugin/filter" ) func TestConvertExprToSQL(t *testing.T) { tests := []struct { filter string want string args []any }{ { filter: `tag in ["tag1", "tag2"]`, want: "((JSON_CONT...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/mysql/inbox.go
store/db/mysql/inbox.go
package mysql import ( "context" "fmt" "strings" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protojson" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func (d *DB) CreateInbox(ctx context.Context, create *store.Inbox) (*store.Inbox, error) { messageS...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/mysql/attachment.go
store/db/mysql/attachment.go
package mysql import ( "context" "database/sql" "fmt" "strings" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protojson" "github.com/usememos/memos/plugin/filter" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func (d *DB) CreateAttachment(ctx context...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/mysql/instance_setting.go
store/db/mysql/instance_setting.go
package mysql import ( "context" "strings" "github.com/usememos/memos/store" ) func (d *DB) UpsertInstanceSetting(ctx context.Context, upsert *store.InstanceSetting) (*store.InstanceSetting, error) { stmt := "INSERT INTO `instance_setting` (`name`, `value`, `description`) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/mysql/memo_relation.go
store/db/mysql/memo_relation.go
package mysql import ( "context" "fmt" "strings" "github.com/usememos/memos/plugin/filter" "github.com/usememos/memos/store" ) func (d *DB) UpsertMemoRelation(ctx context.Context, create *store.MemoRelation) (*store.MemoRelation, error) { stmt := "INSERT INTO `memo_relation` (`memo_id`, `related_memo_id`, `typ...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/mysql/reaction.go
store/db/mysql/reaction.go
package mysql import ( "context" "strings" "github.com/pkg/errors" "github.com/usememos/memos/store" ) func (d *DB) UpsertReaction(ctx context.Context, upsert *store.Reaction) (*store.Reaction, error) { fields := []string{"`creator_id`", "`content_id`", "`reaction_type`"} placeholder := []string{"?", "?", "?"...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/mysql/idp.go
store/db/mysql/idp.go
package mysql import ( "context" "strings" "github.com/pkg/errors" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func (d *DB) CreateIdentityProvider(ctx context.Context, create *store.IdentityProvider) (*store.IdentityProvider, error) { placeholders := []string{"?", "...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/mysql/user.go
store/db/mysql/user.go
package mysql import ( "context" "fmt" "strings" "github.com/pkg/errors" "github.com/usememos/memos/store" ) func (d *DB) CreateUser(ctx context.Context, create *store.User) (*store.User, error) { fields := []string{"`username`", "`role`", "`email`", "`nickname`", "`password_hash`", "`avatar_url`"} placehold...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/mysql/activity.go
store/db/mysql/activity.go
package mysql import ( "context" "strings" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protojson" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func (d *DB) CreateActivity(ctx context.Context, create *store.Activity) (*store.Activity, error) { payloa...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/db/mysql/common.go
store/db/mysql/common.go
package mysql import "google.golang.org/protobuf/encoding/protojson" var ( protojsonUnmarshaler = protojson.UnmarshalOptions{ AllowPartial: true, DiscardUnknown: true, } )
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/test/memo_test.go
store/test/memo_test.go
package test import ( "context" "fmt" "testing" "github.com/stretchr/testify/require" "github.com/usememos/memos/store" storepb "github.com/usememos/memos/proto/gen/store" ) func TestMemoStore(t *testing.T) { ctx := context.Background() ts := NewTestingStore(ctx, t) user, err := createTestingHostUser(ctx,...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/test/user_setting_test.go
store/test/user_setting_test.go
package test import ( "context" "testing" "github.com/stretchr/testify/require" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func TestUserSettingStore(t *testing.T) { ctx := context.Background() ts := NewTestingStore(ctx, t) user, err := createTestingHostUser(ctx, ...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/test/reaction_test.go
store/test/reaction_test.go
package test import ( "context" "testing" "github.com/stretchr/testify/require" "github.com/usememos/memos/store" ) func TestReactionStore(t *testing.T) { ctx := context.Background() ts := NewTestingStore(ctx, t) user, err := createTestingHostUser(ctx, ts) require.NoError(t, err) contentID := "test_conte...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/test/memo_filter_test.go
store/test/memo_filter_test.go
package test import ( "testing" "time" "github.com/stretchr/testify/require" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) // ============================================================================= // Content Field Tests // Schema: content (string, supports conta...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/test/attachment_test.go
store/test/attachment_test.go
package test import ( "context" "fmt" "testing" "github.com/lithammer/shortuuid/v4" "github.com/stretchr/testify/require" "github.com/usememos/memos/store" ) func TestAttachmentStore(t *testing.T) { ctx := context.Background() ts := NewTestingStore(ctx, t) _, err := ts.CreateAttachment(ctx, &store.Attachme...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/test/inbox_test.go
store/test/inbox_test.go
package test import ( "context" "testing" "github.com/stretchr/testify/require" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func TestInboxStore(t *testing.T) { ctx := context.Background() ts := NewTestingStore(ctx, t) user, err := createTestingHostUser(ctx, ts) r...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/test/memo_relation_test.go
store/test/memo_relation_test.go
package test import ( "context" "testing" "github.com/stretchr/testify/require" "github.com/usememos/memos/store" ) func TestMemoRelationStore(t *testing.T) { ctx := context.Background() ts := NewTestingStore(ctx, t) user, err := createTestingHostUser(ctx, ts) require.NoError(t, err) memoCreate := &store.M...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/test/main_test.go
store/test/main_test.go
package test import ( "fmt" "os" "os/exec" "path/filepath" "runtime" "testing" ) func TestMain(m *testing.M) { // If DRIVER is set, run tests for that driver only if os.Getenv("DRIVER") != "" { defer TerminateContainers() m.Run() return } // No DRIVER set - run tests for all drivers sequentially run...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/test/activity_test.go
store/test/activity_test.go
package test import ( "context" "testing" "github.com/stretchr/testify/require" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) func TestActivityStore(t *testing.T) { ctx := context.Background() ts := NewTestingStore(ctx, t) user, err := createTestingHostUser(ctx, ts)...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false
usememos/memos
https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/store/test/migrator_test.go
store/test/migrator_test.go
package test import ( "context" "testing" "github.com/stretchr/testify/require" ) func TestGetCurrentSchemaVersion(t *testing.T) { ctx := context.Background() ts := NewTestingStore(ctx, t) currentSchemaVersion, err := ts.GetCurrentSchemaVersion() require.NoError(t, err) require.Equal(t, "0.26.2", currentSch...
go
MIT
e75862de31b65f90007d771fd623e1d23261b2c6
2026-01-07T08:35:43.552360Z
false