tyrpc

package
v0.0.0-...-4ed2781 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2019 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterTyphonServer

func RegisterTyphonServer(s *grpc.Server, srv TyphonServer)

Types

type Empty

type Empty struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Empty) Descriptor

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

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Empty) XXX_Merge

func (m *Empty) XXX_Merge(src proto.Message)

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

func (m *Empty) XXX_Unmarshal(b []byte) error

type ModMsg

type ModMsg struct {
	OldSecret            *Secret  `protobuf:"bytes,1,opt,name=oldSecret,proto3" json:"oldSecret,omitempty"`
	NewSecret            *Secret  `protobuf:"bytes,2,opt,name=newSecret,proto3" json:"newSecret,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ModMsg) Descriptor

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

func (*ModMsg) GetNewSecret

func (m *ModMsg) GetNewSecret() *Secret

func (*ModMsg) GetOldSecret

func (m *ModMsg) GetOldSecret() *Secret

func (*ModMsg) ProtoMessage

func (*ModMsg) ProtoMessage()

func (*ModMsg) Reset

func (m *ModMsg) Reset()

func (*ModMsg) String

func (m *ModMsg) String() string

func (*ModMsg) Validate

func (m *ModMsg) Validate() (err error)

Validate modMsg

func (*ModMsg) XXX_DiscardUnknown

func (m *ModMsg) XXX_DiscardUnknown()

func (*ModMsg) XXX_Marshal

func (m *ModMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ModMsg) XXX_Merge

func (m *ModMsg) XXX_Merge(src proto.Message)

func (*ModMsg) XXX_Size

func (m *ModMsg) XXX_Size() int

func (*ModMsg) XXX_Unmarshal

func (m *ModMsg) XXX_Unmarshal(b []byte) error

type PubKey

type PubKey struct {
	Token                string   `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	PubKey               string   `protobuf:"bytes,2,opt,name=pubKey,proto3" json:"pubKey,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PubKey) Descriptor

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

func (*PubKey) GetPubKey

func (m *PubKey) GetPubKey() string

func (*PubKey) GetToken

func (m *PubKey) GetToken() string

func (*PubKey) ProtoMessage

func (*PubKey) ProtoMessage()

func (*PubKey) Reset

func (m *PubKey) Reset()

func (*PubKey) String

func (m *PubKey) String() string

func (*PubKey) XXX_DiscardUnknown

func (m *PubKey) XXX_DiscardUnknown()

func (*PubKey) XXX_Marshal

func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PubKey) XXX_Merge

func (m *PubKey) XXX_Merge(src proto.Message)

func (*PubKey) XXX_Size

func (m *PubKey) XXX_Size() int

func (*PubKey) XXX_Unmarshal

func (m *PubKey) XXX_Unmarshal(b []byte) error

type Secret

type Secret struct {
	ID                   uint32   `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Name                 string   `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	TTL                  uint32   `protobuf:"varint,3,opt,name=TTL,proto3" json:"TTL,omitempty"`
	Data                 []byte   `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
	DateCreated          int64    `protobuf:"varint,5,opt,name=dateCreated,proto3" json:"dateCreated,omitempty"`
	DateToDie            int64    `protobuf:"varint,6,opt,name=dateToDie,proto3" json:"dateToDie,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Secret) Descriptor

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

func (*Secret) GetData

func (m *Secret) GetData() []byte

func (*Secret) GetDateCreated

func (m *Secret) GetDateCreated() int64

func (*Secret) GetDateToDie

func (m *Secret) GetDateToDie() int64

func (*Secret) GetID

func (m *Secret) GetID() uint32

func (*Secret) GetName

func (m *Secret) GetName() string

func (*Secret) GetTTL

func (m *Secret) GetTTL() uint32

func (*Secret) ProtoMessage

func (*Secret) ProtoMessage()

func (*Secret) Reset

func (m *Secret) Reset()

func (*Secret) String

func (m *Secret) String() string

func (*Secret) Validate

func (m *Secret) Validate() (err error)

Validate secret

func (*Secret) XXX_DiscardUnknown

func (m *Secret) XXX_DiscardUnknown()

func (*Secret) XXX_Marshal

func (m *Secret) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Secret) XXX_Merge

func (m *Secret) XXX_Merge(src proto.Message)

func (*Secret) XXX_Size

func (m *Secret) XXX_Size() int

func (*Secret) XXX_Unmarshal

func (m *Secret) XXX_Unmarshal(b []byte) error

type State

type State struct {
	State                bool     `protobuf:"varint,1,opt,name=state,proto3" json:"state,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*State) Descriptor

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

func (*State) GetState

func (m *State) GetState() bool

func (*State) ProtoMessage

func (*State) ProtoMessage()

func (*State) Reset

func (m *State) Reset()

func (*State) String

func (m *State) String() string

func (*State) XXX_DiscardUnknown

func (m *State) XXX_DiscardUnknown()

func (*State) XXX_Marshal

func (m *State) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*State) XXX_Merge

func (m *State) XXX_Merge(src proto.Message)

func (*State) XXX_Size

func (m *State) XXX_Size() int

func (*State) XXX_Unmarshal

func (m *State) XXX_Unmarshal(b []byte) error

type TyphonClient

type TyphonClient interface {
	GetSecret(ctx context.Context, in *Secret, opts ...grpc.CallOption) (*Secret, error)
	AddSecret(ctx context.Context, in *Secret, opts ...grpc.CallOption) (*Secret, error)
	ModifySecretName(ctx context.Context, in *ModMsg, opts ...grpc.CallOption) (*Empty, error)
	ModifySecretTTL(ctx context.Context, in *ModMsg, opts ...grpc.CallOption) (*Empty, error)
	ListSecrets(ctx context.Context, in *Empty, opts ...grpc.CallOption) (Typhon_ListSecretsClient, error)
	InfoSecret(ctx context.Context, in *Secret, opts ...grpc.CallOption) (*Secret, error)
	RemoveSecret(ctx context.Context, in *Secret, opts ...grpc.CallOption) (*Secret, error)
	Init(ctx context.Context, in *PubKey, opts ...grpc.CallOption) (*Empty, error)
	AddUser(ctx context.Context, in *User, opts ...grpc.CallOption) (*User, error)
	BlockUser(ctx context.Context, in *User, opts ...grpc.CallOption) (*User, error)
	UnBlockUser(ctx context.Context, in *User, opts ...grpc.CallOption) (*User, error)
	RemoveUser(ctx context.Context, in *User, opts ...grpc.CallOption) (*User, error)
	ListUsers(ctx context.Context, in *Empty, opts ...grpc.CallOption) (Typhon_ListUsersClient, error)
	SetLock(ctx context.Context, in *State, opts ...grpc.CallOption) (*State, error)
}

TyphonClient is the client API for Typhon service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewTyphonClient

func NewTyphonClient(cc *grpc.ClientConn) TyphonClient

type TyphonServer

type TyphonServer interface {
	GetSecret(context.Context, *Secret) (*Secret, error)
	AddSecret(context.Context, *Secret) (*Secret, error)
	ModifySecretName(context.Context, *ModMsg) (*Empty, error)
	ModifySecretTTL(context.Context, *ModMsg) (*Empty, error)
	ListSecrets(*Empty, Typhon_ListSecretsServer) error
	InfoSecret(context.Context, *Secret) (*Secret, error)
	RemoveSecret(context.Context, *Secret) (*Secret, error)
	Init(context.Context, *PubKey) (*Empty, error)
	AddUser(context.Context, *User) (*User, error)
	BlockUser(context.Context, *User) (*User, error)
	UnBlockUser(context.Context, *User) (*User, error)
	RemoveUser(context.Context, *User) (*User, error)
	ListUsers(*Empty, Typhon_ListUsersServer) error
	SetLock(context.Context, *State) (*State, error)
}

TyphonServer is the server API for Typhon service.

type Typhon_ListSecretsClient

type Typhon_ListSecretsClient interface {
	Recv() (*Secret, error)
	grpc.ClientStream
}

type Typhon_ListSecretsServer

type Typhon_ListSecretsServer interface {
	Send(*Secret) error
	grpc.ServerStream
}

type Typhon_ListUsersClient

type Typhon_ListUsersClient interface {
	Recv() (*User, error)
	grpc.ClientStream
}

type Typhon_ListUsersServer

type Typhon_ListUsersServer interface {
	Send(*User) error
	grpc.ServerStream
}

type UnimplementedTyphonServer

type UnimplementedTyphonServer struct {
}

UnimplementedTyphonServer can be embedded to have forward compatible implementations.

func (*UnimplementedTyphonServer) AddSecret

func (*UnimplementedTyphonServer) AddSecret(ctx context.Context, req *Secret) (*Secret, error)

func (*UnimplementedTyphonServer) AddUser

func (*UnimplementedTyphonServer) AddUser(ctx context.Context, req *User) (*User, error)

func (*UnimplementedTyphonServer) BlockUser

func (*UnimplementedTyphonServer) BlockUser(ctx context.Context, req *User) (*User, error)

func (*UnimplementedTyphonServer) GetSecret

func (*UnimplementedTyphonServer) GetSecret(ctx context.Context, req *Secret) (*Secret, error)

func (*UnimplementedTyphonServer) InfoSecret

func (*UnimplementedTyphonServer) InfoSecret(ctx context.Context, req *Secret) (*Secret, error)

func (*UnimplementedTyphonServer) Init

func (*UnimplementedTyphonServer) ListSecrets

func (*UnimplementedTyphonServer) ListUsers

func (*UnimplementedTyphonServer) ModifySecretName

func (*UnimplementedTyphonServer) ModifySecretName(ctx context.Context, req *ModMsg) (*Empty, error)

func (*UnimplementedTyphonServer) ModifySecretTTL

func (*UnimplementedTyphonServer) ModifySecretTTL(ctx context.Context, req *ModMsg) (*Empty, error)

func (*UnimplementedTyphonServer) RemoveSecret

func (*UnimplementedTyphonServer) RemoveSecret(ctx context.Context, req *Secret) (*Secret, error)

func (*UnimplementedTyphonServer) RemoveUser

func (*UnimplementedTyphonServer) RemoveUser(ctx context.Context, req *User) (*User, error)

func (*UnimplementedTyphonServer) SetLock

func (*UnimplementedTyphonServer) SetLock(ctx context.Context, req *State) (*State, error)

func (*UnimplementedTyphonServer) UnBlockUser

func (*UnimplementedTyphonServer) UnBlockUser(ctx context.Context, req *User) (*User, error)

type User

type User struct {
	ID                   uint32   `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Name                 string   `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Token                string   `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
	Password             string   `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"`
	Blocked              bool     `protobuf:"varint,5,opt,name=blocked,proto3" json:"blocked,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*User) Descriptor

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

func (*User) GetBlocked

func (m *User) GetBlocked() bool

func (*User) GetID

func (m *User) GetID() uint32

func (*User) GetName

func (m *User) GetName() string

func (*User) GetPassword

func (m *User) GetPassword() string

func (*User) GetToken

func (m *User) GetToken() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) String

func (m *User) String() string

func (*User) Validate

func (m *User) Validate() (err error)

Validate user

func (*User) XXX_DiscardUnknown

func (m *User) XXX_DiscardUnknown()

func (*User) XXX_Marshal

func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*User) XXX_Merge

func (m *User) XXX_Merge(src proto.Message)

func (*User) XXX_Size

func (m *User) XXX_Size() int

func (*User) XXX_Unmarshal

func (m *User) XXX_Unmarshal(b []byte) error

type Validator

type Validator interface {
	Validate() (err error)
}

Validator interface for secret and user validation

Jump to

Keyboard shortcuts

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