api

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_api_proto protoreflect.FileDescriptor

Functions

func Request added in v0.0.5

func Request(ctx context.Context, creds KeyProvider, p proto.Message) error

Request performs an API request to the gopher.farm api server

func UserNameFromSignedMessage

func UserNameFromSignedMessage(signedMessage *SignedMessage) (string, error)

func VerifyMessage

func VerifyMessage(pubKey ed25519.PublicKey, signedMessage *SignedMessage) bool

Types

type KeyProvider

type KeyProvider interface {
	PrivateKey() *ed25519.PrivateKey
}

type Register

type Register struct {
	UserName    string                 `protobuf:"bytes,1,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"`
	PublicKey   []byte                 `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
	CurrentTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=current_time,json=currentTime,proto3" json:"current_time,omitempty"`
	Email       string                 `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"`
	// contains filtered or unexported fields
}

func (*Register) Descriptor deprecated

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

Deprecated: Use Register.ProtoReflect.Descriptor instead.

func (*Register) GetCurrentTime

func (x *Register) GetCurrentTime() *timestamppb.Timestamp

func (*Register) GetEmail

func (x *Register) GetEmail() string

func (*Register) GetPublicKey

func (x *Register) GetPublicKey() []byte

func (*Register) GetUserName

func (x *Register) GetUserName() string

func (*Register) ProtoMessage

func (*Register) ProtoMessage()

func (*Register) ProtoReflect

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

func (*Register) Reset

func (x *Register) Reset()

func (*Register) String

func (x *Register) String() string

type Reserve

type Reserve struct {
	UserName    string                 `protobuf:"bytes,1,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"`
	Path        string                 `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	CurrentTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=current_time,json=currentTime,proto3" json:"current_time,omitempty"`
	// contains filtered or unexported fields
}

func (*Reserve) Descriptor deprecated

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

Deprecated: Use Reserve.ProtoReflect.Descriptor instead.

func (*Reserve) GetCurrentTime

func (x *Reserve) GetCurrentTime() *timestamppb.Timestamp

func (*Reserve) GetPath

func (x *Reserve) GetPath() string

func (*Reserve) GetUserName

func (x *Reserve) GetUserName() string

func (*Reserve) ProtoMessage

func (*Reserve) ProtoMessage()

func (*Reserve) ProtoReflect

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

func (*Reserve) Reset

func (x *Reserve) Reset()

func (*Reserve) String

func (x *Reserve) String() string

type SignedMessage

type SignedMessage struct {
	Msg       *anypb.Any `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
	Signature []byte     `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

func SignMessage

func SignMessage(kp KeyProvider, m proto.Message) (*SignedMessage, error)

func (*SignedMessage) Descriptor deprecated

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

Deprecated: Use SignedMessage.ProtoReflect.Descriptor instead.

func (*SignedMessage) GetMsg

func (x *SignedMessage) GetMsg() *anypb.Any

func (*SignedMessage) GetSignature

func (x *SignedMessage) GetSignature() []byte

func (*SignedMessage) ProtoMessage

func (*SignedMessage) ProtoMessage()

func (*SignedMessage) ProtoReflect

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

func (*SignedMessage) Reset

func (x *SignedMessage) Reset()

func (*SignedMessage) String

func (x *SignedMessage) String() string

type Upload

type Upload struct {
	UserName    string                 `protobuf:"bytes,1,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"`
	ModPath     string                 `protobuf:"bytes,2,opt,name=mod_path,json=modPath,proto3" json:"mod_path,omitempty"`
	CurrentTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=current_time,json=currentTime,proto3" json:"current_time,omitempty"`
	Version     string                 `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"`
	ZipFile     []byte                 `protobuf:"bytes,5,opt,name=zip_file,json=zipFile,proto3" json:"zip_file,omitempty"`
	GoModFile   []byte                 `protobuf:"bytes,6,opt,name=go_mod_file,json=goModFile,proto3" json:"go_mod_file,omitempty"`
	// contains filtered or unexported fields
}

func (*Upload) Descriptor deprecated

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

Deprecated: Use Upload.ProtoReflect.Descriptor instead.

func (*Upload) GetCurrentTime

func (x *Upload) GetCurrentTime() *timestamppb.Timestamp

func (*Upload) GetGoModFile

func (x *Upload) GetGoModFile() []byte

func (*Upload) GetModPath

func (x *Upload) GetModPath() string

func (*Upload) GetUserName

func (x *Upload) GetUserName() string

func (*Upload) GetVersion

func (x *Upload) GetVersion() string

func (*Upload) GetZipFile

func (x *Upload) GetZipFile() []byte

func (*Upload) ProtoMessage

func (*Upload) ProtoMessage()

func (*Upload) ProtoReflect

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

func (*Upload) Reset

func (x *Upload) Reset()

func (*Upload) String

func (x *Upload) String() string

Jump to

Keyboard shortcuts

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