store

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: MIT Imports: 4 Imported by: 8

README

Protocol Documentation

Table of Contents

Top

store/common.proto

Top

store/system_setting.proto

BackupConfig
Field Type Label Description
enabled bool enabled indicates whether backup is enabled.
cron string cron is the cron expression for backup. See https://godoc.org/github.com/robfig/cron#hdr-CRON_Expression_Format
max_keep int32 max_keep is the maximum number of backups to keep.

SystemSettingKey
Name Number Description
SYSTEM_SETTING_KEY_UNSPECIFIED 0
BACKUP_CONFIG 1 BackupConfig is the key for auto-backup configuration.

Top

store/user_setting.proto

AccessTokensUserSetting
Field Type Label Description
access_tokens AccessTokensUserSetting.AccessToken repeated

AccessTokensUserSetting.AccessToken
Field Type Label Description
access_token string The access token is a JWT token. Including expiration time, issuer, etc.
description string A description for the access token.

UserSetting
Field Type Label Description
user_id int32
key UserSettingKey
access_tokens AccessTokensUserSetting

UserSettingKey
Name Number Description
USER_SETTING_KEY_UNSPECIFIED 0
USER_SETTING_ACCESS_TOKENS 1 Access tokens for the user.

Scalar Value Types

.proto Type Notes C++ Java Python Go C# PHP Ruby
double double double float float64 double float Float
float float float float float32 float float Float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int int32 int integer Bignum or Fixnum (as required)
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long int64 long integer/string Bignum
uint32 Uses variable-length encoding. uint32 int int/long uint32 uint integer Bignum or Fixnum (as required)
uint64 Uses variable-length encoding. uint64 long int/long uint64 ulong integer/string Bignum or Fixnum (as required)
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int int32 int integer Bignum or Fixnum (as required)
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long int64 long integer/string Bignum
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int uint32 uint integer Bignum or Fixnum (as required)
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long uint64 ulong integer/string Bignum
sfixed32 Always four bytes. int32 int int int32 int integer Bignum or Fixnum (as required)
sfixed64 Always eight bytes. int64 long int/long int64 long integer/string Bignum
bool bool boolean boolean bool bool boolean TrueClass/FalseClass
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode string string string String (UTF-8)
bytes May contain any arbitrary sequence of bytes. string ByteString str []byte ByteString string String (ASCII-8BIT)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SystemSettingKey_name = map[int32]string{
		0: "SYSTEM_SETTING_KEY_UNSPECIFIED",
		1: "BACKUP_CONFIG",
	}
	SystemSettingKey_value = map[string]int32{
		"SYSTEM_SETTING_KEY_UNSPECIFIED": 0,
		"BACKUP_CONFIG":                  1,
	}
)

Enum value maps for SystemSettingKey.

View Source
var (
	UserSettingKey_name = map[int32]string{
		0: "USER_SETTING_KEY_UNSPECIFIED",
		1: "USER_SETTING_ACCESS_TOKENS",
	}
	UserSettingKey_value = map[string]int32{
		"USER_SETTING_KEY_UNSPECIFIED": 0,
		"USER_SETTING_ACCESS_TOKENS":   1,
	}
)

Enum value maps for UserSettingKey.

View Source
var File_store_common_proto protoreflect.FileDescriptor
View Source
var File_store_system_setting_proto protoreflect.FileDescriptor
View Source
var File_store_user_setting_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type AccessTokensUserSetting

type AccessTokensUserSetting struct {
	AccessTokens []*AccessTokensUserSetting_AccessToken `protobuf:"bytes,1,rep,name=access_tokens,json=accessTokens,proto3" json:"access_tokens,omitempty"`
	// contains filtered or unexported fields
}

func (*AccessTokensUserSetting) Descriptor deprecated

func (*AccessTokensUserSetting) Descriptor() ([]byte, []int)

Deprecated: Use AccessTokensUserSetting.ProtoReflect.Descriptor instead.

func (*AccessTokensUserSetting) GetAccessTokens

func (*AccessTokensUserSetting) ProtoMessage

func (*AccessTokensUserSetting) ProtoMessage()

func (*AccessTokensUserSetting) ProtoReflect

func (x *AccessTokensUserSetting) ProtoReflect() protoreflect.Message

func (*AccessTokensUserSetting) Reset

func (x *AccessTokensUserSetting) Reset()

func (*AccessTokensUserSetting) String

func (x *AccessTokensUserSetting) String() string

type AccessTokensUserSetting_AccessToken

type AccessTokensUserSetting_AccessToken struct {

	// The access token is a JWT token.
	// Including expiration time, issuer, etc.
	AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
	// A description for the access token.
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// contains filtered or unexported fields
}

func (*AccessTokensUserSetting_AccessToken) Descriptor deprecated

func (*AccessTokensUserSetting_AccessToken) Descriptor() ([]byte, []int)

Deprecated: Use AccessTokensUserSetting_AccessToken.ProtoReflect.Descriptor instead.

func (*AccessTokensUserSetting_AccessToken) GetAccessToken

func (x *AccessTokensUserSetting_AccessToken) GetAccessToken() string

func (*AccessTokensUserSetting_AccessToken) GetDescription

func (x *AccessTokensUserSetting_AccessToken) GetDescription() string

func (*AccessTokensUserSetting_AccessToken) ProtoMessage

func (*AccessTokensUserSetting_AccessToken) ProtoMessage()

func (*AccessTokensUserSetting_AccessToken) ProtoReflect

func (*AccessTokensUserSetting_AccessToken) Reset

func (*AccessTokensUserSetting_AccessToken) String

type BackupConfig

type BackupConfig struct {

	// enabled indicates whether backup is enabled.
	Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	// cron is the cron expression for backup. See https://godoc.org/github.com/robfig/cron#hdr-CRON_Expression_Format
	Cron string `protobuf:"bytes,2,opt,name=cron,proto3" json:"cron,omitempty"`
	// max_keep is the maximum number of backups to keep.
	MaxKeep int32 `protobuf:"varint,3,opt,name=max_keep,json=maxKeep,proto3" json:"max_keep,omitempty"`
	// contains filtered or unexported fields
}

func (*BackupConfig) Descriptor deprecated

func (*BackupConfig) Descriptor() ([]byte, []int)

Deprecated: Use BackupConfig.ProtoReflect.Descriptor instead.

func (*BackupConfig) GetCron

func (x *BackupConfig) GetCron() string

func (*BackupConfig) GetEnabled

func (x *BackupConfig) GetEnabled() bool

func (*BackupConfig) GetMaxKeep

func (x *BackupConfig) GetMaxKeep() int32

func (*BackupConfig) ProtoMessage

func (*BackupConfig) ProtoMessage()

func (*BackupConfig) ProtoReflect

func (x *BackupConfig) ProtoReflect() protoreflect.Message

func (*BackupConfig) Reset

func (x *BackupConfig) Reset()

func (*BackupConfig) String

func (x *BackupConfig) String() string

type SystemSettingKey

type SystemSettingKey int32
const (
	SystemSettingKey_SYSTEM_SETTING_KEY_UNSPECIFIED SystemSettingKey = 0
	// BackupConfig is the key for auto-backup configuration.
	SystemSettingKey_BACKUP_CONFIG SystemSettingKey = 1
)

func (SystemSettingKey) Descriptor

func (SystemSettingKey) Enum

func (SystemSettingKey) EnumDescriptor deprecated

func (SystemSettingKey) EnumDescriptor() ([]byte, []int)

Deprecated: Use SystemSettingKey.Descriptor instead.

func (SystemSettingKey) Number

func (SystemSettingKey) String

func (x SystemSettingKey) String() string

func (SystemSettingKey) Type

type UserSetting

type UserSetting struct {
	UserId int32          `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Key    UserSettingKey `protobuf:"varint,2,opt,name=key,proto3,enum=memos.store.UserSettingKey" json:"key,omitempty"`
	// Types that are assignable to Value:
	//
	//	*UserSetting_AccessTokens
	Value isUserSetting_Value `protobuf_oneof:"value"`
	// contains filtered or unexported fields
}

func (*UserSetting) Descriptor deprecated

func (*UserSetting) Descriptor() ([]byte, []int)

Deprecated: Use UserSetting.ProtoReflect.Descriptor instead.

func (*UserSetting) GetAccessTokens

func (x *UserSetting) GetAccessTokens() *AccessTokensUserSetting

func (*UserSetting) GetKey

func (x *UserSetting) GetKey() UserSettingKey

func (*UserSetting) GetUserId

func (x *UserSetting) GetUserId() int32

func (*UserSetting) GetValue

func (m *UserSetting) GetValue() isUserSetting_Value

func (*UserSetting) ProtoMessage

func (*UserSetting) ProtoMessage()

func (*UserSetting) ProtoReflect

func (x *UserSetting) ProtoReflect() protoreflect.Message

func (*UserSetting) Reset

func (x *UserSetting) Reset()

func (*UserSetting) String

func (x *UserSetting) String() string

type UserSettingKey

type UserSettingKey int32
const (
	UserSettingKey_USER_SETTING_KEY_UNSPECIFIED UserSettingKey = 0
	// Access tokens for the user.
	UserSettingKey_USER_SETTING_ACCESS_TOKENS UserSettingKey = 1
)

func (UserSettingKey) Descriptor

func (UserSettingKey) Enum

func (x UserSettingKey) Enum() *UserSettingKey

func (UserSettingKey) EnumDescriptor deprecated

func (UserSettingKey) EnumDescriptor() ([]byte, []int)

Deprecated: Use UserSettingKey.Descriptor instead.

func (UserSettingKey) Number

func (UserSettingKey) String

func (x UserSettingKey) String() string

func (UserSettingKey) Type

type UserSetting_AccessTokens

type UserSetting_AccessTokens struct {
	AccessTokens *AccessTokensUserSetting `protobuf:"bytes,3,opt,name=access_tokens,json=accessTokens,proto3,oneof"`
}

Jump to

Keyboard shortcuts

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