v2

package
v0.20.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPageSize  = 10
	MaxContentLength = 8 * 1024
	ChunkSize        = 64 * 1024 // 64 KiB
)
View Source
const (
	WorkspaceSettingNamePrefix = "settings/"
	UserNamePrefix             = "users/"
	InboxNamePrefix            = "inboxes/"
)

Variables

View Source
var ListMemosFilterCELAttributes = []cel.EnvOption{
	cel.Variable("content_search", cel.ListType(cel.StringType)),
	cel.Variable("visibilities", cel.ListType(cel.StringType)),
	cel.Variable("order_by_pinned", cel.BoolType),
	cel.Variable("display_time_before", cel.IntType),
	cel.Variable("display_time_after", cel.IntType),
	cel.Variable("creator", cel.StringType),
	cel.Variable("row_status", cel.StringType),
}

ListMemosFilterCELAttributes are the CEL attributes for ListMemosFilter.

Functions

func ExtractInboxIDFromName

func ExtractInboxIDFromName(name string) (int32, error)

ExtractInboxIDFromName returns the inbox ID from a resource name.

func ExtractUsernameFromName

func ExtractUsernameFromName(name string) (string, error)

ExtractUsernameFromName returns the username from a resource name.

func ExtractWorkspaceSettingKeyFromName

func ExtractWorkspaceSettingKeyFromName(name string) (string, error)

func GetNameParentTokens

func GetNameParentTokens(name string, tokenPrefixes ...string) ([]string, error)

GetNameParentTokens returns the tokens from a resource name.

Types

type APIV2Service

func NewAPIV2Service

func NewAPIV2Service(secret string, profile *profile.Profile, store *store.Store, grpcServerPort int) *APIV2Service

func (*APIV2Service) BatchUpsertTag

func (*APIV2Service) CreateMemo

func (*APIV2Service) CreateMemoComment

func (*APIV2Service) CreateResource

func (*APIV2Service) CreateUser

func (*APIV2Service) CreateWebhook

func (*APIV2Service) DeleteInbox

func (*APIV2Service) DeleteMemo

func (*APIV2Service) DeleteMemoReaction

func (*APIV2Service) DeleteResource

func (*APIV2Service) DeleteTag

func (*APIV2Service) DeleteUser

func (*APIV2Service) DeleteWebhook

func (*APIV2Service) DispatchMemoCreatedWebhook

func (s *APIV2Service) DispatchMemoCreatedWebhook(ctx context.Context, memo *apiv2pb.Memo) error

DispatchMemoCreatedWebhook dispatches webhook when memo is created.

func (*APIV2Service) DispatchMemoDeletedWebhook

func (s *APIV2Service) DispatchMemoDeletedWebhook(ctx context.Context, memo *apiv2pb.Memo) error

DispatchMemoDeletedWebhook dispatches webhook when memo is deleted.

func (*APIV2Service) DispatchMemoUpdatedWebhook

func (s *APIV2Service) DispatchMemoUpdatedWebhook(ctx context.Context, memo *apiv2pb.Memo) error

DispatchMemoUpdatedWebhook dispatches webhook when memo is updated.

func (*APIV2Service) ExportMemos

func (*APIV2Service) GetActivity

func (*APIV2Service) GetAuthStatus

func (*APIV2Service) GetGRPCServer

func (s *APIV2Service) GetGRPCServer() *grpc.Server

func (*APIV2Service) GetMemo

func (*APIV2Service) GetMemoByName

func (*APIV2Service) GetResource

func (*APIV2Service) GetResourceByName

func (*APIV2Service) GetTagSuggestions

func (*APIV2Service) GetUser

func (*APIV2Service) GetUserMemosStats

func (*APIV2Service) GetUserSetting

func (*APIV2Service) GetWebhook

func (*APIV2Service) GetWorkspaceSetting

func (*APIV2Service) ListInboxes

func (*APIV2Service) ListMemoComments

func (*APIV2Service) ListMemoReactions

func (*APIV2Service) ListMemoRelations

func (*APIV2Service) ListMemoResources

func (*APIV2Service) ListMemos

func (*APIV2Service) ListResources

func (*APIV2Service) ListTags

func (*APIV2Service) ListUserAccessTokens

func (*APIV2Service) ListUsers

func (*APIV2Service) ListWebhooks

func (*APIV2Service) RegisterGateway

func (s *APIV2Service) RegisterGateway(ctx context.Context, e *echo.Echo) error

RegisterGateway registers the gRPC-Gateway with the given Echo instance.

func (*APIV2Service) RenameTag

func (*APIV2Service) SetMemoRelations

func (*APIV2Service) SetMemoResources

func (*APIV2Service) SetWorkspaceSetting

func (*APIV2Service) SignIn

func (*APIV2Service) SignInWithSSO

func (*APIV2Service) SignOut

func (*APIV2Service) SignUp

func (*APIV2Service) UpdateInbox

func (*APIV2Service) UpdateMemo

func (*APIV2Service) UpdateResource

func (*APIV2Service) UpdateUser

func (*APIV2Service) UpdateUserSetting

func (*APIV2Service) UpdateWebhook

func (*APIV2Service) UpsertAccessTokenToStore

func (s *APIV2Service) UpsertAccessTokenToStore(ctx context.Context, user *store.User, accessToken, description string) error

func (*APIV2Service) UpsertMemoReaction

func (*APIV2Service) UpsertTag

type ContextKey

type ContextKey int

ContextKey is the key type of context value.

type GRPCAuthInterceptor

type GRPCAuthInterceptor struct {
	Store *store.Store
	// contains filtered or unexported fields
}

GRPCAuthInterceptor is the auth interceptor for gRPC server.

func NewGRPCAuthInterceptor

func NewGRPCAuthInterceptor(store *store.Store, secret string) *GRPCAuthInterceptor

NewGRPCAuthInterceptor returns a new API auth interceptor.

func (*GRPCAuthInterceptor) AuthenticationInterceptor

func (in *GRPCAuthInterceptor) AuthenticationInterceptor(ctx context.Context, request any, serverInfo *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error)

AuthenticationInterceptor is the unary interceptor for gRPC API.

type ListMemosFilter

type ListMemosFilter struct {
	ContentSearch     []string
	Visibilities      []store.Visibility
	OrderByPinned     bool
	DisplayTimeBefore *int64
	DisplayTimeAfter  *int64
	Creator           *string
	RowStatus         *store.RowStatus
}

type LoggerInterceptor

type LoggerInterceptor struct {
}

func NewLoggerInterceptor

func NewLoggerInterceptor() *LoggerInterceptor

func (*LoggerInterceptor) LoggerInterceptor

func (in *LoggerInterceptor) LoggerInterceptor(ctx context.Context, request any, serverInfo *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL